GigaSpaces XAP 7.0 API

com.gigaspaces.datasource
Interface DataProvider<T>

Type Parameters:
T -
All Superinterfaces:
ManagedDataSource<T>
All Known Subinterfaces:
DataPersister<T>, ExternalDataSource<T>
All Known Implementing Classes:
CriteriaHibernateExternalDataSource, DataProviderSplitter, 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. Note: If SQLDataProvider is implemented, the space will use it for all the read operations instead of the DataProvider. Implement this interface only if you don't intend to use SQLQuery at all.

Since:
6.0
Author:
anna
See Also:
SQLDataProvider

Field Summary
 
Fields inherited from interface com.gigaspaces.datasource.ManagedDataSource
DATA_CLASS_PROPS, NUMBER_OF_PARTITIONS, STATIC_PARTITION_NUMBER
 
Method Summary
 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:
matched object or null
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. If SQLDataProvider interface is also implemented - the space will use SQLDataProvider.iterator instead.

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

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.