Package pl.edu.icm.unity.engine.api
Interface GroupsManagement
public interface GroupsManagement
Internal engine API for groups management.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new groupvoid
Adds a new group in a recursive wayvoid
Adds new groupsvoid
addMemberFromParent
(String path, EntityParam entity) AsaddMemberFromParent(String, EntityParam, List)
with an empty list of attribute classes.void
addMemberFromParent
(String path, EntityParam entity, List<Attribute> attributes) Adds a new member to the group.void
addMemberFromParent
(String path, EntityParam entity, List<Attribute> attributes, String idp, String translationProfile) Adds a new member to the group.getChildGroups
(String root) getContents
(String path, int filter) Allows to retrieve group's contents and metadata.getGroupsByWildcard
(String pathWildcard) Retrieves list of all groups matching a given ant-style wildcardgetGroupsChain
(String path) boolean
void
removeGroup
(String path, boolean recursive) Removes a given group.void
removeMember
(String path, EntityParam entity) Removes from the group and all subgroups if the user is in any.void
updateGroup
(String path, Group group) Updates the group, without specifying any special audit log informationvoid
updateGroup
(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 Details
-
isPresent
- Returns:
- true if the given group exists
- Throws:
AuthorizationException
-
addGroup
Adds a new group- Parameters:
toAdd
- group to add- Throws:
EngineException
-
addGroup
Adds a new group in a recursive way- Parameters:
toAdd
- group to addwithParents
- flag to add group recursively- Throws:
EngineException
-
addGroups
Adds new groups- Parameters:
requestedGroups
- set of groups to add- Throws:
EngineException
-
removeGroup
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'sAttributesClass
es 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'sAttributesClass
es require some attributes from all members.- Throws:
EngineException
-
addMemberFromParent
AsaddMemberFromParent(String, EntityParam, List)
with an empty list of attribute classes.- Throws:
EngineException
-
removeMember
Removes from the group and all subgroups if the user is in any. Entity can not be removed from the group == '/'- Throws:
EngineException
-
getContents
Allows to retrieve group's contents and metadata.- Parameters:
path
- group to be queried.filter
- what should be retrieved. Flags are defined inGroupContents
class. Can be OR-ed.- Throws:
EngineException
-
getGroupsByWildcard
Retrieves list of all groups matching a given ant-style wildcard -
getChildGroups
- 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
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
- Returns:
- GroupChain for given group
- Throws:
EngineException
-
getAllGroups
- Throws:
EngineException
-