Package com.ibm.di.connector
Class IDSChangelogConnector
- java.lang.Object
-
- com.ibm.di.connector.Connector
-
- com.ibm.di.connector.LDAPConnector
-
- com.ibm.di.connector.ChangelogConnector
-
- com.ibm.di.connector.IDSChangelogConnector
-
- All Implemented Interfaces:
ChangelogInterface,ConnectorInterface,VersionInfoInterface,java.util.EventListener,javax.naming.event.NamingListener,javax.naming.ldap.UnsolicitedNotificationListener
public class IDSChangelogConnector extends ChangelogConnector implements ConnectorInterface, ChangelogInterface, javax.naming.ldap.UnsolicitedNotificationListener
The IDSChangelogConnector provides a way to to detect changes in a IBM Tivoli Directory Server. The Connector connects to the underline directory through the JNDI interface and gets the changes done on a specific context. The Connector regularly saves current state into the System Store to avoid duplications when retrieving Entries.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringATTRIBUTE_CHANGENUMBERAttribute name: "changenumber"static java.lang.StringATTRIBUTE_CPRAttribute name: "changeNumber"static intCHANGE_ALLThe type of change that we will get notified for.static java.lang.StringEVT_REG_OIDThe id of the specific control supported by IBM TDS, used for registering to the server.static java.lang.StringEVT_UNREG_OIDThe id of the specific control supported by IBM TDS, used for unregistering from the server.static intPAGE_SIZE_DEFAULT_VALUEThe default value used for page size.static java.lang.StringPARAM_BATCH_RETRIEVALParameter Name: "batchRetrieval"static java.lang.StringPARAM_LDAP_SEARCH_BASEParameter Name: "ldapSearchBase"static java.lang.StringPARAM_PAGE_SIZEParameter Name: "pageSize"static java.lang.StringPARAM_SLEEP_INTERVALParameter Name: "nsSleepInterval"static java.lang.StringPARAM_START_ATParameter Name: "nsChangenumber"static java.lang.StringPARAM_STORE_PARAM_NAMEParameter Name: "iteratorStateKey"static java.lang.StringPARAM_TIMEOUTParameter Name: "nsTimeout"static java.lang.StringPARAM_USE_NOTIFICATIONSParameter Name: "useNotifications"-
Fields inherited from class com.ibm.di.connector.ChangelogConnector
bothSeparated, defaultMerge, mLdifParser, onlyChanges, PARAM_MERGE_MODE
-
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.connector.ChangelogInterface
CONN_PARAM_STATE_KEY_PERSISTENCE, PARAM_MERGE_BOTH_NOT_MERGED, PARAM_MERGE_CHANGELOG_AND_DATA, PARAM_MERGE_ONLY_CHANGED_DATA, 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
Constructors Constructor Description IDSChangelogConnector()Constructs this object and sets it supported mode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntrygetNextEntry()This method will get the next change if the number of changes is smaller than the actual changes, that were done on the TDS.java.lang.ObjectgetStateKeyObject()Retrieves the state key object.intgetStateKeySaveMethod()Retrieves the method for storing StateKey.java.lang.StringgetVersion()Version information.voidinitialize(java.lang.Object aObject)Initializes the connector.voidnamingExceptionThrown(javax.naming.event.NamingExceptionEvent evt)Callback method for handlingNamingEnumerationsvoidnotificationReceived(javax.naming.ldap.UnsolicitedNotificationEvent evt)Callback method called when a change is made.protected EntryparseEntry(Entry aEntry)Method for parsing and merging Changelog Entry attributes and changed attributes from the actual Directory Entry.voidreconnect(java.lang.Object o)Reconnect to the underlying data sourcevoidsaveStateKey()Stores the USN values for the next synchronization.voidselectEntries()Prepares the connector for listening to change notifications.voidterminate()Close the connection to the LDAP server-
Methods inherited from class com.ibm.di.connector.ChangelogConnector
querySchema
-
Methods inherited from class com.ibm.di.connector.LDAPConnector
addAttributeValue, at2entry, callErrorHookOnAttributeInUseException, compare, compare, deleteEntry, entry2at, findEntry, flagSet, formatSearchValue, getAttributeSyntax, getCallErrorHook, getCurrentEntry, getLdapContext, getServerControls, getServerInfo, isDeltaSupported, isExceptionFatal, isServerAdminControl, mapAttributeSyntax, modEntry, modEntry, moveEntry, putEntry, queryNamingContexts, queryObjectClassAttributes, rebind, rebind, removeAllAttributeValues, removeAttributeValue, replaceAttributeValue, replaceAttributeValueProxy, setADPassword, setServerAdminControl, setSortControl, setsubtreeDeleteSupported, showServerInfo, supportsControl, supportsExtension, supportsPagedResults, supportsPersistantSearch, supportsSorting, supportsVirtualListView
-
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, extractExceptionInformation, findEntry, getBoolean, getClassInstance, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getLog, getMaxDuplicateEntries, getModes, getModes, getName, getNextClient, getNextFindEntry, getParam, getParser, getProperty, getPushbackEntry, getRawConnectorConfiguration, getRSInterface, getUI, hasConfigValue, hasParser, initParser, isIOException, logError, logmsg, pushback, queryOperations, queryReply, queryTables, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setDebugMode, 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, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer
-
-
-
-
Field Detail
-
PARAM_LDAP_SEARCH_BASE
public static final java.lang.String PARAM_LDAP_SEARCH_BASE
Parameter Name: "ldapSearchBase"- See Also:
- Constant Field Values
-
PARAM_STORE_PARAM_NAME
public static final java.lang.String PARAM_STORE_PARAM_NAME
Parameter Name: "iteratorStateKey"- See Also:
- Constant Field Values
-
PARAM_START_AT
public static final java.lang.String PARAM_START_AT
Parameter Name: "nsChangenumber"- See Also:
- Constant Field Values
-
PARAM_SLEEP_INTERVAL
public static final java.lang.String PARAM_SLEEP_INTERVAL
Parameter Name: "nsSleepInterval"- See Also:
- Constant Field Values
-
PARAM_TIMEOUT
public static final java.lang.String PARAM_TIMEOUT
Parameter Name: "nsTimeout"- See Also:
- Constant Field Values
-
PARAM_PAGE_SIZE
public static final java.lang.String PARAM_PAGE_SIZE
Parameter Name: "pageSize"- See Also:
- Constant Field Values
-
PARAM_USE_NOTIFICATIONS
public static final java.lang.String PARAM_USE_NOTIFICATIONS
Parameter Name: "useNotifications"- See Also:
- Constant Field Values
-
PARAM_BATCH_RETRIEVAL
public static final java.lang.String PARAM_BATCH_RETRIEVAL
Parameter Name: "batchRetrieval"- See Also:
- Constant Field Values
-
ATTRIBUTE_CPR
public static final java.lang.String ATTRIBUTE_CPR
Attribute name: "changeNumber"- See Also:
- Constant Field Values
-
ATTRIBUTE_CHANGENUMBER
public static final java.lang.String ATTRIBUTE_CHANGENUMBER
Attribute name: "changenumber"- See Also:
- Constant Field Values
-
PAGE_SIZE_DEFAULT_VALUE
public static final int PAGE_SIZE_DEFAULT_VALUE
The default value used for page size.- See Also:
- Constant Field Values
-
EVT_REG_OID
public static final java.lang.String EVT_REG_OID
The id of the specific control supported by IBM TDS, used for registering to the server.- See Also:
- Constant Field Values
-
EVT_UNREG_OID
public static final java.lang.String EVT_UNREG_OID
The id of the specific control supported by IBM TDS, used for unregistering from the server.- See Also:
- Constant Field Values
-
CHANGE_ALL
public static final int CHANGE_ALL
The type of change that we will get notified for.- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize(java.lang.Object aObject) throws java.lang.ExceptionInitializes the connector. All the configuration properties are considered and applied before a connection is made. After everything is set the connection is established and the connector is registered for receiving change notification.- Specified by:
initializein interfaceConnectorInterface- Overrides:
initializein classChangelogConnector- Parameters:
aObject- ignored.- Throws:
java.lang.Exception- if an error occurs.
-
selectEntries
public void selectEntries() throws java.lang.ExceptionPrepares the connector for listening to change notifications.- Specified by:
selectEntriesin interfaceConnectorInterface- Overrides:
selectEntriesin classLDAPConnector- Throws:
java.lang.Exception- if an error occurs.
-
getNextEntry
public Entry getNextEntry() throws java.lang.Exception
This method will get the next change if the number of changes is smaller than the actual changes, that were done on the TDS. If no more changes are available this method will block until notified that a change was done.- Specified by:
getNextEntryin interfaceConnectorInterface- Overrides:
getNextEntryin classLDAPConnector- Returns:
- the changes as an Entry object
- Throws:
java.lang.Exception- if an error occurs.- See Also:
ConnectorInterface.selectEntries()
-
getStateKeySaveMethod
public int getStateKeySaveMethod() throws java.lang.ExceptionRetrieves the method for storing StateKey.- Specified by:
getStateKeySaveMethodin interfaceChangelogInterface- Returns:
- the identifier of the method used for storing the StateKey in the TDI Store.
- Throws:
java.lang.Exception- - never- See Also:
ChangelogInterface.SAVE_STATE_AFTER_READ,ChangelogInterface.SAVE_STATE_END_OF_CYCLE,ChangelogInterface.SAVE_STATE_MANUAL
-
saveStateKey
public void saveStateKey() throws java.lang.ExceptionStores the USN values for the next synchronization. This method will skip the storing of the StateKey if the StateKey save method is set toChangelogInterface.SAVE_STATE_AFTER_READ- Specified by:
saveStateKeyin interfaceChangelogInterface- Throws:
java.lang.Exception- - never
-
getStateKeyObject
public java.lang.Object getStateKeyObject() throws java.lang.ExceptionRetrieves the state key object.- Specified by:
getStateKeyObjectin interfaceChangelogInterface- Returns:
- the change detection wrapped as a
Longobject. - Throws:
java.lang.Exception- - never
-
terminate
public void terminate()
Close the connection to the LDAP server- Specified by:
terminatein interfaceConnectorInterface- Overrides:
terminatein classLDAPConnector
-
namingExceptionThrown
public void namingExceptionThrown(javax.naming.event.NamingExceptionEvent evt)
Callback method for handlingNamingEnumerations- Specified by:
namingExceptionThrownin interfacejavax.naming.event.NamingListener- Parameters:
evt- the naming exception event object
-
notificationReceived
public void notificationReceived(javax.naming.ldap.UnsolicitedNotificationEvent evt)
Callback method called when a change is made.- Specified by:
notificationReceivedin interfacejavax.naming.ldap.UnsolicitedNotificationListener- Parameters:
evt- the event transport object
-
getVersion
public java.lang.String getVersion()
Version information.- Specified by:
getVersionin interfaceVersionInfoInterface- Overrides:
getVersionin classChangelogConnector- Returns:
- the version information
-
reconnect
public void reconnect(java.lang.Object o) throws java.lang.ExceptionReconnect to the underlying data source- Specified by:
reconnectin interfaceConnectorInterface- Overrides:
reconnectin classConnector- Parameters:
o- User provided parameter, which is sent to initialize()- Throws:
java.lang.Exception- if an error occurs.- See Also:
ConnectorInterface.initialize(Object)
-
parseEntry
protected Entry parseEntry(Entry aEntry) throws java.lang.Exception
Description copied from class:ChangelogConnectorMethod for parsing and merging Changelog Entry attributes and changed attributes from the actual Directory Entry.- Overrides:
parseEntryin classChangelogConnector- Parameters:
aEntry- the actual Directory Entry.- Returns:
- the result of the parsing and merging operations entry.
- Throws:
java.lang.Exception- if an error occurs.
-
-