com.sleepycat.je.sync.jdbc
Class JDBCSyncProcessor

java.lang.Object
  extended by com.sleepycat.je.sync.SyncProcessor
      extended by com.sleepycat.je.sync.jdbc.JDBCSyncProcessor

public class JDBCSyncProcessor
extends SyncProcessor


Field Summary
 
Fields inherited from class com.sleepycat.je.sync.SyncProcessor
env, envImpl, processorName
 
Constructor Summary
JDBCSyncProcessor(Environment env, String processorName, JDBCConnectionConfig connectionConfig)
          Creates a SyncProcessor for synchronizing data between JE and an external data repository via JDBC.
 
Method Summary
 SyncDataSet addDataSet(String dataSetName, Collection<SyncDatabase> databases)
          Adds a data set that is managed by this processor.
 void cancelSync()
          Cancels a sync operation being performed in another thread.
 JDBCConnectionConfig getConnectionConfig()
          Returns the connection configuration.
 Map<String,SyncDataSet> getDataSets()
          Returns all SyncDataSets that are managed by this processor.
 void removeDataSet(String dataSetName)
          Removes a data set that is managed by this processor.
 void setConnectionConfig(JDBCConnectionConfig connectionConfig)
          Changes the connection configuration.
 void sync(ExportConfig exportConfig, ImportConfig importConfig, String... dataSetName)
          Performs a sync operation for the specified SyncDataSets.
 void syncAll(ExportConfig exportConfig, ImportConfig importConfig)
          Performs a sync operation for all SyncDataSets managed by this processor.
 
Methods inherited from class com.sleepycat.je.sync.SyncProcessor
getEnvironment, getName, getSyncDB, openChangeReader, readChangeSetData, readProcessorMetadata, readProcessorTxnData, registerDataSet, setAddHook, setRemoveHook, unregisterDataSet, writeChangeSetData, writeProcessorMetadata, writeProcessorTxnData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCSyncProcessor

public JDBCSyncProcessor(Environment env,
                         String processorName,
                         JDBCConnectionConfig connectionConfig)
Creates a SyncProcessor for synchronizing data between JE and an external data repository via JDBC.

Method Detail

getConnectionConfig

public JDBCConnectionConfig getConnectionConfig()
Returns the connection configuration.


setConnectionConfig

public void setConnectionConfig(JDBCConnectionConfig connectionConfig)
Changes the connection configuration.


addDataSet

public SyncDataSet addDataSet(String dataSetName,
                              Collection<SyncDatabase> databases)
Description copied from class: SyncProcessor
Adds a data set that is managed by this processor.

After calling this method, all changes to the JE databases in the data set will be tracked by JE, so they can be exported to the external system during a sync operation. The tracking of changes in the external system, if any, is defined by the SyncProcessor subclass.

The user must ensure that no transactions for the databases in the data set are active during the call to this method. If transactions are active, the results of the first sync operation with respect to these transactions are undefined, and the sync is unlikely to succeed.

Normally, each database in a newly added data set should be initially empty or non-existent. If a database is non-empty, the user must ensure that the records in the database are present in the external system.

Specified by:
addDataSet in class SyncProcessor

removeDataSet

public void removeDataSet(String dataSetName)
Description copied from class: SyncProcessor
Removes a data set that is managed by this processor.

Specified by:
removeDataSet in class SyncProcessor

getDataSets

public Map<String,SyncDataSet> getDataSets()
Description copied from class: SyncProcessor
Returns all SyncDataSets that are managed by this processor.

Specified by:
getDataSets in class SyncProcessor

syncAll

public void syncAll(ExportConfig exportConfig,
                    ImportConfig importConfig)
Description copied from class: SyncProcessor
Performs a sync operation for all SyncDataSets managed by this processor.

Specified by:
syncAll in class SyncProcessor

sync

public void sync(ExportConfig exportConfig,
                 ImportConfig importConfig,
                 String... dataSetName)
Description copied from class: SyncProcessor
Performs a sync operation for the specified SyncDataSets.

Specified by:
sync in class SyncProcessor

cancelSync

public void cancelSync()
Description copied from class: SyncProcessor
Cancels a sync operation being performed in another thread. Causes the SyncCancelException to be thrown by the method that invoked the sync.

Specified by:
cancelSync in class SyncProcessor


Copyright (c) 2004-2012 Oracle. All rights reserved.