com.ibm.di.connector
Class ADChangelogConnectorv2

java.lang.Object
  extended by com.ibm.di.connector.Connector
      extended by com.ibm.di.connector.LDAPConnector
          extended by com.ibm.di.connector.ADChangelogConnectorv2
All Implemented Interfaces:
ChangelogInterface, ConnectorInterface, VersionInfoInterface

public class ADChangelogConnectorv2
extends LDAPConnector
implements ConnectorInterface, ChangelogInterface

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
static java.lang.String ATTR_CHANGE_TYPE
          An Entry attribute name: "changeType"
static java.lang.String CHANGE_TYPE_ADD
          An Entry attribute value ("add") for attribute with name: "changeType"
static java.lang.String CHANGE_TYPE_DELETE
          An Entry attribute value ("delete") for attribute with name: "changeType"
static java.lang.String CHANGE_TYPE_MODIFY
          An Entry attribute value ("modify") for attribute with name: "changeType"
static int PAGE_SIZE_DEFAULT_VALUE
          Default value used for page size.
static java.lang.String PARAM_LDAP_SEARCH_BASE
          Parameter Name: "ldapSearchBase"
static java.lang.String PARAM_PAGE_SIZE
          Parameter Name: "pageSize"
static java.lang.String PARAM_SLEEP_INTERVAL
          Parameter Name: "sleepInterval"
static java.lang.String PARAM_START_AT
          Parameter Name: "startAt"
static java.lang.String PARAM_TIMEOUT
          Parameter Name: "timeout"
static java.lang.String PARAM_USE_NOTIFICATIONS
          Parameter Name: "useNotifications"
static java.lang.String PARAM_USN_STORE_PARAM_NAME
          Parameter Name: "iteratorStateKey"
static java.lang.String PROP_START_USN
          USN property file parameter: PROP_START_USN
 
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
ADChangelogConnectorv2()
          Calls the super constructor and assigns supported Connector modes.
 
Method Summary
protected  void addGUIDStrAttribute(Entry aEntry)
          Adds the "objectGUIDStr" Attribute to the Entry.
protected  java.lang.String binaryGUIDtoString(byte[] aBinaryData)
          Generates the hexadecimal String representation of the GUID based on its 128-bit binary representation.
protected  long getHighestCommittedUsn()
          Retrieves the highest committed USN from Active Directory.
 Entry getNextEntry()
          Retrieves the next "changed" object from Active Directory.
protected  Entry getNextSearchResult()
          Retrieves next Entry from result set.
protected  void getStartUsnValues()
          Reads start USN values.
 java.lang.Object getStateKeyObject()
          Retrives synchronization session's start USN as Object.
 int getStateKeySaveMethod()
          Retrieves the method for storing StateKey.
 long getUsnValue()
          Retrieves USN synchronization value.
 java.lang.String getVersion()
          Version information.
 void initialize(java.lang.Object aObj)
          Reads connector parameters' values and prepares LDAP search constraints.
protected  Entry packUsnValues()
          Retrieves USN value as properties.
 void saveStateKey()
          Stores the USN values for the next synchronization.
 void selectEntries()
          Reads the initial USN value and makes necessary adjustments.
 void setUsnValue(long aUsnValue)
          Sets Connector's current USN synchronization value.
protected  void storeUSNForNextSynch()
          Stores the USN values for the next synchronization.
 void terminate()
          Close the connection to the LDAP server
 
Methods inherited from class com.ibm.di.connector.LDAPConnector
addAttributeValue, at2entry, callErrorHookOnAttributeInUseException, compare, deleteEntry, entry2at, findEntry, flagSet, getAttributeSyntax, getCallErrorHook, getCurrentEntry, getLdapContext, getServerControls, getServerInfo, isDeltaSupported, isExceptionFatal, isServerAdminControl, mapAttributeSyntax, modEntry, modEntry, moveEntry, putEntry, queryNamingContexts, queryObjectClassAttributes, querySchema, rebind, rebind, removeAllAttributeValues, removeAttributeValue, replaceAttributeValue, setADPassword, setServerAdminControl, 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, 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, reconnect, 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_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

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

ATTR_CHANGE_TYPE

public static final java.lang.String ATTR_CHANGE_TYPE
An Entry attribute name: "changeType"

See Also:
Constant Field Values

CHANGE_TYPE_ADD

public static final java.lang.String CHANGE_TYPE_ADD
An Entry attribute value ("add") for attribute with name: "changeType"

See Also:
Constant Field Values

CHANGE_TYPE_MODIFY

public static final java.lang.String CHANGE_TYPE_MODIFY
An Entry attribute value ("modify") for attribute with name: "changeType"

See Also:
Constant Field Values

CHANGE_TYPE_DELETE

public static final java.lang.String CHANGE_TYPE_DELETE
An Entry attribute value ("delete") for attribute with name: "changeType"

See Also:
Constant Field Values

PAGE_SIZE_DEFAULT_VALUE

public static final int PAGE_SIZE_DEFAULT_VALUE
Default value used for page size.

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
Constructor Detail

ADChangelogConnectorv2

public ADChangelogConnectorv2()
Calls the super constructor and assigns supported Connector modes.

Method Detail

initialize

public void initialize(java.lang.Object aObj)
                throws java.lang.Exception
Reads connector parameters' values and prepares LDAP search constraints.

Specified by:
initialize in interface ConnectorInterface
Overrides:
initialize in class LDAPConnector
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.
Throws:
java.lang.Exception - If invalid Connector parameter values are supplied.

getStartUsnValues

protected void getStartUsnValues()
                          throws java.lang.Exception
Reads start USN values. Sources for start USN values are checked in this order:

(1) System Store parameter;

(2) If the specified System Store parameter is not found in the System Store, the "Start at" value is used.

Throws:
java.lang.Exception - if the USN values cannot be retrieved or other type of error occurs.

selectEntries

public void selectEntries()
                   throws java.lang.Exception
Reads the initial USN value and makes necessary adjustments.

Specified by:
selectEntries in interface ConnectorInterface
Overrides:
selectEntries in class LDAPConnector
Throws:
java.lang.Exception - Exception if the USN values cannot be retrieved or other type of error occurs.

getHighestCommittedUsn

protected long getHighestCommittedUsn()
                               throws java.lang.Exception
Retrieves the highest committed USN from Active Directory.

Returns:
The Active Directory's "highestCommittedUsn" attribute value.
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.

getNextSearchResult

protected Entry getNextSearchResult()
                             throws javax.naming.NamingException,
                                    java.io.IOException
Retrieves next Entry from result set.

Returns:
the next Entry from the result set.
Throws:
java.io.IOException - If an error was encountered while encoding the supplied arguments into a control.
javax.naming.NamingException - If an error occurred while setting the request controls or if a naming exception is encountered while attempting to determine whether there is another element in the enumeration. See NamingException and its subclasses for the possible naming exceptions

getNextEntry

public Entry getNextEntry()
                   throws java.lang.Exception
Retrieves the next "changed" object from Active Directory.

Specified by:
getNextEntry in interface ConnectorInterface
Overrides:
getNextEntry in class LDAPConnector
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()
Retrieves USN value as properties.

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.


getUsnValue

public long getUsnValue()
Retrieves USN synchronization value.

Returns:
the current USN synchronization value.

setUsnValue

public void setUsnValue(long aUsnValue)
Sets Connector's current USN synchronization value.

Parameters:
aUsnValue - the new USN value.

getStateKeySaveMethod

public int getStateKeySaveMethod()
                          throws java.lang.Exception
Retrieves the method for storing StateKey.

Specified by:
getStateKeySaveMethod in interface ChangelogInterface
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.Exception
Stores the USN values for the next synchronization. This method will skip the storing of the StateKey if the StateKey save method is set to ChangelogInterface.SAVE_STATE_AFTER_READ

Specified by:
saveStateKey in interface ChangelogInterface
Throws:
java.lang.Exception - - never

getStateKeyObject

public java.lang.Object getStateKeyObject()
                                   throws java.lang.Exception
Retrives synchronization session's start USN as Object.

Specified by:
getStateKeyObject in interface ChangelogInterface
Returns:
the synchronization session's start USN as Long Object.
Throws:
java.lang.Exception - - never

getVersion

public java.lang.String getVersion()
Version information.

Specified by:
getVersion in interface VersionInfoInterface
Overrides:
getVersion in class LDAPConnector
Returns:
version information

terminate

public void terminate()
Close the connection to the LDAP server

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