Class ADChangelogConnectorv2

    • 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
      • PAGE_SIZE_DEFAULT_VALUE

        public static final int PAGE_SIZE_DEFAULT_VALUE
        Default value used for page size.
        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
      • 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.
      • 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