com.gigaspaces.datasource
Interface DataProvider<T>

Type Parameters:
T -
All Superinterfaces:
ManagedDataSource<T>
All Known Subinterfaces:
DataPersister<T>, ExternalDataSource<T>
All Known Implementing Classes:
HibernateDataSource

public interface DataProvider<T>
extends ManagedDataSource<T>

DataProvider is responsible for retrieving space data from external data source.

This interfaces should be implemented for simple space access.

DataProvider is used by the space in the following scenarios:
- reads by UID.
- empty template.
- non-abstract class without extended match codes.

Any other scenario requires an implementation of the SQLDataProvider

Since:
6.0
See Also:
SQLDataProvider

Field Summary
 
Fields inherited from interface com.gigaspaces.datasource.ManagedDataSource
DATA_CLASS_PROPS, NUMBER_OF_PARTITIONS, STATIC_PARTITION_NUMBER
 
Method Summary
 int count(T template)
          Count number of object in the data source that match given template.
 DataIterator<T> iterator(T template)
          Create an iterator over all objects that match the given template.
 T read(T template)
          Read one object that matches the given template.
 
Methods inherited from interface com.gigaspaces.datasource.ManagedDataSource
init, initialLoad, shutdown
 

Method Detail

read

T read(T template)
       throws DataSourceException
Read one object that matches the given template.
Used by the space for read templates with UID.

Parameters:
template -
Returns:
Throws:
DataSourceException

iterator

DataIterator<T> iterator(T template)
                         throws DataSourceException
Create an iterator over all objects that match the given template.
Note: null value can be passed - in case of a null template or at initial space load

Parameters:
template -
Returns:
a DataIterator or null if no data was found that match the given template
Throws:
DataSourceException

count

int count(T template)
          throws DataSourceException
Count number of object in the data source that match given template.
Note: null value can be passed - in case of a null template.

Parameters:
template -
Returns:
Throws:
DataSourceException