Class StaticGroupDirectory
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.core.impl.group.directory.StaticGroupDirectory
-
- All Implemented Interfaces:
GroupDirectory
,LogEnabled
public class StaticGroupDirectory extends AbstractLogEnabled implements GroupDirectory
Static implementation of aGroupDirectory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
StaticGroupDirectory.StaticGroup
-
Constructor Summary
Constructors Constructor Description StaticGroupDirectory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Group
getGroup(String groupID)
Returns a particular group.String
getGroupDirectoryModelId()
Get the id of theGroupDirectoryModel
extension pointSet<Group>
getGroups()
Returns all groups.List<Group>
getGroups(int count, int offset, Map parameters)
Get groupsString
getId()
Get the id of the group directory.I18nizableText
getLabel()
Get the label of the group directory.Map<String,Object>
getParameterValues()
Get the values of parameters (from group directory model)Set<String>
getUserGroups(UserIdentity userIdentity)
Get all groups a particular user is in.void
init(String groupDirectoryModelId, Map<String,Object> paramValues)
Initialize the group directory with given parameter values.void
setId(String id)
Set the id of the group directory.void
setLabel(I18nizableText label)
Set the label of the group directory.-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
__PARAMETER_GROUPS_DEFINITION
private static final String __PARAMETER_GROUPS_DEFINITION
- See Also:
- Constant Field Values
-
_label
private I18nizableText _label
-
_gdModelId
private String _gdModelId
-
-
Constructor Detail
-
StaticGroupDirectory
public StaticGroupDirectory()
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:GroupDirectory
Get the id of the group directory.- Specified by:
getId
in interfaceGroupDirectory
- Returns:
- The id of the group directory
-
getLabel
public I18nizableText getLabel()
Description copied from interface:GroupDirectory
Get the label of the group directory.- Specified by:
getLabel
in interfaceGroupDirectory
- Returns:
- The label of the group directory
-
setId
public void setId(String id)
Description copied from interface:GroupDirectory
Set the id of the group directory.- Specified by:
setId
in interfaceGroupDirectory
- Parameters:
id
- The id
-
setLabel
public void setLabel(I18nizableText label)
Description copied from interface:GroupDirectory
Set the label of the group directory.- Specified by:
setLabel
in interfaceGroupDirectory
- Parameters:
label
- The label
-
getGroupDirectoryModelId
public String getGroupDirectoryModelId()
Description copied from interface:GroupDirectory
Get the id of theGroupDirectoryModel
extension point- Specified by:
getGroupDirectoryModelId
in interfaceGroupDirectory
- Returns:
- the id of extension point
-
getParameterValues
public Map<String,Object> getParameterValues()
Description copied from interface:GroupDirectory
Get the values of parameters (from group directory model)- Specified by:
getParameterValues
in interfaceGroupDirectory
- Returns:
- the parameters' values
-
init
public void init(String groupDirectoryModelId, Map<String,Object> paramValues) throws Exception
Description copied from interface:GroupDirectory
Initialize the group directory with given parameter values.- Specified by:
init
in interfaceGroupDirectory
- Parameters:
groupDirectoryModelId
- The id of group directory extension pointparamValues
- The parameters' values- Throws:
Exception
- If an error occured
-
getGroup
public Group getGroup(String groupID)
Description copied from interface:GroupDirectory
Returns a particular group.- Specified by:
getGroup
in interfaceGroupDirectory
- Parameters:
groupID
- The id of the group.- Returns:
- The group or null if the group does not exist.
-
getGroups
public Set<Group> getGroups()
Description copied from interface:GroupDirectory
Returns all groups.- Specified by:
getGroups
in interfaceGroupDirectory
- Returns:
- The groups as a Set of UserGroup, empty if an error occurs.
-
getUserGroups
public Set<String> getUserGroups(UserIdentity userIdentity)
Description copied from interface:GroupDirectory
Get all groups a particular user is in.- Specified by:
getUserGroups
in interfaceGroupDirectory
- Parameters:
userIdentity
- The identity of the user- Returns:
- The groups as a Set of String (group ID), empty if the login does not match.
-
getGroups
public List<Group> getGroups(int count, int offset, Map parameters)
Description copied from interface:GroupDirectory
Get groups- Specified by:
getGroups
in interfaceGroupDirectory
- Parameters:
count
- The maximum number of groups to sax. (-1 to sax all)offset
- The offset to start with, first is 0.parameters
- Parameters for saxing user list differently, see implementation.- Returns:
- The matching groups
-
-