Interface GroupsManagement


public interface GroupsManagement
Internal engine API for groups management.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addGroup(pl.edu.icm.unity.base.group.Group toAdd)
    Adds a new group
    void
    addGroup(pl.edu.icm.unity.base.group.Group toAdd, boolean withParents)
    Adds a new group in a recursive way
    void
    addGroups(Set<pl.edu.icm.unity.base.group.Group> toAdd)
    Adds new groups
    void
    addMemberFromParent(String path, pl.edu.icm.unity.base.entity.EntityParam entity)
    As addMemberFromParent(String, EntityParam, List) with an empty list of attribute classes.
    void
    addMemberFromParent(String path, pl.edu.icm.unity.base.entity.EntityParam entity, List<pl.edu.icm.unity.base.attribute.Attribute> attributes)
    Adds a new member to the group.
    void
    addMemberFromParent(String path, pl.edu.icm.unity.base.entity.EntityParam entity, List<pl.edu.icm.unity.base.attribute.Attribute> attributes, String idp, String translationProfile)
    Adds a new member to the group.
    Map<String,pl.edu.icm.unity.base.group.Group>
     
     
    pl.edu.icm.unity.base.group.GroupContents
    getContents(String path, int filter)
    Allows to retrieve group's contents and metadata.
    List<pl.edu.icm.unity.base.group.Group>
    Retrieves list of all groups matching a given ant-style wildcard
     
    boolean
     
    void
    removeGroup(String path, boolean recursive)
    Removes a given group.
    void
    removeMember(String path, pl.edu.icm.unity.base.entity.EntityParam entity)
    Removes from the group and all subgroups if the user is in any.
    void
    updateGroup(String path, pl.edu.icm.unity.base.group.Group group)
    Updates the group, without specifying any special audit log information
    void
    updateGroup(String path, pl.edu.icm.unity.base.group.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

      boolean isPresent(String group) throws AuthorizationException
      Returns:
      true if the given group exists
      Throws:
      AuthorizationException
    • addGroup

      void addGroup(pl.edu.icm.unity.base.group.Group toAdd) throws pl.edu.icm.unity.base.exceptions.EngineException
      Adds a new group
      Parameters:
      toAdd - group to add
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException
    • addGroup

      void addGroup(pl.edu.icm.unity.base.group.Group toAdd, boolean withParents) throws pl.edu.icm.unity.base.exceptions.EngineException
      Adds a new group in a recursive way
      Parameters:
      toAdd - group to add
      withParents - flag to add group recursively
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException
    • addGroups

      void addGroups(Set<pl.edu.icm.unity.base.group.Group> toAdd) throws pl.edu.icm.unity.base.exceptions.EngineException
      Adds new groups
      Parameters:
      requestedGroups - set of groups to add
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException
    • removeGroup

      void removeGroup(String path, boolean recursive) throws pl.edu.icm.unity.base.exceptions.EngineException
      Removes a given group. Doesn't work for '/' path.
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException
    • addMemberFromParent

      void addMemberFromParent(String path, pl.edu.icm.unity.base.entity.EntityParam entity, List<pl.edu.icm.unity.base.attribute.Attribute> attributes, String idp, String translationProfile) throws pl.edu.icm.unity.base.exceptions.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's AttributesClasses require some attributes from all members.
      idp - Id of Idp responsible (typically implicitly via translation profile) for addition to the group
      translationProfile - name of an input translation profile which created the membership
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException
    • addMemberFromParent

      void addMemberFromParent(String path, pl.edu.icm.unity.base.entity.EntityParam entity, List<pl.edu.icm.unity.base.attribute.Attribute> attributes) throws pl.edu.icm.unity.base.exceptions.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's AttributesClasses require some attributes from all members.
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException
    • addMemberFromParent

      void addMemberFromParent(String path, pl.edu.icm.unity.base.entity.EntityParam entity) throws pl.edu.icm.unity.base.exceptions.EngineException
      As addMemberFromParent(String, EntityParam, List) with an empty list of attribute classes.
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException
    • removeMember

      void removeMember(String path, pl.edu.icm.unity.base.entity.EntityParam entity) throws pl.edu.icm.unity.base.exceptions.EngineException
      Removes from the group and all subgroups if the user is in any. Entity can not be removed from the group == '/'
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException
    • getContents

      pl.edu.icm.unity.base.group.GroupContents getContents(String path, int filter) throws pl.edu.icm.unity.base.exceptions.EngineException
      Allows to retrieve group's contents and metadata.
      Parameters:
      path - group to be queried.
      filter - what should be retrieved. Flags are defined in GroupContents class. Can be OR-ed.
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException
    • getGroupsByWildcard

      List<pl.edu.icm.unity.base.group.Group> getGroupsByWildcard(String pathWildcard)
      Retrieves list of all groups matching a given ant-style wildcard
    • getChildGroups

      Set<String> getChildGroups(String root) throws pl.edu.icm.unity.base.exceptions.EngineException
      Returns:
      all groups which are children of the root group (including grand children). The root group is also in the returned set.
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException
    • updateGroup

      void updateGroup(String path, pl.edu.icm.unity.base.group.Group group) throws pl.edu.icm.unity.base.exceptions.EngineException
      Updates the group, without specifying any special audit log information
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException
    • updateGroup

      void updateGroup(String path, pl.edu.icm.unity.base.group.Group group, String changedProperty, String newValue) throws pl.edu.icm.unity.base.exceptions.EngineException
      Updates the group and pass information: changed property and new value used for audit log only
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException
    • getGroupsChain

      GroupsChain getGroupsChain(String path) throws pl.edu.icm.unity.base.exceptions.EngineException
      Returns:
      GroupChain for given group
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException
    • getAllGroups

      Map<String,pl.edu.icm.unity.base.group.Group> getAllGroups() throws pl.edu.icm.unity.base.exceptions.EngineException
      Throws:
      pl.edu.icm.unity.base.exceptions.EngineException