Class AbstractLDAPGroup
- java.lang.Object
-
- org.silverpeas.core.admin.domain.driver.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 retrieve the groups' elements(groups or users)- Author:
- tleroi
-
-
Constructor Summary
Constructors Constructor Description AbstractLDAPGroup()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
beginSynchronization()
Called when Admin starts the synchronizationString
endSynchronization()
Called when Admin ends the synchronizationGroupDetail[]
getAllGroups(String lds, String extraFilter)
Return all groupsprotected abstract com.novell.ldap.LDAPEntry[]
getChildGroupsEntry(String lds, String parentId, String extraFilter)
Gets a set of LDAP entries that are the child groups of a parent one THIS FUNCTION THROW EXCEPTION ONLY WHEN NO SYNCHRO IS RUNNINGGroupDetail
getGroup(String lds, String id)
Return a GroupDetail object filled with the infos of the group having ID = id NOTE : the DomainID and the ID are not set.GroupDetail
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)
Gets the group's parent groups IDs THIS FUNCTION ALWAYS THROW EXCEPTION (EVEN IF A SYNCHRO IS RUNNING)GroupDetail[]
getGroups(String lds, String parentId, String extraFilter)
Return all groups found in the tree that are children of parentId group or return root groups if parentId is null or emptyprotected com.novell.ldap.LDAPEntry
getMemberEntry(String lds, String memberId, boolean isGroup)
protected String
getSpecificId(String lds, com.novell.ldap.LDAPEntry theEntry)
protected abstract String[]
getUserIds(String lds, com.novell.ldap.LDAPEntry groupEntry)
Gets the users ID that are directly in the group describes by groupEntry THIS FUNCTION ALWAYS THROW EXCEPTION (EVEN IF A SYNCHRO IS RUNNING)abstract String[]
getUserMemberGroupIds(String lds, String userId)
Gets 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 onesprotected GroupDetail
translateGroup(String lds, com.novell.ldap.LDAPEntry groupEntry)
Translate a group LDAPEntry into a GroupDetail object NOTE : the GroupParentId, the DomainID and the ID are not set.protected GroupDetail
translateGroups(String lds, List<com.novell.ldap.LDAPEntry> groupEntries)
Translate several groups LDAPEntry into a GroupDetail object NOTE : the GroupParentId, the DomainID and the ID are not set.
-
-
-
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
-
getAllGroups
public GroupDetail[] 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 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 connectionparentId
- 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 connectionid
- 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 GroupDetail getGroupByName(String lds, String name) throws AdminException
- Throws:
AdminException
-
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 servicegroupEntries
- 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 connectionparentId
- 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 connectiongroupId
- 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
-
getMemberEntry
protected com.novell.ldap.LDAPEntry getMemberEntry(String lds, String memberId, boolean isGroup) throws AdminException
- Throws:
AdminException
-
getSpecificId
protected String getSpecificId(String lds, com.novell.ldap.LDAPEntry theEntry) throws AdminException
- Throws:
AdminException
-
-