com.ibm.di.connector
Class DominoChangeDetectionConnector

java.lang.Object
  extended by com.ibm.di.connector.Connector
      extended by com.ibm.di.connector.DominoChangeDetectionConnector
All Implemented Interfaces:
ChangelogInterface, ConnectorInterface, CheckpointRestartInterface, VersionInfoInterface, Runnable, Comparator

public class DominoChangeDetectionConnector
extends Connector
implements ConnectorInterface, CheckpointRestartInterface, ChangelogInterface, Runnable, Comparator


Field Summary
 
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
 
Fields inherited from interface com.ibm.di.server.CheckpointRestartInterface
RESTART_AFTER, RESTART_BEFORE, RESTART_IN
 
Fields inherited from interface com.ibm.di.connector.ChangelogInterface
CONN_PARAM_STATE_KEY_PERSISTENCE, PARAM_VAL_AFTER_READ, PARAM_VAL_END_OF_CYCLE, PARAM_VAL_MANUAL, SAVE_STATE_AFTER_READ, SAVE_STATE_END_OF_CYCLE, SAVE_STATE_MANUAL
 
Constructor Summary
DominoChangeDetectionConnector()
          Connector's public constructor.
 
Method Summary
 int compare(Object arg0, Object arg1)
          Compares two documents by the dates they are modified
 Entry getCheckpointInformation()
          Returns the state information for the connector.
 Entry getNextEntry()
          Retrieves the next changed entry.
 Object getStateKeyObject()
           
 int getStateKeySaveMethod()
           
 String getVersion()
          Returns the version of the Connector.
 void initialize(Object aObj)
          Reads Connector paramaeters and initializes the local and IIOP Notes sessions.
 boolean isCheckpointRestartEnabled(int aMode)
          Components that support checkpoint/restart for a specific mode must return TRUE from this method.
 void prepareForRestart(ALState aState, Entry aRestartInfo, int aRestartPoint)
          Notifies the connector of a restart situation.
 void run()
           
 void saveStateKey()
          This method saves the synchronization state of the Connector.
 void selectEntries()
          Reads and sets the start synchronization state.
 void terminate()
          Terminates the local and IIOP Notes sessions.
 
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, deleteEntry, findEntry, findEntry, getBoolean, getClassInstance, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getLog, getMaxDuplicateEntries, getModes, getModes, getName, getNextClient, getNextFindEntry, getParam, getParser, getProperty, getPushbackEntry, getRawConnectorConfiguration, getRSInterface, hasConfigValue, hasParser, initParser, isDeltaSupported, isExceptionFatal, isIOException, logmsg, modEntry, modEntry, pushback, putEntry, queryOperations, queryReply, querySchema, queryTables, reconnect, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setModes, setModes, setName, setParam, setParser, setProperty, setRSInterface, terminateServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.di.connector.ConnectorInterface
deleteEntry, findEntry, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextClient, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, modEntry, pushback, putEntry, queryOperations, queryReply, querySchema, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

DominoChangeDetectionConnector

public DominoChangeDetectionConnector()
Connector's public constructor. Sets Connector's name and supported modes.

Method Detail

run

public void run()
Specified by:
run in interface Runnable

initialize

public void initialize(Object aObj)
                throws Exception
Reads Connector paramaeters and initializes the local and IIOP Notes sessions. Opens the specified database in both local and IIOP session.

Specified by:
initialize in interface ConnectorInterface
Overrides:
initialize in class Connector
Parameters:
aObj - User provided parameter
Throws:
Exception

selectEntries

public void selectEntries()
                   throws Exception
Reads and sets the start synchronization state.

Specified by:
selectEntries in interface ConnectorInterface
Overrides:
selectEntries in class Connector
Throws:
Exception

getNextEntry

public Entry getNextEntry()
                   throws Exception
Retrieves the next changed entry.

Specified by:
getNextEntry in interface ConnectorInterface
Overrides:
getNextEntry in class Connector
Returns:
- the next Entry, or null if no more data
Throws:
Exception
See Also:
Connector.selectEntries()

terminate

public void terminate()
Terminates the local and IIOP Notes sessions.

Specified by:
terminate in interface ConnectorInterface
Overrides:
terminate in class Connector

compare

public int compare(Object arg0,
                   Object arg1)
Compares two documents by the dates they are modified

Specified by:
compare in interface Comparator
Parameters:
arg0 - the unID of the first document
arg1 - the unID of the second document
Returns:
-1 if the first document was modified before the second; 1 if the first document was modified afrer the second; 0 if the time of modification was the same

isCheckpointRestartEnabled

public boolean isCheckpointRestartEnabled(int aMode)
Components that support checkpoint/restart for a specific mode must return TRUE from this method. If a restart has no meaning for mode then the connector should still return TRUE.

Specified by:
isCheckpointRestartEnabled in interface CheckpointRestartInterface
Parameters:
aMode - The mode the connector runs in.
Returns:
true if checkpoint is supported in mode
See Also:
ServerConstants

getCheckpointInformation

public Entry getCheckpointInformation()
                               throws Exception
Returns the state information for the connector. If for some reason the connector decidies that a restart is impossible it must throw an exception. The method is called immediatly before any component methods are called. If there is no need to save any state information a null value should be returned. For eventhandlers this method is called by the dispatcher routine.

Specified by:
getCheckpointInformation in interface CheckpointRestartInterface
Returns:
The entry the connector needs to do a restart or null if that is not needed.
Throws:
Exception

prepareForRestart

public void prepareForRestart(ALState aState,
                              Entry aRestartInfo,
                              int aRestartPoint)
                       throws Exception
Notifies the connector of a restart situation. This method is called after the connector has been loaded and before any other method calls are made to the connector. If the connector decides it cannot restart it must throw an exception.

Specified by:
prepareForRestart in interface CheckpointRestartInterface
Parameters:
aState -
aRestartInfo - The last entry object returned by the connector in the getCheckpointInformation method.
aRestartPoint -
Throws:
Exception

getVersion

public String getVersion()
Returns the version of the Connector.

Specified by:
getVersion in interface VersionInfoInterface

getStateKeySaveMethod

public int getStateKeySaveMethod()
                          throws Exception
Specified by:
getStateKeySaveMethod in interface ChangelogInterface
Throws:
Exception

saveStateKey

public void saveStateKey()
                  throws Exception
This method saves the synchronization state of the Connector. This method should be called by users (using script component) whenever they want to save the synchronization state.

Specified by:
saveStateKey in interface ChangelogInterface
Throws:
Exception - if the synchronization fails.

getStateKeyObject

public Object getStateKeyObject()
                         throws Exception
Specified by:
getStateKeyObject in interface ChangelogInterface
Throws:
Exception