Package pl.edu.icm.unity.engine.api
Interface GroupsManagement
-
public interface GroupsManagementInternal engine API for groups management.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddGroup(Group toAdd)Adds a new groupvoidaddGroup(Group toAdd, boolean withParents)Adds a new group in a recursive wayvoidaddGroups(Set<Group> toAdd)Adds new groupsvoidaddMemberFromParent(String path, EntityParam entity)AsaddMemberFromParent(String, EntityParam, List)with an empty list of attribute classes.voidaddMemberFromParent(String path, EntityParam entity, List<Attribute> attributes)Adds a new member to the group.voidaddMemberFromParent(String path, EntityParam entity, List<Attribute> attributes, String idp, String translationProfile)Adds a new member to the group.Map<String,Group>getAllGroups()Set<String>getChildGroups(String root)GroupContentsgetContents(String path, int filter)Allows to retrieve group's contents and metadata.List<Group>getGroupsByWildcard(String pathWildcard)Retrieves list of all groups matching a given ant-style wildcardGroupsChaingetGroupsChain(String path)booleanisPresent(String group)voidremoveGroup(String path, boolean recursive)Removes a given group.voidremoveMember(String path, EntityParam entity)Removes from the group and all subgroups if the user is in any.voidupdateGroup(String path, Group group)Updates the group, without specifying any special audit log informationvoidupdateGroup(String path, Group group, String changedProperty, String newValue)Updates the group and pass information: changed property and new value used for audit log only
-
-
-
Method Detail
-
isPresent
boolean isPresent(String group) throws AuthorizationException
- Returns:
- true if the given group exists
- Throws:
AuthorizationException
-
addGroup
void addGroup(Group toAdd) throws EngineException
Adds a new group- Parameters:
toAdd- group to add- Throws:
EngineException
-
addGroup
void addGroup(Group toAdd, boolean withParents) throws EngineException
Adds a new group in a recursive way- Parameters:
toAdd- group to addwithParents- flag to add group recursively- Throws:
EngineException
-
addGroups
void addGroups(Set<Group> toAdd) throws EngineException
Adds new groups- Parameters:
requestedGroups- set of groups to add- Throws:
EngineException
-
removeGroup
void removeGroup(String path, boolean recursive) throws EngineException
Removes a given group. Doesn't work for '/' path.- Throws:
EngineException
-
addMemberFromParent
void addMemberFromParent(String path, EntityParam entity, List<Attribute> attributes, String idp, String translationProfile) throws EngineException
Adds a new member to the group. The entity must be a member of a parent group. This method should be used when adding to a group in effect of remote account mapping.- Parameters:
attributes- an optional list of attributes to be assigned to the member in this group scope. It is especially useful in the case when group'sAttributesClasses require some attributes from all members.idp- Id of Idp responsible (typically implicitly via translation profile) for addition to the grouptranslationProfile- name of an input translation profile which created the membership- Throws:
EngineException
-
addMemberFromParent
void addMemberFromParent(String path, EntityParam entity, List<Attribute> attributes) throws EngineException
Adds a new member to the group. The entity must be a member of a parent group. This method must be used when adding to a group manually.- Parameters:
attributes- an optional list of attributes to be assigned to the member in this group scope. It is especially useful in the case when group'sAttributesClasses require some attributes from all members.- Throws:
EngineException
-
addMemberFromParent
void addMemberFromParent(String path, EntityParam entity) throws EngineException
AsaddMemberFromParent(String, EntityParam, List)with an empty list of attribute classes.- Throws:
EngineException
-
removeMember
void removeMember(String path, EntityParam entity) throws EngineException
Removes from the group and all subgroups if the user is in any. Entity can not be removed from the group == '/'- Throws:
EngineException
-
getContents
GroupContents getContents(String path, int filter) throws EngineException
Allows to retrieve group's contents and metadata.- Parameters:
path- group to be queried.filter- what should be retrieved. Flags are defined inGroupContentsclass. Can be OR-ed.- Throws:
EngineException
-
getGroupsByWildcard
List<Group> getGroupsByWildcard(String pathWildcard)
Retrieves list of all groups matching a given ant-style wildcard
-
getChildGroups
Set<String> getChildGroups(String root) throws EngineException
- Returns:
- all groups which are children of the root group (including grand children). The root group is also in the returned set.
- Throws:
EngineException
-
updateGroup
void updateGroup(String path, Group group) throws EngineException
Updates the group, without specifying any special audit log information- Throws:
EngineException
-
updateGroup
void updateGroup(String path, Group group, String changedProperty, String newValue) throws EngineException
Updates the group and pass information: changed property and new value used for audit log only- Throws:
EngineException
-
getGroupsChain
GroupsChain getGroupsChain(String path) throws EngineException
- Returns:
- GroupChain for given group
- Throws:
EngineException
-
getAllGroups
Map<String,Group> getAllGroups() throws EngineException
- Throws:
EngineException
-
-