com.stratelia.silverpeas.domains.ldapdriver
Class AbstractLDAPGroup

java.lang.Object
  extended by com.stratelia.silverpeas.domains.ldapdriver.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 retreive the groups' elements(groups or users)

Author:
tleroi

Constructor Summary
AbstractLDAPGroup()
           
 
Method Summary
 void beginSynchronization()
          Called when Admin starts the synchronization
 String endSynchronization()
          Called when Admin ends the synchronization
 Group[] getAllChangedGroups(String lds, String extraFilter)
           
 Group[] getAllGroups(String lds, String extraFilter)
          Return all groups
protected abstract  com.novell.ldap.LDAPEntry[] getChildGroupsEntry(String lds, String parentId, String extraFilter)
          Return a set of LDAP entries that are the child groups of a parent one THIS FUNCTION THROW EXCEPTION ONLY WHEN NO SYNCHRO IS RUNNING
 Group getGroup(String lds, String id)
          Return a Group object filled with the infos of the group having ID = id NOTE : the DomainID and the ID are not set.
 Group getGroupByName(String lds, String name)
           
protected  com.novell.ldap.LDAPEntry getGroupEntry(String lds, String groupId)
          Return the LDAP entry of the specified group Id THIS FUNCTION ALWAYS THROW EXCEPTION (EVEN IF A SYNCHRO IS RUNNING)
protected  com.novell.ldap.LDAPEntry getGroupEntryByName(String lds, String groupName)
           
abstract  String[] getGroupMemberGroupIds(String lds, String groupId)
          return the group's parent groups IDs THIS FUNCTION ALWAYS THROW EXCEPTION (EVEN IF A SYNCHRO IS RUNNING)
 Group[] getGroups(String lds, String parentId, String extraFilter)
          Return all groups found in the tree that are childs of parentId group or return root groups if parentId is null or empty
 AbstractLDAPTimeStamp getMaxTimeStamp(String lds, String minTimeStamp)
           
protected abstract  String[] getUserIds(String lds, com.novell.ldap.LDAPEntry groupEntry)
          return the users ID that are directly in the group discribes by groupEntry THIS FUNCTION ALWAYS THROW EXCEPTION (EVEN IF A SYNCHRO IS RUNNING)
abstract  String[] getUserMemberGroupIds(String lds, String userId)
          return the users groups IDs THIS FUNCTION ALWAYS THROW EXCEPTION (EVEN IF A SYNCHRO IS RUNNING)
 void init(LDAPSettings driverSettings, LDAPSynchroCache synchroCache)
          Initialize the settings from the read ones
protected  Group translateGroup(String lds, com.novell.ldap.LDAPEntry groupEntry)
          Translate a group LDAPEntry into a Group object NOTE : the GroupParentId, the DomainID and the ID are not set.
protected  Group translateGroups(String lds, List<com.novell.ldap.LDAPEntry> groupEntries)
          Translate several groups LDAPEntry into a Group object NOTE : the GroupParentId, the DomainID and the ID are not set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 retreived from the property file

beginSynchronization

public void beginSynchronization()
                          throws Exception
Called when Admin starts the synchronization

Throws:
Exception

endSynchronization

public String endSynchronization()
                          throws Exception
Called when Admin ends the synchronization

Throws:
Exception

getAllChangedGroups

public Group[] getAllChangedGroups(String lds,
                                   String extraFilter)
                            throws AdminException
Throws:
AdminException

getAllGroups

public Group[] getAllGroups(String lds,
                            String extraFilter)
                     throws AdminException
Return all groups

Parameters:
lds - the LDAP connection
Returns:
all groups
Throws:
AdminException - if an error occur during LDAP operations

getGroups

public Group[] getGroups(String lds,
                         String parentId,
                         String extraFilter)
                  throws AdminException
Return all groups found in the tree that are childs 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 Group getGroup(String lds,
                      String id)
               throws AdminException
Return a Group 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

getGroupByName

public Group getGroupByName(String lds,
                            String name)
                     throws AdminException
Throws:
AdminException

getMaxTimeStamp

public AbstractLDAPTimeStamp getMaxTimeStamp(String lds,
                                             String minTimeStamp)
                                      throws AdminException
Throws:
AdminException

translateGroup

protected Group translateGroup(String lds,
                               com.novell.ldap.LDAPEntry groupEntry)
                        throws AdminException
Translate a group LDAPEntry into a Group 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 Group translateGroups(String lds,
                                List<com.novell.ldap.LDAPEntry> groupEntries)
                         throws AdminException
Translate several groups LDAPEntry into a Group object NOTE : the GroupParentId, the DomainID and the ID are not set. THIS FUNCTION THROW EXCEPTION ONLY WHEN NO SYNCHRO IS RUNNING

Parameters:
lds -
groupEntries -
Returns:
Throws:
AdminException

getGroupMemberGroupIds

public abstract String[] getGroupMemberGroupIds(String lds,
                                                String groupId)
                                         throws AdminException
return 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

getUserMemberGroupIds

public abstract String[] getUserMemberGroupIds(String lds,
                                               String userId)
                                        throws AdminException
return 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

getUserIds

protected abstract String[] getUserIds(String lds,
                                       com.novell.ldap.LDAPEntry groupEntry)
                                throws AdminException
return the users ID that are directly in the group discribes 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

getChildGroupsEntry

protected abstract com.novell.ldap.LDAPEntry[] getChildGroupsEntry(String lds,
                                                                   String parentId,
                                                                   String extraFilter)
                                                            throws AdminException
Return 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

getGroupEntryByName

protected com.novell.ldap.LDAPEntry getGroupEntryByName(String lds,
                                                        String groupName)
                                                 throws AdminException
Throws:
AdminException


Copyright © 2016 Silverpeas. All Rights Reserved.