Class AnyGroupsManager

java.lang.Object
eu.c6.gibraltar.api.common.AbstractManager
eu.c6.gibraltar.api.managers.groups.AnyGroupsManager

public class AnyGroupsManager extends AbstractManager
Class to manage groups. Group identifier (group ID) is the group name.
  • Constructor Details

    • AnyGroupsManager

      public AnyGroupsManager(AnySession anySession)
      Instantiates a new groups manager.
      Parameters:
      anySession - the Any user session
  • Method Details

    • getItemsAsExcel

      public InputStream getItemsAsExcel(boolean showTechnical, String search) throws Exception
      Gets the list of group items as Excel stream output.
      Parameters:
      showTechnical - If TRUE the list will also contain technical groups. If FALSE the list will contain only public groups.
      search - Filters groups using fulltext search term. Use NULL to not filter. Performances can be affected when using a filter.
      Returns:
      Excel file input stream (media type : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
      Throws:
      Exception - the exception if current user does not have permission to list groups.
    • getItems

      public List<IAnyGroup> getItems(boolean showTechnical, String search) throws Exception
      Gets the list of group items.
      Parameters:
      showTechnical - the show technical
      search - Filters groups using fulltext search term. Use NULL to not filter. Performances can be affected when using a filter.
      Returns:
      the group items
      Throws:
      Exception - the exception if current user does not have permission to list groups.
      See Also:
    • get

      public IAnyGroup get(String groupId) throws Exception
      Gets the group item with its name.
      Parameters:
      groupId - the group identifier
      Returns:
      the group item
      Throws:
      Exception - the exception if current user does not have permission to list groups or group does not exist.
    • getMembers

      public List<String> getMembers(String groupId) throws Exception
      Get recursively all the members of a group.
      Parameters:
      groupId - the group identifier
      Returns:
      the list of user names in the group and the ones in the sub groups
      Throws:
      Exception - the exception if current user does not have permission to list groups or group does not exist
    • create

      public boolean create(IAnyGroup group) throws Exception
      Creates the group with specified identifier, description, roles, group members and user members.
      Parameters:
      group - the group item. Group identifier is required and must be only composed with lower case characters, underscore and number. Group identifier maximum length is 128 characters.
      Returns:
      true, if successfully created
      Throws:
      Exception - the exception if current user does not have permission to create groups or group already exist.
    • update

      public boolean update(IAnyGroup group) throws Exception
      Update the group with specified identifier using description, roles, group members and user members.
      Parameters:
      group - the group item to update. Will match group with specified group ID.
      Returns:
      true, if successfully updated
      Throws:
      Exception - the exception if current user does not have permission to update groups or group does not exist.
    • delete

      public boolean delete(String groupId) throws Exception
      Delete the group with specified identifier.
      Parameters:
      groupId - the group identifier
      Returns:
      true, if successfully deleted
      Throws:
      Exception - the exception if current user does not have permission to delete groups or group does not exist.