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, CheckpointRestartInterface, VersionInfoInterface

public class ADChangelogConnectorv2
extends LDAPConnector
implements ConnectorInterface, CheckpointRestartInterface, 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 String ATTR_CHANGE_TYPE
           
static String CHANGE_TYPE_DELETE
           
static String CHANGE_TYPE_UPDATE
           
static int PAGE_SIZE_DEFAULT_VALUE
           
static String PARAM_LDAP_SEARCH_BASE
           
static String PARAM_PAGE_SIZE
           
static String PARAM_SLEEP_INTERVAL
           
static String PARAM_START_AT
           
static String PARAM_TIMEOUT
           
static String PARAM_USE_NOTIFICATIONS
           
static String PARAM_USN_STORE_PARAM_NAME
           
static String 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.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
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  String binaryGUIDtoString(byte[] aBinaryData)
          Generates the hexadecimal String representation of the GUID based on its 128-bit binary representation.
 Entry getCheckpointInformation()
          Returns the state information for the connector.
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 the next Entry from the result set.
protected  void getStartUsnValues()
          Reads start USN values.
 Object getStateKeyObject()
           
 int getStateKeySaveMethod()
           
 long getUsnValue()
          Returns the current USN synchronization value.
 String getVersion()
          Return version information
 void initialize(Object aObj)
          Reads connector parameters' values and prepares LDAP search constraints.
 boolean isCheckpointRestartEnabled(int aMode)
          Components that support checkpoint/restart for a specific mode must return TRUE from this method.
protected  Entry packUsnValues()
          Returns an Entry containing the current Connector's USN values as properties.
 void prepareForRestart(ALState aState, Entry aRestartInfo, int aRestartPoint)
          Notifies the connector of a restart situation.
 void saveStateKey()
           
 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.
 
Methods inherited from class com.ibm.di.connector.LDAPConnector
addAttributeValue, at2entry, compare, deleteEntry, entry2at, findEntry, flagSet, getAttributeSyntax, getCurrentEntry, getLdapContext, getServerControls, getServerInfo, isDeltaSupported, isExceptionFatal, mapAttributeSyntax, modEntry, modEntry, moveEntry, putEntry, queryNamingContexts, queryObjectClassAttributes, querySchema, rebind, rebind, removeAllAttributeValues, removeAttributeValue, replaceAttributeValue, setADPassword, showServerInfo, supportsControl, supportsExtension, supportsPagedResults, supportsPersistantSearch, supportsSorting, supportsVirtualListView, terminate
 
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, findEntry, getBoolean, getClassInstance, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getLog, getMaxDuplicateEntries, getModes, getModes, getName, getNextClient, getNextFindEntry, getParam, getParser, getProperty, getPushbackEntry, getRawConnectorConfiguration, getRSInterface, hasConfigValue, hasParser, initParser, isIOException, logmsg, pushback, queryOperations, queryReply, 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, terminate, terminateServer
 

Field Detail

PARAM_LDAP_SEARCH_BASE

public static final String PARAM_LDAP_SEARCH_BASE
See Also:
Constant Field Values

PARAM_USN_STORE_PARAM_NAME

public static final String PARAM_USN_STORE_PARAM_NAME
See Also:
Constant Field Values

PARAM_START_AT

public static final String PARAM_START_AT
See Also:
Constant Field Values

PARAM_SLEEP_INTERVAL

public static final String PARAM_SLEEP_INTERVAL
See Also:
Constant Field Values

PARAM_TIMEOUT

public static final String PARAM_TIMEOUT
See Also:
Constant Field Values

PARAM_PAGE_SIZE

public static final String PARAM_PAGE_SIZE
See Also:
Constant Field Values

PARAM_USE_NOTIFICATIONS

public static final String PARAM_USE_NOTIFICATIONS
See Also:
Constant Field Values

ATTR_CHANGE_TYPE

public static final String ATTR_CHANGE_TYPE
See Also:
Constant Field Values

CHANGE_TYPE_UPDATE

public static final String CHANGE_TYPE_UPDATE
See Also:
Constant Field Values

CHANGE_TYPE_DELETE

public static final String CHANGE_TYPE_DELETE
See Also:
Constant Field Values

PAGE_SIZE_DEFAULT_VALUE

public static final int PAGE_SIZE_DEFAULT_VALUE
See Also:
Constant Field Values

PROP_START_USN

public static final String 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(Object aObj)
                throws 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:
Exception - If invalid Connector parameter values are supplied.

getStartUsnValues

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

(1) Restart info is passed;

(2) System Store parameter;

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

Throws:
Exception

selectEntries

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

Specified by:
selectEntries in interface ConnectorInterface
Overrides:
selectEntries in class LDAPConnector
Throws:
Exception - Any Exception by the underlying library

getHighestCommittedUsn

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

Returns:
The Active Directory's "highestCommittedUsn" attribute value.
Throws:
Exception - If cannot retrieve the highest committed USN number.

binaryGUIDtoString

protected 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 NamingException,
                                    IOException
Retrieves the next Entry from the result set.

Throws:
NamingException
IOException

getNextEntry

public Entry getNextEntry()
                   throws 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:
Exception - If retrieving the next "changed" Entry fails.
See Also:
Connector.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.


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

getUsnValue

public long getUsnValue()
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 Exception
Specified by:
getStateKeySaveMethod in interface ChangelogInterface
Throws:
Exception

saveStateKey

public void saveStateKey()
                  throws Exception
Specified by:
saveStateKey in interface ChangelogInterface
Throws:
Exception

getStateKeyObject

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

getVersion

public String getVersion()
Return version information

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