com.gigaspaces.datasource
Interface DataPersister<T>

All Superinterfaces:
DataProvider<T>, ManagedDataSource<T>
All Known Subinterfaces:
ExternalDataSource<T>
All Known Implementing Classes:
HibernateDataSource

public interface DataPersister<T>
extends DataProvider<T>

DataPersister is responsible for the persistency of the space data in external data source.

This interface should be implemented for non-transactional applications.
Single operations - write,update and remove are used for objects with UID.
Batch operations - are used for batch space operations for objects without UID.

Since:
6.0

Field Summary
 
Fields inherited from interface com.gigaspaces.datasource.ManagedDataSource
DATA_CLASS_PROPS, NUMBER_OF_PARTITIONS, STATIC_PARTITION_NUMBER
 
Method Summary
 void remove(T object)
          Remove the given object from the data store
 void removeBatch(List<T> objects)
          Remove given objects from the data store.
 void update(T object)
          Update the given object in the data store
 void updateBatch(List<T> objects)
          Update given objects in the data store.
 void write(T object)
          Write given new object to the data store
 void writeBatch(List<T> objects)
          Write given new objects to the data store.
 
Methods inherited from interface com.gigaspaces.datasource.DataProvider
count, iterator, read
 
Methods inherited from interface com.gigaspaces.datasource.ManagedDataSource
init, initialLoad, shutdown
 

Method Detail

write

void write(T object)
           throws DataSourceException
Write given new object to the data store

Parameters:
object -
Throws:
DataSourceException

update

void update(T object)
            throws DataSourceException
Update the given object in the data store

Parameters:
object -
Throws:
DataSourceException

remove

void remove(T object)
            throws DataSourceException
Remove the given object from the data store

Parameters:
object -
Throws:
DataSourceException

writeBatch

void writeBatch(List<T> objects)
                throws DataSourceException
Write given new objects to the data store.

If the implementation uses transactions,
all the objects must be written in one transaction.

Parameters:
objects -
Throws:
DataSourceException

updateBatch

void updateBatch(List<T> objects)
                 throws DataSourceException
Update given objects in the data store.

If the implementation uses transactions,
all the objects must be updated in one transaction.

This operation is not currently supported by the space.

Parameters:
objects -
Throws:
DataSourceException

removeBatch

void removeBatch(List<T> objects)
                 throws DataSourceException
Remove given objects from the data store.

If the implementation uses transactions,
All the objects must be removed in one transaction.

This operation is not currently supported by the space.

Parameters:
objects -
Throws:
DataSourceException