com.atlassian.crowd.plugin.rest.service.controller
Class GroupsController

java.lang.Object
  extended by com.atlassian.crowd.plugin.rest.service.controller.GroupsController

public class GroupsController
extends java.lang.Object

Controller for the Group resource.


Constructor Summary
GroupsController(ApplicationService applicationService, ApplicationManager applicationManager)
           
 
Method Summary
 void addDirectChildGroup(java.lang.String applicationName, java.lang.String groupName, java.lang.String childGroupName)
          Adds a direct child group membership.
 void addDirectParentGroup(java.lang.String applicationName, java.lang.String groupName, java.lang.String parentGroupName)
          Adds a direct parent group membership.
 void addDirectUser(java.lang.String applicationName, java.lang.String groupName, java.lang.String username)
          Adds user as direct member of group.
 java.lang.String addGroup(java.lang.String applicationName, GroupEntity group)
          Adds a new group.
 void deleteDirectChildGroup(java.lang.String applicationName, java.lang.String groupName, java.lang.String childGroupName)
          Deletes a child group membership.
 void deleteDirectUser(java.lang.String applicationName, java.lang.String groupName, java.lang.String username)
          Removes the user membership.
 GroupEntity findGroupByName(java.lang.String applicationName, java.lang.String name, boolean expandAttributes, java.net.URI baseURI)
          Returns the group specified by the name.
 GroupEntity getDirectChildGroup(java.lang.String applicationName, java.lang.String groupName, java.lang.String childGroupName, java.net.URI baseUri)
          Retrieves the group that is a direct child of the specified group.
 GroupEntityList getDirectChildGroups(java.lang.String applicationName, java.lang.String groupName, boolean expandGroups, int maxResults, int startIndex, java.net.URI baseUri)
          Retrieves the groups that are direct members of the specified group.
 GroupEntity getDirectParentGroup(java.lang.String applicationName, java.lang.String groupName, java.lang.String parentGroupName, java.net.URI baseUri)
          Retrieves the group that is a direct parent of the specified group.
 GroupEntityList getDirectParentGroups(java.lang.String applicationName, java.lang.String groupName, boolean expandGroups, int maxResults, int startIndex, java.net.URI baseUri)
          Retrieves the groups that are direct parents of the specified group.
 UserEntity getDirectUser(java.lang.String applicationName, java.lang.String groupName, java.lang.String username, java.net.URI baseUri)
          Retrieves the user that is a direct member of the specified group.
 UserEntityList getDirectUsers(java.lang.String applicationName, java.lang.String groupName, boolean expandUsers, int maxResults, int startIndex, java.net.URI baseUri)
          Retrieves the users that are direct members of the specified group.
 GroupEntity getNestedChildGroup(java.lang.String applicationName, java.lang.String groupName, java.lang.String childGroupName, java.net.URI baseUri)
          Retrieves the group that is a nested child of the specified group.
 GroupEntityList getNestedChildGroups(java.lang.String applicationName, java.lang.String groupName, boolean expandGroups, int maxResults, int startIndex, java.net.URI baseUri)
          Retrieves the groups that are nested children of the specified group.
 GroupEntity getNestedParentGroup(java.lang.String applicationName, java.lang.String groupName, java.lang.String parentGroupName, java.net.URI baseUri)
          Retrieves the group that is a nested parent of the specified group.
 GroupEntityList getNestedParentGroups(java.lang.String applicationName, java.lang.String groupName, boolean expandGroups, int maxResults, int startIndex, java.net.URI baseUri)
          Retrieves the groups that are nested parents of the specified group.
 UserEntity getNestedUser(java.lang.String applicationName, java.lang.String groupName, java.lang.String username, java.net.URI baseUri)
          Retrieves the user that is a nested member of the specified group.
 UserEntityList getNestedUsers(java.lang.String applicationName, java.lang.String groupName, boolean expandUsers, int maxResults, int startIndex, java.net.URI baseUri)
          Retrieves the users that are nested members of the specified group.
 void removeGroup(java.lang.String applicationName, java.lang.String groupName)
          Removes a group.
 void removeGroupAttributes(java.lang.String applicationName, java.lang.String groupName, java.lang.String attributeName)
          Removes a group's attribute.
 void storeGroupAttributes(java.lang.String applicationName, java.lang.String groupName, AttributeEntityList attributes)
          Stores the attributes for a group.
 GroupEntity updateGroup(java.lang.String applicationName, GroupEntity group, java.net.URI baseURI)
          Updates a group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupsController

public GroupsController(ApplicationService applicationService,
                        ApplicationManager applicationManager)
Method Detail

findGroupByName

public GroupEntity findGroupByName(java.lang.String applicationName,
                                   java.lang.String name,
                                   boolean expandAttributes,
                                   java.net.URI baseURI)
Returns the group specified by the name.

Parameters:
applicationName - name of the application
name - name of the group to return
expandAttributes - should attributes be expanded
baseURI - base URI
Returns:
group

addGroup

public java.lang.String addGroup(java.lang.String applicationName,
                                 GroupEntity group)
                          throws ApplicationPermissionException,
                                 OperationFailedException
Adds a new group.

Parameters:
applicationName - name of the application
group - group to add
Returns:
group name just added
Throws:
ApplicationPermissionException - if none of the application's underlying directories are allowed to create a group
OperationFailedException - if the operation failed for any other reason

updateGroup

public GroupEntity updateGroup(java.lang.String applicationName,
                               GroupEntity group,
                               java.net.URI baseURI)
                        throws ApplicationPermissionException,
                               OperationFailedException
Updates a group.

Parameters:
applicationName - name of the application
group - group to update
baseURI - base URI
Returns:
group
Throws:
InvalidGroupException - if the group already exists in ANY associated directory or the group template does not have the required properties populated.
OperationFailedException - underlying directory implementation failed to execute the operation.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.
GroupNotFoundException - group does not exist in any of the associated directories of the application.

removeGroup

public void removeGroup(java.lang.String applicationName,
                        java.lang.String groupName)
                 throws ApplicationPermissionException,
                        OperationFailedException
Removes a group.

Parameters:
applicationName - name of the application
groupName - name of the group
Throws:
OperationFailedException - underlying directory implementation failed to execute the operation.
GroupNotFoundException - if group with given name does not exist in ANY assigned directory.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.DELETE_GROUP.

storeGroupAttributes

public void storeGroupAttributes(java.lang.String applicationName,
                                 java.lang.String groupName,
                                 AttributeEntityList attributes)
                          throws ApplicationPermissionException,
                                 OperationFailedException
Stores the attributes for a group.

Parameters:
applicationName - name of the application
groupName - name of the group
attributes - attributes to add/update
Throws:
GroupNotFoundException - if the group with the supplied groupname does not exist in ANY assigned directory.
OperationFailedException - underlying directory implementation failed to execute the operation.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.

removeGroupAttributes

public void removeGroupAttributes(java.lang.String applicationName,
                                  java.lang.String groupName,
                                  java.lang.String attributeName)
                           throws ApplicationPermissionException,
                                  OperationFailedException
Removes a group's attribute.

Parameters:
applicationName - name of the application
groupName - name of the group
attributeName - attribute to remove
Throws:
GroupNotFoundException - if the group with the supplied groupname does not exist in ANY assigned directory.
OperationFailedException - underlying directory implementation failed to execute the operation.
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.

getDirectUsers

public UserEntityList getDirectUsers(java.lang.String applicationName,
                                     java.lang.String groupName,
                                     boolean expandUsers,
                                     int maxResults,
                                     int startIndex,
                                     java.net.URI baseUri)
Retrieves the users that are direct members of the specified group.

Parameters:
applicationName - name of the application
groupName - name of the group
expandUsers - should users be expanded
maxResults - maximum number of results returned. If -1, then all the results are returned.
startIndex - starting index of the results
baseUri - base URI
Returns:
users that are direct members of the specified group

addDirectUser

public void addDirectUser(java.lang.String applicationName,
                          java.lang.String groupName,
                          java.lang.String username)
                   throws ApplicationPermissionException
Adds user as direct member of group.

Parameters:
applicationName - name of the application
groupName - name of the group
username - name of the child group
Throws:
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.

getDirectUser

public UserEntity getDirectUser(java.lang.String applicationName,
                                java.lang.String groupName,
                                java.lang.String username,
                                java.net.URI baseUri)
Retrieves the user that is a direct member of the specified group.

Parameters:
applicationName - name of the application
groupName - name of the group
username - name of the child group
baseUri - base URI
Returns:
user that is a direct member of the specified group

deleteDirectUser

public void deleteDirectUser(java.lang.String applicationName,
                             java.lang.String groupName,
                             java.lang.String username)
                      throws ApplicationPermissionException
Removes the user membership.

Parameters:
applicationName - name of the application
groupName - name of the group
username - name of the user
Throws:
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.

getNestedUsers

public UserEntityList getNestedUsers(java.lang.String applicationName,
                                     java.lang.String groupName,
                                     boolean expandUsers,
                                     int maxResults,
                                     int startIndex,
                                     java.net.URI baseUri)
Retrieves the users that are nested members of the specified group.

Parameters:
applicationName - name of the application
groupName - name of the group
expandUsers - should groups be expanded
maxResults - maximum number of results returned. If -1, then all the results are returned.
startIndex - starting index of the results
baseUri - base URI
Returns:
users that are nested members of the specified group

getNestedUser

public UserEntity getNestedUser(java.lang.String applicationName,
                                java.lang.String groupName,
                                java.lang.String username,
                                java.net.URI baseUri)
Retrieves the user that is a nested member of the specified group.

Parameters:
applicationName - name of the application
groupName - name of the group
username - name of the user
baseUri - base URI
Returns:
user that is a nested member of the specified group

getDirectParentGroups

public GroupEntityList getDirectParentGroups(java.lang.String applicationName,
                                             java.lang.String groupName,
                                             boolean expandGroups,
                                             int maxResults,
                                             int startIndex,
                                             java.net.URI baseUri)
Retrieves the groups that are direct parents of the specified group.

Parameters:
applicationName - name of the application
groupName - name of the group
expandGroups - should groups be expanded
maxResults - maximum number of results returned. If -1, then all the results are returned.
startIndex - starting index of the results
baseUri - base URI
Returns:
groups that are direct parents of the specified group

addDirectParentGroup

public void addDirectParentGroup(java.lang.String applicationName,
                                 java.lang.String groupName,
                                 java.lang.String parentGroupName)
                          throws ApplicationPermissionException
Adds a direct parent group membership.

Parameters:
applicationName - name of the application
groupName - name of the group
parentGroupName - name of the parent group
Throws:
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.

getDirectParentGroup

public GroupEntity getDirectParentGroup(java.lang.String applicationName,
                                        java.lang.String groupName,
                                        java.lang.String parentGroupName,
                                        java.net.URI baseUri)
Retrieves the group that is a direct parent of the specified group.

Parameters:
applicationName - name of the application
groupName - name of the group
parentGroupName - name of the child group
baseUri - base URI
Returns:
group that is a direct parent of the specified group

getNestedParentGroups

public GroupEntityList getNestedParentGroups(java.lang.String applicationName,
                                             java.lang.String groupName,
                                             boolean expandGroups,
                                             int maxResults,
                                             int startIndex,
                                             java.net.URI baseUri)
Retrieves the groups that are nested parents of the specified group.

Parameters:
applicationName - name of the application
groupName - name of the group
expandGroups - should groups be expanded
maxResults - maximum number of results returned. If -1, then all the results are returned.
startIndex - starting index of the results
baseUri - base URI
Returns:
groups that are nested parents of the specified group

getNestedParentGroup

public GroupEntity getNestedParentGroup(java.lang.String applicationName,
                                        java.lang.String groupName,
                                        java.lang.String parentGroupName,
                                        java.net.URI baseUri)
Retrieves the group that is a nested parent of the specified group.

Parameters:
applicationName - name of the application
groupName - name of the group
parentGroupName - name of the parent group
baseUri - base URI
Returns:
group that is a nested parent of the specified group

getDirectChildGroups

public GroupEntityList getDirectChildGroups(java.lang.String applicationName,
                                            java.lang.String groupName,
                                            boolean expandGroups,
                                            int maxResults,
                                            int startIndex,
                                            java.net.URI baseUri)
Retrieves the groups that are direct members of the specified group.

Parameters:
applicationName - name of the application
groupName - name of the group
expandGroups - should groups be expanded
maxResults - maximum number of results returned. If -1, then all the results are returned.
startIndex - starting index of the results
baseUri - base URI
Returns:
groups that are direct members of the specified group

addDirectChildGroup

public void addDirectChildGroup(java.lang.String applicationName,
                                java.lang.String groupName,
                                java.lang.String childGroupName)
                         throws ApplicationPermissionException
Adds a direct child group membership.

Parameters:
applicationName - name of the application
groupName - name of the group
childGroupName - name of the child group
Throws:
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.

getDirectChildGroup

public GroupEntity getDirectChildGroup(java.lang.String applicationName,
                                       java.lang.String groupName,
                                       java.lang.String childGroupName,
                                       java.net.URI baseUri)
Retrieves the group that is a direct child of the specified group.

Parameters:
applicationName - name of the application
groupName - name of the group
childGroupName - name of the child group
baseUri - base URI
Returns:
group that is a direct child of the specified group

deleteDirectChildGroup

public void deleteDirectChildGroup(java.lang.String applicationName,
                                   java.lang.String groupName,
                                   java.lang.String childGroupName)
                            throws ApplicationPermissionException
Deletes a child group membership.

Parameters:
applicationName - name of the application
groupName - name of the group
childGroupName - name of the child group
Throws:
ApplicationPermissionException - if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP.

getNestedChildGroups

public GroupEntityList getNestedChildGroups(java.lang.String applicationName,
                                            java.lang.String groupName,
                                            boolean expandGroups,
                                            int maxResults,
                                            int startIndex,
                                            java.net.URI baseUri)
Retrieves the groups that are nested children of the specified group.

Parameters:
applicationName - name of the application
groupName - name of the group
expandGroups - should groups be expanded
maxResults - maximum number of results returned. If -1, then all the results are returned.
startIndex - starting index of the results
baseUri - base URI
Returns:
groups that are nested children of the specified group

getNestedChildGroup

public GroupEntity getNestedChildGroup(java.lang.String applicationName,
                                       java.lang.String groupName,
                                       java.lang.String childGroupName,
                                       java.net.URI baseUri)
Retrieves the group that is a nested child of the specified group.

Parameters:
applicationName - name of the application
groupName - name of the group
childGroupName - name of the child group
baseUri - base URI
Returns:
group that is a nested child of the specified group


Copyright © 2010 Atlassian. All Rights Reserved.