com.ibm.di.connector
Class ChangelogConnector

java.lang.Object
  extended by com.ibm.di.connector.Connector
      extended by com.ibm.di.connector.LDAPConnector
          extended by com.ibm.di.connector.ChangelogConnector
All Implemented Interfaces:
ConnectorInterface, VersionInfoInterface
Direct Known Subclasses:
IDSChangelogConnector, NetscapeChangelogConnector, ZOSChangelogConnector

public class ChangelogConnector
extends LDAPConnector

ChangelogConnector class combines the similar changelog behavior of IDSChangelogConnector, NetscapeChangelogConnector and z/OS Changelog Connector classes. It provides tree different ways to handle merging between original and updated data.


Field Summary
protected  boolean bothSeparated
          A flag that tells whether the parseEntry(Entry) method should add the passed as parameter entry as an attribute of the parsed entry.
protected  boolean defaultMerge
          A flag that tells whether the parseEntry(Entry) method should merge the parsed entry with the passed as parameter entry.
protected  LDIFParser mLdifParser
          The LDIFParser object used for parsing the entries.
protected  boolean onlyChanges
          A flag that tells whether the parseEntry(Entry) method should merge the operation of the parsed entry with the operation of the passed as parameter entry.
static String PARAM_MERGE_MODE
          The parameter name used to control the way the parseEntry(Entry) method merges the parsed entry with the provided as a parameter entry.
 
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
 
Constructor Summary
ChangelogConnector()
           
 
Method Summary
 String getVersion()
          Version information.
 void initialize(Object aObject)
          Initialize the Connector, connect to the LDAP Server
protected  Entry parseEntry(Entry aEntry)
          Method for parsing and merging Changelog Entry attributes and changed attributes from the actual Directory Entry.
 Object querySchema(Object source)
          Query the schema of the LDAP server.
 
Methods inherited from class com.ibm.di.connector.LDAPConnector
addAttributeValue, at2entry, callErrorHookOnAttributeInUseException, compare, deleteEntry, entry2at, findEntry, flagSet, getAttributeSyntax, getCallErrorHook, getCurrentEntry, getLdapContext, getNextEntry, getServerControls, getServerInfo, isDeltaSupported, isExceptionFatal, mapAttributeSyntax, modEntry, modEntry, moveEntry, putEntry, queryNamingContexts, queryObjectClassAttributes, rebind, rebind, removeAllAttributeValues, removeAttributeValue, replaceAttributeValue, selectEntries, setADPassword, setsubtreeDeleteSupported, 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, 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
getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextClient, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isIOException, pushback, queryOperations, queryReply, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminateServer
 

Field Detail

defaultMerge

protected boolean defaultMerge
A flag that tells whether the parseEntry(Entry) method should merge the parsed entry with the passed as parameter entry.
This flag is controlled by the the value of the PARAM_MERGE_MODE parameter and set during the initialization process ( initialize(Object)).


onlyChanges

protected boolean onlyChanges
A flag that tells whether the parseEntry(Entry) method should merge the operation of the parsed entry with the operation of the passed as parameter entry.
This flag is controlled by the the value of the PARAM_MERGE_MODE parameter and set during the initialization process ( initialize(Object)).


bothSeparated

protected boolean bothSeparated
A flag that tells whether the parseEntry(Entry) method should add the passed as parameter entry as an attribute of the parsed entry.
This flag is controlled by the the value of the PARAM_MERGE_MODE parameter and set during the initialization process ( initialize(Object)).


mLdifParser

protected LDIFParser mLdifParser
The LDIFParser object used for parsing the entries.


PARAM_MERGE_MODE

public static final String PARAM_MERGE_MODE
The parameter name used to control the way the parseEntry(Entry) method merges the parsed entry with the provided as a parameter entry.

See Also:
Constant Field Values
Constructor Detail

ChangelogConnector

public ChangelogConnector()
Method Detail

initialize

public void initialize(Object aObject)
                throws Exception
Initialize the Connector, connect to the LDAP Server

Specified by:
initialize in interface ConnectorInterface
Overrides:
initialize in class LDAPConnector
Parameters:
aObject - An Object sent to the initialize method, ignored.
Throws:
Exception - Any Exception by the underlying methods to connect to the LDAP Server

parseEntry

protected Entry parseEntry(Entry aEntry)
                    throws Exception
Method for parsing and merging Changelog Entry attributes and changed attributes from the actual Directory Entry.

Parameters:
aEntry - the actual Directory Entry.
Returns:
the result of the parsing and merging operations entry.
Throws:
Exception - if an error occurs.

querySchema

public Object querySchema(Object source)
                   throws Exception
Query the schema of the LDAP server. If 'Start at' parameter is EOD return schema depending on the Merge mode parameter:
  • Merge changelog and changed data - return all 'MAY' and 'MUST' attributes defined for 'changeLogEntry' LDAP object class

  • Return only changed data - we have no idea what are the changed attributes of the changed entry so return null

  • Return both - return the 'changelog' attribute

  • If 'Start at' parameter is set to a number the LDAP Connector querySchema is called.

    Specified by:
    querySchema in interface ConnectorInterface
    Overrides:
    querySchema in class LDAPConnector
    Parameters:
    source - A distinguished name
    Returns:
    The schema
    Throws:
    Exception - Any Exception thrown by underlying libraries
    See Also:
    Entry, Vector

    getVersion

    public String getVersion()
    Version information.

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