Interface GroupsManagement


  • public interface GroupsManagement
    Internal engine API for groups management.
    Author:
    K. Benedyczak
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addGroup​(pl.edu.icm.unity.types.basic.Group toAdd)
      Adds a new group
      void addMemberFromParent​(java.lang.String path, pl.edu.icm.unity.types.basic.EntityParam entity)
      As addMemberFromParent(String, EntityParam, List) with an empty list of attribute classes.
      void addMemberFromParent​(java.lang.String path, pl.edu.icm.unity.types.basic.EntityParam entity, java.util.List<pl.edu.icm.unity.types.basic.Attribute> attributes)
      Adds a new member to the group.
      void addMemberFromParent​(java.lang.String path, pl.edu.icm.unity.types.basic.EntityParam entity, java.util.List<pl.edu.icm.unity.types.basic.Attribute> attributes, java.lang.String idp, java.lang.String translationProfile)
      Adds a new member to the group.
      java.util.Set<java.lang.String> getChildGroups​(java.lang.String root)  
      pl.edu.icm.unity.types.basic.GroupContents getContents​(java.lang.String path, int filter)
      Allows to retrieve group's contents and metadata.
      java.util.List<pl.edu.icm.unity.types.basic.Group> getGroupsByWildcard​(java.lang.String pathWildcard)
      Retrieves list of all groups matching a given ant-style wildcard
      boolean isPresent​(java.lang.String group)  
      void removeGroup​(java.lang.String path, boolean recursive)
      Removes a given group.
      void removeMember​(java.lang.String path, pl.edu.icm.unity.types.basic.EntityParam entity)
      Removes from the group and all subgroups if the user is in any.
      void updateGroup​(java.lang.String path, pl.edu.icm.unity.types.basic.Group group)
      Updates the group.
      void updateGroup​(java.lang.String path, pl.edu.icm.unity.types.basic.Group group, java.lang.String changedProperty, java.lang.String newValue)
      Updates the group and pass information: changed property and new value.
    • Method Detail

      • isPresent

        boolean isPresent​(java.lang.String group)
                   throws pl.edu.icm.unity.exceptions.AuthorizationException
        Parameters:
        group -
        Returns:
        true if the given group exists
        Throws:
        pl.edu.icm.unity.exceptions.AuthorizationException
      • addGroup

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

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

        void addMemberFromParent​(java.lang.String path,
                                 pl.edu.icm.unity.types.basic.EntityParam entity,
                                 java.util.List<pl.edu.icm.unity.types.basic.Attribute> attributes,
                                 java.lang.String idp,
                                 java.lang.String translationProfile)
                          throws pl.edu.icm.unity.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:
        path -
        entity -
        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.exceptions.EngineException
      • addMemberFromParent

        void addMemberFromParent​(java.lang.String path,
                                 pl.edu.icm.unity.types.basic.EntityParam entity,
                                 java.util.List<pl.edu.icm.unity.types.basic.Attribute> attributes)
                          throws pl.edu.icm.unity.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:
        path -
        entity -
        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.exceptions.EngineException
      • addMemberFromParent

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

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

        pl.edu.icm.unity.types.basic.GroupContents getContents​(java.lang.String path,
                                                               int filter)
                                                        throws pl.edu.icm.unity.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.
        Returns:
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • getGroupsByWildcard

        java.util.List<pl.edu.icm.unity.types.basic.Group> getGroupsByWildcard​(java.lang.String pathWildcard)
        Retrieves list of all groups matching a given ant-style wildcard
      • getChildGroups

        java.util.Set<java.lang.String> getChildGroups​(java.lang.String root)
                                                throws pl.edu.icm.unity.exceptions.EngineException
        Parameters:
        root -
        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.exceptions.EngineException
      • updateGroup

        void updateGroup​(java.lang.String path,
                         pl.edu.icm.unity.types.basic.Group group)
                  throws pl.edu.icm.unity.exceptions.EngineException
        Updates the group.
        Parameters:
        path -
        group - new group's metadata
        Throws:
        pl.edu.icm.unity.exceptions.EngineException
      • updateGroup

        void updateGroup​(java.lang.String path,
                         pl.edu.icm.unity.types.basic.Group group,
                         java.lang.String changedProperty,
                         java.lang.String newValue)
                  throws pl.edu.icm.unity.exceptions.EngineException
        Updates the group and pass information: changed property and new value.
        Parameters:
        path -
        group - new group's metadata
        changedProperty - description of change
        newValue - value that was set
        Throws:
        pl.edu.icm.unity.exceptions.EngineException