Package org.ametys.core.group
Class GroupManager
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.group.GroupManager
-
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class GroupManager extends AbstractLogEnabled implements Component, Serviceable
Component for getting group list.
-
-
Field Summary
Fields Modifier and Type Field Description protected GroupDirectoryContextHelper
_directoryContextHelper
The helper for the associations group directory/contextprotected GroupDirectoryDAO
_groupDirectoryDAO
The DAO for group directoriesstatic String
ROLE
Avalon Role
-
Constructor Summary
Constructors Constructor Description GroupManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Group
getGroup(String groupDirectoryId, String groupId)
Get a particular group of the givenGroupDirectory
by its idGroup
getGroup(GroupDirectory groupDirectory, String groupId)
Get a particular group of the givenGroupDirectory
by its idGroup
getGroup(GroupIdentity groupIdentity)
Get a particular group of the givenGroupDirectory
by its idGroup
getGroupByContext(String context, String groupId)
Get a particular group on a given contextSet<Group>
getGroups(String groupDirectoryId)
Get all the groups of a givenGroupDirectory
Set<Group>
getGroups(GroupDirectory groupDirectory)
Get all the groups of a givenGroupDirectory
Set<Group>
getGroupsByContext(String context)
Get all the groups on a given contextSet<String>
getUserGroups(String groupDirectoryId, UserIdentity userIdentity)
Get all the groups of aGroupDirectory
the given user is inSet<String>
getUserGroups(GroupDirectory groupDirectory, UserIdentity userIdentity)
Get all the groups of aGroupDirectory
the given user is inSet<GroupIdentity>
getUserGroups(UserIdentity userIdentity)
Get all the groups the given user is invoid
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_groupDirectoryDAO
protected GroupDirectoryDAO _groupDirectoryDAO
The DAO for group directories
-
_directoryContextHelper
protected GroupDirectoryContextHelper _directoryContextHelper
The helper for the associations group directory/context
-
-
Constructor Detail
-
GroupManager
public GroupManager()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getGroup
public Group getGroup(GroupIdentity groupIdentity)
Get a particular group of the givenGroupDirectory
by its id- Parameters:
groupIdentity
- The group identity- Returns:
- The group or null if not found
-
getGroup
public Group getGroup(GroupDirectory groupDirectory, String groupId)
Get a particular group of the givenGroupDirectory
by its id- Parameters:
groupDirectory
- The group directorygroupId
- The id of the group- Returns:
- The group or null if not found
-
getGroup
public Group getGroup(String groupDirectoryId, String groupId)
Get a particular group of the givenGroupDirectory
by its id- Parameters:
groupDirectoryId
- The id of the group directorygroupId
- The id of the group- Returns:
- The group or null if not found
-
getGroupByContext
public Group getGroupByContext(String context, String groupId)
Get a particular group on a given context- Parameters:
context
- The contextgroupId
- The id of the group- Returns:
- The group or null if not found
-
getGroups
public Set<Group> getGroups(GroupDirectory groupDirectory)
Get all the groups of a givenGroupDirectory
- Parameters:
groupDirectory
- The group directory- Returns:
- The set of groups of the group directory
-
getGroups
public Set<Group> getGroups(String groupDirectoryId)
Get all the groups of a givenGroupDirectory
- Parameters:
groupDirectoryId
- The id of the group directory- Returns:
- The set of groups of the group directory
-
getGroupsByContext
public Set<Group> getGroupsByContext(String context)
Get all the groups on a given context- Parameters:
context
- The context- Returns:
- The set of groups
-
getUserGroups
public Set<GroupIdentity> getUserGroups(UserIdentity userIdentity)
Get all the groups the given user is in- Parameters:
userIdentity
- The user identity.- Returns:
- The set of groups the user is in
-
getUserGroups
public Set<String> getUserGroups(GroupDirectory groupDirectory, UserIdentity userIdentity)
Get all the groups of aGroupDirectory
the given user is in- Parameters:
groupDirectory
- The group directoryuserIdentity
- The user identity.- Returns:
- A set of groups the user is in
-
getUserGroups
public Set<String> getUserGroups(String groupDirectoryId, UserIdentity userIdentity)
Get all the groups of aGroupDirectory
the given user is in- Parameters:
groupDirectoryId
- The id of the group directoryuserIdentity
- The user identity.- Returns:
- A set of groups the user is in
-
-