Package com.ibm.di.connector
Class ADChangelogConnector
- java.lang.Object
-
- com.ibm.di.connector.Connector
-
- com.ibm.di.connector.LDAPConnector
-
- com.ibm.di.connector.ADChangelogConnector
-
- All Implemented Interfaces:
ConnectorInterface,VersionInfoInterface
public class ADChangelogConnector extends LDAPConnector implements ConnectorInterface
The class ADChangelogConnector represents the Active Directory Changelog connector class that will be accessed by IBM Tivoli Directory Integrator. It extends the LDAP connector class (LDAPConnector) and overrides some of its methods to implement AD-specific functionality.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringATTR_CHANGE_TYPEAnEntryattribute name: "changeType"static java.lang.StringCHANGE_TYPE_ADDAnEntryattribute value ("add") for attribute with name: "changeType"static java.lang.StringCHANGE_TYPE_DELETEAnEntryattribute value ("delete") for attribute with name: "changeType"static java.lang.StringCHANGE_TYPE_MODIFYAnEntryattribute value ("modify") for attribute with name: "changeType"static java.lang.StringPARAM_LDAP_SEARCH_BASEParameter Name: "ldapSearchBase"static java.lang.StringPARAM_SLEEP_INTERVALParameter Name: "sleepInterval"static java.lang.StringPARAM_START_ATParameter Name: "startAt"static java.lang.StringPARAM_TIMEOUTParameter Name: "timeout"static java.lang.StringPARAM_USN_FILE_NAMEParameter Name: "usnFileName"static java.lang.StringPARAM_USN_STORE_PARAM_NAMEParameter Name: "iteratorStateKey"static java.lang.StringPROP_CURRENT_USN_CHANGEDUSN property file parameter:PROP_CURRENT_USN_CHANGEDstatic java.lang.StringPROP_CURRENT_USN_CREATEDUSN property file parameter:PROP_CURRENT_USN_CREATEDstatic java.lang.StringPROP_END_USNUSN property file parameter:PROP_END_USNstatic java.lang.StringPROP_START_USNUSN property file parameter:PROP_START_USN-
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
-
-
Constructor Summary
Constructors Constructor Description ADChangelogConnector()Calls the super constructor and assigns supported Connector modes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddGUIDStrAttribute(Entry aEntry)Adds the "objectGUIDStr" Attribute to the Entry.protected java.lang.StringbinaryGUIDtoString(byte[] aBinaryData)Generates the hexadecimal String representation of the GUID based on its 128-bit binary representation.protected intgetHighestCommittedUsn()Retrieves the highest committed USN from Active Directory.EntrygetNextEntry()Retrieves the next "changed" object from the AD.protected voidgetStartUsnValues()Reads start USN values.EntrygetUsnValues()Retrives USN synchronization values.java.lang.StringgetVersion()Version information.voidinitialize(java.lang.Object aObj)Reads connector parameters' values and prepares LDAP search constraints.protected EntrypackUsnValues()voidreconnect(java.lang.Object o)Reconnect to the underlying data sourceprotected EntryretrieveEntry(java.lang.String aFilter)Retrieves an Entry from AD based on the given filter.voidselectEntries()Reads the initial USN values from file and sets necessary request controls.voidsetUsnValues(Entry aUsnEntry)Sets the Connector's current USN synchronization values to the values specified in the "aUsnEntry" parameter.protected voidstoreUSNForNextSynch()Stores the USN values for the next synchronization.-
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, querySchema, rebind, rebind, removeAllAttributeValues, removeAttributeValue, replaceAttributeValue, replaceAttributeValueProxy, setADPassword, setServerAdminControl, setSortControl, setsubtreeDeleteSupported, showServerInfo, supportsControl, supportsExtension, supportsPagedResults, supportsPersistantSearch, supportsSorting, supportsVirtualListView, terminate
-
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, terminate, 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_USN_FILE_NAME
public static final java.lang.String PARAM_USN_FILE_NAME
Parameter Name: "usnFileName"- See Also:
- Constant Field Values
-
PARAM_USN_STORE_PARAM_NAME
public static final java.lang.String PARAM_USN_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: "startAt"- See Also:
- Constant Field Values
-
PARAM_SLEEP_INTERVAL
public static final java.lang.String PARAM_SLEEP_INTERVAL
Parameter Name: "sleepInterval"- See Also:
- Constant Field Values
-
PARAM_TIMEOUT
public static final java.lang.String PARAM_TIMEOUT
Parameter Name: "timeout"- See Also:
- Constant Field Values
-
ATTR_CHANGE_TYPE
public static final java.lang.String ATTR_CHANGE_TYPE
AnEntryattribute name: "changeType"- See Also:
- Constant Field Values
-
CHANGE_TYPE_ADD
public static final java.lang.String CHANGE_TYPE_ADD
AnEntryattribute value ("add") for attribute with name: "changeType"- See Also:
- Constant Field Values
-
CHANGE_TYPE_MODIFY
public static final java.lang.String CHANGE_TYPE_MODIFY
AnEntryattribute value ("modify") for attribute with name: "changeType"- See Also:
- Constant Field Values
-
CHANGE_TYPE_DELETE
public static final java.lang.String CHANGE_TYPE_DELETE
AnEntryattribute value ("delete") for attribute with name: "changeType"- See Also:
- Constant Field Values
-
PROP_START_USN
public static final java.lang.String PROP_START_USN
USN property file parameter:PROP_START_USN- See Also:
- Constant Field Values
-
PROP_END_USN
public static final java.lang.String PROP_END_USN
USN property file parameter:PROP_END_USN- See Also:
- Constant Field Values
-
PROP_CURRENT_USN_CREATED
public static final java.lang.String PROP_CURRENT_USN_CREATED
USN property file parameter:PROP_CURRENT_USN_CREATED- See Also:
- Constant Field Values
-
PROP_CURRENT_USN_CHANGED
public static final java.lang.String PROP_CURRENT_USN_CHANGED
USN property file parameter:PROP_CURRENT_USN_CHANGED- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize(java.lang.Object aObj) throws java.lang.ExceptionReads connector parameters' values and prepares LDAP search constraints.- Specified by:
initializein interfaceConnectorInterface- Overrides:
initializein classLDAPConnector- Parameters:
aObj- This parameter is usually null but can be any type of object the caller chooses to pass on. Normally the parameter is some kind of input stream or Reader object. This Connector ignores this parameter.- Throws:
java.lang.Exception- If invalid Connector parameter values are supplied.
-
getStartUsnValues
protected void getStartUsnValues() throws java.lang.ExceptionReads start USN values. Sources for start USN values are checked in this order:(1) File name parameter is specified - backward compatibility mode;
(2) Persistent parameter - if the specified parameter is not found in the store, the "Start at" value is used.
The method will reset the USN Parameters (using thesetZeroUsnValues()private method) if the USN properties file does not exists, could not be read or the properties in it could be parsed.- Throws:
java.lang.Exception- if an error working with the USN properties occurs.
-
selectEntries
public void selectEntries() throws java.lang.ExceptionReads the initial USN values from file and sets necessary request controls.- Specified by:
selectEntriesin interfaceConnectorInterface- Overrides:
selectEntriesin classLDAPConnector- Throws:
java.lang.Exception- If cannot obtain the highestCommitedUsn from Active Directory.
-
getHighestCommittedUsn
protected int getHighestCommittedUsn() throws java.lang.ExceptionRetrieves the highest committed USN from Active Directory.- Returns:
- The Active Directory's "highestCommittedUsn" Attribute.
- Throws:
java.lang.Exception- If cannot retrieve the highest committed USN number.
-
binaryGUIDtoString
protected java.lang.String binaryGUIDtoString(byte[] aBinaryData)
Generates the hexadecimal String representation of the GUID based on its 128-bit binary representation. The String representation of a GUID has the form "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}". The digits used are the hexadecimal digits 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E and F.- Parameters:
aBinaryData- A 16-byte byte array, holding the 128-bit binary representation of the GUID.- Returns:
- The hexadecimal String representation of the binary GUID.
-
addGUIDStrAttribute
protected void addGUIDStrAttribute(Entry aEntry)
Adds the "objectGUIDStr" Attribute to the Entry. The value of this Attribute is set to the String representation of the binary value of this Entry's "objectGUID" Attribute.- Parameters:
aEntry- The Entry to add the "objectGUIDStr" Attribute to.
-
retrieveEntry
protected Entry retrieveEntry(java.lang.String aFilter) throws javax.naming.NamingException
Retrieves an Entry from AD based on the given filter.- Parameters:
aFilter- The LDAP filter for retrieving the Entry.- Returns:
- The first Entry that matched the filter; "null" if no AD Entry matches the filter.
- Throws:
javax.naming.NamingException- If error occurs while retrieving the Entry from Active Directory.
-
getNextEntry
public Entry getNextEntry() throws java.lang.Exception
Retrieves the next "changed" object from the AD.- Specified by:
getNextEntryin interfaceConnectorInterface- Overrides:
getNextEntryin classLDAPConnector- Returns:
- The next "changed" Entry object.
- Throws:
java.lang.Exception- If retrieving the next "changed" Entry fails.- See Also:
ConnectorInterface.selectEntries()
-
packUsnValues
protected Entry packUsnValues()
- Returns:
- an Entry containing the current Connector's USN values as properties. Such Entries are used for storage in the persistent store.
-
storeUSNForNextSynch
protected void storeUSNForNextSynch()
Stores the USN values for the next synchronization.
-
getUsnValues
public Entry getUsnValues()
Retrives USN synchronization values.- Returns:
- an Entry object containing the current USN synchronization values.
-
setUsnValues
public void setUsnValues(Entry aUsnEntry) throws java.lang.Exception
Sets the Connector's current USN synchronization values to the values specified in the "aUsnEntry" parameter.- Parameters:
aUsnEntry- theEntryobject containing the USN values.- Throws:
java.lang.Exception- If the given Entry object does not contain the necessary USN values.
-
getVersion
public java.lang.String getVersion()
Version information.- Specified by:
getVersionin interfaceVersionInfoInterface- Overrides:
getVersionin classLDAPConnector- Returns:
- 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)
-
-