public class GroupsController extends AbstractResourceController
applicationManager, applicationService
Constructor and Description |
---|
GroupsController(ApplicationService applicationService,
ApplicationManager applicationManager) |
Modifier and Type | Method and Description |
---|---|
void |
addDirectChildGroup(String applicationName,
String groupName,
String childGroupName)
Adds a direct child group membership.
|
void |
addDirectParentGroup(String applicationName,
String groupName,
String parentGroupName)
Adds a direct parent group membership.
|
void |
addDirectUser(String applicationName,
String groupName,
String username)
Adds user as direct member of group.
|
GroupEntity |
addGroup(String applicationName,
GroupEntity group,
com.atlassian.plugins.rest.common.Link groupLink)
Adds a new group.
|
void |
deleteDirectChildGroup(String applicationName,
String groupName,
String childGroupName)
Deletes a child group membership.
|
void |
deleteDirectUser(String applicationName,
String groupName,
String username)
Removes the user membership.
|
GroupEntity |
findGroupByName(String applicationName,
String name,
boolean expandAttributes,
URI baseURI)
Returns the group specified by the name.
|
GroupEntity |
getDirectChildGroup(String applicationName,
String groupName,
String childGroupName,
URI baseUri)
Retrieves the group that is a direct child of the specified group.
|
GroupEntityList |
getDirectChildGroups(String applicationName,
String groupName,
boolean expandGroups,
int maxResults,
int startIndex,
URI baseUri)
Retrieves the groups that are direct members of the specified group.
|
GroupEntity |
getDirectParentGroup(String applicationName,
String groupName,
String parentGroupName,
URI baseUri)
Retrieves the group that is a direct parent of the specified group.
|
GroupEntityList |
getDirectParentGroups(String applicationName,
String groupName,
boolean expandGroups,
int maxResults,
int startIndex,
URI baseUri)
Retrieves the groups that are direct parents of the specified group.
|
UserEntity |
getDirectUser(String applicationName,
String groupName,
String username,
URI baseUri)
Retrieves the user that is a direct member of the specified group.
|
UserEntityList |
getDirectUsers(String applicationName,
String groupName,
boolean expandUsers,
int maxResults,
int startIndex,
URI baseUri)
Retrieves the users that are direct members of the specified group.
|
GroupEntity |
getNestedChildGroup(String applicationName,
String groupName,
String childGroupName,
URI baseUri)
Retrieves the group that is a nested child of the specified group.
|
GroupEntityList |
getNestedChildGroups(String applicationName,
String groupName,
boolean expandGroups,
int maxResults,
int startIndex,
URI baseUri)
Retrieves the groups that are nested children of the specified group.
|
GroupEntity |
getNestedParentGroup(String applicationName,
String groupName,
String parentGroupName,
URI baseUri)
Retrieves the group that is a nested parent of the specified group.
|
GroupEntityList |
getNestedParentGroups(String applicationName,
String groupName,
boolean expandGroups,
int maxResults,
int startIndex,
URI baseUri)
Retrieves the groups that are nested parents of the specified group.
|
UserEntity |
getNestedUser(String applicationName,
String groupName,
String username,
URI baseUri)
Retrieves the user that is a nested member of the specified group.
|
UserEntityList |
getNestedUsers(String applicationName,
String groupName,
boolean expandUsers,
int maxResults,
int startIndex,
URI baseUri)
Retrieves the users that are nested members of the specified group.
|
void |
removeGroup(String applicationName,
String groupName)
Removes a group.
|
void |
removeGroupAttributes(String applicationName,
String groupName,
String attributeName)
Removes a group's attribute.
|
void |
storeGroupAttributes(String applicationName,
String groupName,
MultiValuedAttributeEntityList attributes)
Stores the attributes for a group.
|
GroupEntity |
updateGroup(String applicationName,
GroupEntity group,
URI baseURI)
Updates a group.
|
getApplication
public GroupsController(ApplicationService applicationService, ApplicationManager applicationManager)
public GroupEntity findGroupByName(String applicationName, String name, boolean expandAttributes, URI baseURI) throws GroupNotFoundException
applicationName
- name of the applicationname
- name of the group to returnexpandAttributes
- should attributes be expandedbaseURI
- base URIGroupNotFoundException
public GroupEntity addGroup(String applicationName, GroupEntity group, com.atlassian.plugins.rest.common.Link groupLink) throws ApplicationPermissionException, OperationFailedException, InvalidGroupException, GroupNotFoundException
applicationName
- name of the applicationgroup
- group to addApplicationPermissionException
- if none of the application's underlying directories are allowed to create
a groupOperationFailedException
- if the operation failed for any other reasonInvalidGroupException
GroupNotFoundException
public GroupEntity updateGroup(String applicationName, GroupEntity group, URI baseURI) throws ApplicationPermissionException, OperationFailedException, InvalidGroupException, GroupNotFoundException
applicationName
- name of the applicationgroup
- group to updatebaseURI
- base URIInvalidGroupException
- 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.public void removeGroup(String applicationName, String groupName) throws ApplicationPermissionException, OperationFailedException, GroupNotFoundException
applicationName
- name of the applicationgroupName
- name of the groupOperationFailedException
- 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
.public void storeGroupAttributes(String applicationName, String groupName, MultiValuedAttributeEntityList attributes) throws ApplicationPermissionException, OperationFailedException, GroupNotFoundException
applicationName
- name of the applicationgroupName
- name of the groupattributes
- attributes to add/updateGroupNotFoundException
- 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_ATTRIBUTE
.public void removeGroupAttributes(String applicationName, String groupName, String attributeName) throws ApplicationPermissionException, OperationFailedException, GroupNotFoundException
applicationName
- name of the applicationgroupName
- name of the groupattributeName
- attribute to removeGroupNotFoundException
- 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_ATTRIBUTE
.public UserEntityList getDirectUsers(String applicationName, String groupName, boolean expandUsers, int maxResults, int startIndex, URI baseUri) throws GroupNotFoundException
applicationName
- name of the applicationgroupName
- name of the groupexpandUsers
- should users be expandedmaxResults
- maximum number of results returned. If -1, then all the results are returned.startIndex
- starting index of the resultsbaseUri
- base URIGroupNotFoundException
public void addDirectUser(String applicationName, String groupName, String username) throws ApplicationPermissionException, UserNotFoundException, GroupNotFoundException, OperationFailedException, MembershipAlreadyExistsException
applicationName
- name of the applicationgroupName
- name of the groupusername
- name of the child groupApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP
.MembershipAlreadyExistsException
- if the user is already a member of the groupUserNotFoundException
GroupNotFoundException
OperationFailedException
public UserEntity getDirectUser(String applicationName, String groupName, String username, URI baseUri) throws MembershipNotFoundException, GroupNotFoundException
applicationName
- name of the applicationgroupName
- name of the groupusername
- name of the child groupbaseUri
- base URIMembershipNotFoundException
GroupNotFoundException
public void deleteDirectUser(String applicationName, String groupName, String username) throws ApplicationPermissionException, MembershipNotFoundException, UserNotFoundException, GroupNotFoundException, OperationFailedException
applicationName
- name of the applicationgroupName
- name of the groupusername
- name of the userApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP
.MembershipNotFoundException
UserNotFoundException
GroupNotFoundException
OperationFailedException
public UserEntityList getNestedUsers(String applicationName, String groupName, boolean expandUsers, int maxResults, int startIndex, URI baseUri) throws GroupNotFoundException
applicationName
- name of the applicationgroupName
- name of the groupexpandUsers
- should groups be expandedmaxResults
- maximum number of results returned. If -1, then all the results are returned.startIndex
- starting index of the resultsbaseUri
- base URIGroupNotFoundException
public UserEntity getNestedUser(String applicationName, String groupName, String username, URI baseUri) throws MembershipNotFoundException, GroupNotFoundException
applicationName
- name of the applicationgroupName
- name of the groupusername
- name of the userbaseUri
- base URIMembershipNotFoundException
GroupNotFoundException
public GroupEntityList getDirectParentGroups(String applicationName, String groupName, boolean expandGroups, int maxResults, int startIndex, URI baseUri)
applicationName
- name of the applicationgroupName
- name of the groupexpandGroups
- should groups be expandedmaxResults
- maximum number of results returned. If -1, then all the results are returned.startIndex
- starting index of the resultsbaseUri
- base URIpublic void addDirectParentGroup(String applicationName, String groupName, String parentGroupName) throws ApplicationPermissionException, InvalidMembershipException, GroupNotFoundException, OperationFailedException, MembershipAlreadyExistsException
applicationName
- name of the applicationgroupName
- name of the groupparentGroupName
- name of the parent groupApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP
.MembershipAlreadyExistsException
- if the child group is already a child of the parent groupInvalidMembershipException
GroupNotFoundException
OperationFailedException
public GroupEntity getDirectParentGroup(String applicationName, String groupName, String parentGroupName, URI baseUri) throws MembershipNotFoundException
applicationName
- name of the applicationgroupName
- name of the groupparentGroupName
- name of the parent groupbaseUri
- base URIMembershipNotFoundException
public GroupEntityList getNestedParentGroups(String applicationName, String groupName, boolean expandGroups, int maxResults, int startIndex, URI baseUri)
applicationName
- name of the applicationgroupName
- name of the groupexpandGroups
- should groups be expandedmaxResults
- maximum number of results returned. If -1, then all the results are returned.startIndex
- starting index of the resultsbaseUri
- base URIpublic GroupEntity getNestedParentGroup(String applicationName, String groupName, String parentGroupName, URI baseUri) throws MembershipNotFoundException
applicationName
- name of the applicationgroupName
- name of the groupparentGroupName
- name of the parent groupbaseUri
- base URIMembershipNotFoundException
public GroupEntityList getDirectChildGroups(String applicationName, String groupName, boolean expandGroups, int maxResults, int startIndex, URI baseUri)
applicationName
- name of the applicationgroupName
- name of the groupexpandGroups
- should groups be expandedmaxResults
- maximum number of results returned. If -1, then all the results are returned.startIndex
- starting index of the resultsbaseUri
- base URIpublic void addDirectChildGroup(String applicationName, String groupName, String childGroupName) throws ApplicationPermissionException, InvalidMembershipException, GroupNotFoundException, OperationFailedException, MembershipAlreadyExistsException
applicationName
- name of the applicationgroupName
- name of the groupchildGroupName
- name of the child groupMembershipAlreadyExistsException
- if the child group is already a child of the parent groupApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP
.InvalidMembershipException
GroupNotFoundException
OperationFailedException
public GroupEntity getDirectChildGroup(String applicationName, String groupName, String childGroupName, URI baseUri) throws MembershipNotFoundException
applicationName
- name of the applicationgroupName
- name of the groupchildGroupName
- name of the child groupbaseUri
- base URIMembershipNotFoundException
public void deleteDirectChildGroup(String applicationName, String groupName, String childGroupName) throws ApplicationPermissionException, MembershipNotFoundException, GroupNotFoundException, OperationFailedException
applicationName
- name of the applicationgroupName
- name of the groupchildGroupName
- name of the child groupApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP
.MembershipNotFoundException
GroupNotFoundException
OperationFailedException
public GroupEntityList getNestedChildGroups(String applicationName, String groupName, boolean expandGroups, int maxResults, int startIndex, URI baseUri)
applicationName
- name of the applicationgroupName
- name of the groupexpandGroups
- should groups be expandedmaxResults
- maximum number of results returned. If -1, then all the results are returned.startIndex
- starting index of the resultsbaseUri
- base URIpublic GroupEntity getNestedChildGroup(String applicationName, String groupName, String childGroupName, URI baseUri) throws MembershipNotFoundException
applicationName
- name of the applicationgroupName
- name of the groupchildGroupName
- name of the child groupbaseUri
- base URIMembershipNotFoundException
Copyright © 2017 Atlassian. All rights reserved.