psdi.security.ldap

Class GenericDirectorySynchronizer



  • public class GenericDirectorySynchronizer
    extends AbstractLdapSynchronizer
    This is a generic class to synchronize the required data from LDAP server to MAXIMO Database tables. The Synchronization process is one way only i.e from directory to MAXIMO. Any changes made to the MAXIMO tables in this process by external means will be overwritten when this synchronizer runs . Any data that's not coming from directory, i.e default data that's not available in directory will not be overwritten when data is updated in MAXIMO tables.
    • Constructor Detail

      • GenericDirectorySynchronizer

        public GenericDirectorySynchronizer()
    • Method Detail

      • retrieveAllGroupMembers

        protected java.util.Set retrieveAllGroupMembers(java.lang.String groupDN)
                                                 throws LdapSyncException
        Retrieves all the group members of the given group distinguished name. If a group has another group as a member, then this method figures out the users of that nested group. The returned set includes complete list of all the user account names of the given group.
        Specified by:
        retrieveAllGroupMembers in class AbstractLdapSynchronizer
        Parameters:
        groupDN - group distinguished name for which users need to be retrieved.
        Returns:
        A set of all users that are members of the given group.
        Throws:
        LdapSyncException - if fails to retrieve members.
        See Also:
        AbstractLdapSynchronizer.retrieveAllGroupMembers(java.lang.String)
      • retrieveGroupMembers

        protected void retrieveGroupMembers(java.lang.String groupDN,
                                            java.util.Set memberUsers,
                                            java.util.Set memberGroups)
                                     throws LdapSyncException
        Retrieves group members and fills the users and groups that are members of the given group into the passed in sets.
        Parameters:
        groupDN - distinguished name of the group for which members need to be retrieved.
        memberUsers - returns the set of member users of the group.
        memberGroups - returns the set of member groups of the group.
        Throws:
        LdapSyncException - if fails to retrieve members of the group.
      • getMemberUserAccountName

        protected java.lang.String getMemberUserAccountName(java.lang.String memberDN)
                                                     throws LdapSyncException
        Returns the user or group member account name, for the given distinguished name of the user or group. The code also determines whether the member distinguished name passed in is for a user or a group depending on the class name of the retrieved object based on the member distinguished name.
        Parameters:
        memberDN - user or group distinguished name
        Returns:
        user or group account name based on the distinguished name
        Throws:
        LdapSyncException - if fails to retrieve the account name.
      • syncGroups

        protected void syncGroups()
                           throws LdapSyncException
        Performs LDAP query against the LDAP Directory server and retrieves the results . For each object that's obtained in the result, a notification event will be fired to the listener to synchronize the changes to MAXIMO database tables. This method also retrieves all the users of each group object processed in the search result.
        Overrides:
        syncGroups in class AbstractLdapSynchronizer
        Throws:
        LdapSyncException
      • syncUsers

        protected void syncUsers()
                          throws LdapSyncException
        Performs LDAP query against the LDAP Directory server and retrieves the results page by page and processes each page result. For each object that's obtained in the result, a notification event will be fired to the listener to synchronize the changes to MAXIMO database tables.
        Overrides:
        syncUsers in class AbstractLdapSynchronizer
        Throws:
        LdapSyncException