Class AbstractLDAPGroup

  • Direct Known Subclasses:
    LDAPGroupAllRoot, LDAPGroupSubTree, LDAPGroupUniqueDescriptor

    public abstract class AbstractLDAPGroup
    extends Object
    This class manage one particular group. It is a base class to derive from. The child classes manages the particular method to retrieve the groups' elements(groups or users)
    Author:
    tleroi
    • Constructor Detail

      • AbstractLDAPGroup

        public AbstractLDAPGroup()
    • Method Detail

      • init

        public void init​(LDAPSettings driverSettings,
                         LDAPSynchroCache synchroCache)
        Initialize the settings from the read ones
        Parameters:
        driverSettings - the settings retrieved from the property file
      • beginSynchronization

        public void beginSynchronization()
        Called when Admin starts the synchronization
      • endSynchronization

        public String endSynchronization()
        Called when Admin ends the synchronization
      • getGroups

        public GroupDetail[] getGroups​(String lds,
                                       String parentId,
                                       String extraFilter)
                                throws AdminException
        Return all groups found in the tree that are children of parentId group or return root groups if parentId is null or empty
        Parameters:
        lds - the LDAP connection
        parentId - the parent group Id to start search, if null or empty, root groups are returned
        Returns:
        all founded groups
        Throws:
        AdminException - if an error occur during LDAP operations
      • getGroup

        public GroupDetail getGroup​(String lds,
                                    String id)
                             throws AdminException
        Return a GroupDetail object filled with the infos of the group having ID = id NOTE : the DomainID and the ID are not set. THIS FUNCTION THROW EXCEPTION ONLY WHEN NO SYNCHRO IS RUNNING
        Parameters:
        lds - the LDAP connection
        id - the group id (most case : LDAP DN)
        Returns:
        the group object
        Throws:
        AdminException - if an error occur during LDAP operations or if the group is not found
      • translateGroup

        protected GroupDetail translateGroup​(String lds,
                                             com.novell.ldap.LDAPEntry groupEntry)
                                      throws AdminException
        Translate a group LDAPEntry into a GroupDetail object NOTE : the GroupParentId, the DomainID and the ID are not set. THIS FUNCTION THROW EXCEPTION ONLY WHEN NO SYNCHRO IS RUNNING
        Parameters:
        groupEntry - the LDAP group object
        Returns:
        the group object
        Throws:
        AdminException - if an error occur during LDAP operations or if there is no groupEntry object
      • translateGroups

        protected GroupDetail translateGroups​(String lds,
                                              List<com.novell.ldap.LDAPEntry> groupEntries)
                                       throws AdminException
        Translate several groups LDAPEntry into a GroupDetail object NOTE : the GroupParentId, the DomainID and the ID are not set. THIS FUNCTION THROW EXCEPTION ONLY WHEN NO SYNCHRO IS RUNNING
        Parameters:
        lds - the ldap service
        groupEntries - the group entries.
        Returns:
        the group of users.
        Throws:
        AdminException - if an error occurs.
      • getGroupMemberGroupIds

        public abstract String[] getGroupMemberGroupIds​(String lds,
                                                        String groupId)
                                                 throws AdminException
        Gets the group's parent groups IDs THIS FUNCTION ALWAYS THROW EXCEPTION (EVEN IF A SYNCHRO IS RUNNING)
        Parameters:
        groupId - the group's Id
        Returns:
        the groups that contain the group
        Throws:
        AdminException - if an error occurs
      • getUserMemberGroupIds

        public abstract String[] getUserMemberGroupIds​(String lds,
                                                       String userId)
                                                throws AdminException
        Gets the users groups IDs THIS FUNCTION ALWAYS THROW EXCEPTION (EVEN IF A SYNCHRO IS RUNNING)
        Parameters:
        userId - the user's Id
        Returns:
        the groups that contain the user
        Throws:
        AdminException - if an error occurs.
      • getUserIds

        protected abstract String[] getUserIds​(String lds,
                                               com.novell.ldap.LDAPEntry groupEntry)
                                        throws AdminException
        Gets the users ID that are directly in the group describes by groupEntry THIS FUNCTION ALWAYS THROW EXCEPTION (EVEN IF A SYNCHRO IS RUNNING)
        Parameters:
        groupEntry - the group that contains users
        Returns:
        the father's group ID or empty string if the group is at the root level
        Throws:
        AdminException - if an error occurs.
      • getChildGroupsEntry

        protected abstract com.novell.ldap.LDAPEntry[] getChildGroupsEntry​(String lds,
                                                                           String parentId,
                                                                           String extraFilter)
                                                                    throws AdminException
        Gets a set of LDAP entries that are the child groups of a parent one THIS FUNCTION THROW EXCEPTION ONLY WHEN NO SYNCHRO IS RUNNING
        Parameters:
        lds - the LDAP connection
        parentId - Id of the parent group
        Returns:
        all founded child groups or root groups if parentId is equal to null or is empty
        Throws:
        AdminException - if an error occur during LDAP operations
      • getGroupEntry

        protected com.novell.ldap.LDAPEntry getGroupEntry​(String lds,
                                                          String groupId)
                                                   throws AdminException
        Return the LDAP entry of the specified group Id THIS FUNCTION ALWAYS THROW EXCEPTION (EVEN IF A SYNCHRO IS RUNNING)
        Parameters:
        lds - the LDAP connection
        groupId - group's Id
        Returns:
        group's entry
        Throws:
        AdminException - if an error occur during LDAP operations