fr.fastconnect.wanblueprint.mirror
Class ExternalDataSourceAdapter<T>

java.lang.Object
  extended by fr.fastconnect.wanblueprint.mirror.ExternalDataSourceAdapter<T>
Type Parameters:
T -
All Implemented Interfaces:
com.gigaspaces.datasource.BulkDataPersister, com.gigaspaces.datasource.DataPersister<T>, com.gigaspaces.datasource.DataProvider<T>, com.gigaspaces.datasource.ExternalDataSource<T>, com.gigaspaces.datasource.ManagedDataSource<T>, com.gigaspaces.datasource.SQLDataProvider<T>

public class ExternalDataSourceAdapter<T>
extends java.lang.Object
implements com.gigaspaces.datasource.ExternalDataSource<T>

Simple ExternalDataSource adapter.
Since there is apparently no way to implement only the DataBulkProvider with an external datasource in a pu.xml use this class to simplify mirror implementation.


Constructor Summary
ExternalDataSourceAdapter()
           
 
Method Summary
 int count(com.j_spaces.core.client.SQLQuery<T> query)
           
 int count(T template)
           
 void executeBulk(java.util.List<com.gigaspaces.datasource.BulkItem> bulk)
           
 void init(java.util.Properties properties)
           
 com.gigaspaces.datasource.DataIterator<T> initialLoad()
           
 com.gigaspaces.datasource.DataIterator<T> iterator(com.j_spaces.core.client.SQLQuery<T> query)
           
 com.gigaspaces.datasource.DataIterator<T> iterator(T template)
           
 T read(T template)
           
 void remove(T object)
           
 void removeBatch(java.util.List<T> objects)
           
 void shutdown()
           
 void update(T object)
           
 void updateBatch(java.util.List<T> objects)
           
 void write(T object)
           
 void writeBatch(java.util.List<T> objects)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExternalDataSourceAdapter

public ExternalDataSourceAdapter()
Method Detail

count

public int count(com.j_spaces.core.client.SQLQuery<T> query)
          throws com.gigaspaces.datasource.DataSourceException
Specified by:
count in interface com.gigaspaces.datasource.SQLDataProvider<T>
Throws:
com.gigaspaces.datasource.DataSourceException

count

public int count(T template)
          throws com.gigaspaces.datasource.DataSourceException
Specified by:
count in interface com.gigaspaces.datasource.DataProvider<T>
Throws:
com.gigaspaces.datasource.DataSourceException

executeBulk

public void executeBulk(java.util.List<com.gigaspaces.datasource.BulkItem> bulk)
                 throws com.gigaspaces.datasource.DataSourceException
Specified by:
executeBulk in interface com.gigaspaces.datasource.BulkDataPersister
Throws:
com.gigaspaces.datasource.DataSourceException

init

public void init(java.util.Properties properties)
          throws com.gigaspaces.datasource.DataSourceException
Specified by:
init in interface com.gigaspaces.datasource.ManagedDataSource<T>
Throws:
com.gigaspaces.datasource.DataSourceException

initialLoad

public com.gigaspaces.datasource.DataIterator<T> initialLoad()
                                                      throws com.gigaspaces.datasource.DataSourceException
Specified by:
initialLoad in interface com.gigaspaces.datasource.ManagedDataSource<T>
Throws:
com.gigaspaces.datasource.DataSourceException

iterator

public com.gigaspaces.datasource.DataIterator<T> iterator(com.j_spaces.core.client.SQLQuery<T> query)
                                                   throws com.gigaspaces.datasource.DataSourceException
Specified by:
iterator in interface com.gigaspaces.datasource.SQLDataProvider<T>
Throws:
com.gigaspaces.datasource.DataSourceException

iterator

public com.gigaspaces.datasource.DataIterator<T> iterator(T template)
                                                   throws com.gigaspaces.datasource.DataSourceException
Specified by:
iterator in interface com.gigaspaces.datasource.DataProvider<T>
Throws:
com.gigaspaces.datasource.DataSourceException

read

public T read(T template)
       throws com.gigaspaces.datasource.DataSourceException
Specified by:
read in interface com.gigaspaces.datasource.DataProvider<T>
Throws:
com.gigaspaces.datasource.DataSourceException

remove

public void remove(T object)
            throws com.gigaspaces.datasource.DataSourceException
Specified by:
remove in interface com.gigaspaces.datasource.DataPersister<T>
Throws:
com.gigaspaces.datasource.DataSourceException

removeBatch

public void removeBatch(java.util.List<T> objects)
                 throws com.gigaspaces.datasource.DataSourceException
Specified by:
removeBatch in interface com.gigaspaces.datasource.DataPersister<T>
Throws:
com.gigaspaces.datasource.DataSourceException

shutdown

public void shutdown()
              throws com.gigaspaces.datasource.DataSourceException
Specified by:
shutdown in interface com.gigaspaces.datasource.ManagedDataSource<T>
Throws:
com.gigaspaces.datasource.DataSourceException

update

public void update(T object)
            throws com.gigaspaces.datasource.DataSourceException
Specified by:
update in interface com.gigaspaces.datasource.DataPersister<T>
Throws:
com.gigaspaces.datasource.DataSourceException

updateBatch

public void updateBatch(java.util.List<T> objects)
                 throws com.gigaspaces.datasource.DataSourceException
Specified by:
updateBatch in interface com.gigaspaces.datasource.DataPersister<T>
Throws:
com.gigaspaces.datasource.DataSourceException

write

public void write(T object)
           throws com.gigaspaces.datasource.DataSourceException
Specified by:
write in interface com.gigaspaces.datasource.DataPersister<T>
Throws:
com.gigaspaces.datasource.DataSourceException

writeBatch

public void writeBatch(java.util.List<T> objects)
                throws com.gigaspaces.datasource.DataSourceException
Specified by:
writeBatch in interface com.gigaspaces.datasource.DataPersister<T>
Throws:
com.gigaspaces.datasource.DataSourceException


Copyright © 2007-2009 FastConnect. All Rights Reserved.