public class GroupsResource extends AbstractResource
request, uriInfo
Constructor and Description |
---|
GroupsResource(GroupsController groupsController,
MembershipsController membershipsController) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
addDirectChildGroupMembership(String groupName,
GroupEntity childGroup)
Adds a direct child group membership.
|
javax.ws.rs.core.Response |
addDirectParentGroupMembership(String groupName,
GroupEntity parentGroup)
Adds a direct parent group membership.
|
javax.ws.rs.core.Response |
addGroup(GroupEntity restGroup)
Adds a new group.
|
javax.ws.rs.core.Response |
addUserAsDirectGroupMember(String groupName,
UserEntity user)
Adds a user as a direct member of the specified group.
|
javax.ws.rs.core.Response |
deleteGroupAttribute(String groupname,
String attributeName)
Deletes a group attribute.
|
javax.ws.rs.core.Response |
getAllMemberships(javax.ws.rs.core.Request request)
Retrieves full details of all group memberships, with users and nested groups.
|
javax.ws.rs.core.Response |
getDirectChildrenOfGroup(String groupName,
String childGroupName,
int startIndex,
int maxResults)
Retrieves the groups that are direct children of the specified group or a single direct child of that group with the specified name.
|
javax.ws.rs.core.Response |
getDirectMembersOfGroup(String groupName,
String username,
int startIndex,
int maxResults)
Retrieves the users that are direct members of the specified group or a specified user who is a direct member of that group.
|
javax.ws.rs.core.Response |
getDirectParentsOfGroup(String groupName,
String childGroupName,
int startIndex,
int maxResults)
Retrieves the groups that are direct parents of the specified group or a direct parent group of the specified child group.
|
javax.ws.rs.core.Response |
getGroup(String groupName)
Retrieves a group.
|
javax.ws.rs.core.Response |
getGroupAttributes(String groupName)
Retrieves a list of group attributes.
|
javax.ws.rs.core.Response |
getNestedChildrenOfGroup(String groupName,
String childGroupName,
int startIndex,
int maxResults)
Retrieves nested children of the specified group or a single nested child of that group with the specified name.
|
javax.ws.rs.core.Response |
getNestedMembersOfGroup(String groupName,
String username,
int startIndex,
int maxResults)
Retrieves the users that are nested members of the specified group or a single user who is a nested member of the specified group.
|
javax.ws.rs.core.Response |
getNestedParentGroups(String groupName,
String parentGroupName,
int startIndex,
int maxResults)
Retrieves the groups that are nested parents of the specified group or a single nested parent of that group with the specified name.
|
javax.ws.rs.core.Response |
removeDirectChildGroupMembership(String groupName,
String childGroupName)
Deletes a child group membership.
|
javax.ws.rs.core.Response |
removeDirectGroupMembership(String groupName,
String username)
Removes the user membership.
|
javax.ws.rs.core.Response |
removeGroup(String groupname)
Deletes a group.
|
javax.ws.rs.core.Response |
storeGroupAttributes(String groupname,
MultiValuedAttributeEntityList attributes)
Stores the group attributes.
|
javax.ws.rs.core.Response |
updateGroup(String groupName,
GroupEntity restGroup)
Updates an existing group.
|
getApplicationName, getBaseUri, setApplicationName, setRequest, setUriInfo
public GroupsResource(GroupsController groupsController, MembershipsController membershipsController)
public javax.ws.rs.core.Response getGroup(String groupName) throws GroupNotFoundException, OperationFailedException
groupName
- Name of the group to retrieve.GroupNotFoundException
OperationFailedException
public javax.ws.rs.core.Response addGroup(GroupEntity restGroup) throws GroupNotFoundException, InvalidGroupException, ApplicationPermissionException, OperationFailedException
restGroup
- the group to create.GroupNotFoundException
InvalidGroupException
ApplicationPermissionException
OperationFailedException
public javax.ws.rs.core.Response updateGroup(String groupName, GroupEntity restGroup) throws GroupNotFoundException, InvalidGroupException, ApplicationPermissionException, OperationFailedException
groupName
- the name of the group to update.restGroup
- the update data.GroupNotFoundException
InvalidGroupException
ApplicationPermissionException
OperationFailedException
public javax.ws.rs.core.Response removeGroup(String groupname) throws GroupNotFoundException, ApplicationPermissionException, OperationFailedException
groupname
- Name of the group to delete.GroupNotFoundException
ApplicationPermissionException
OperationFailedException
public javax.ws.rs.core.Response getGroupAttributes(String groupName) throws GroupNotFoundException, OperationFailedException
groupName
- Name of the group to fetch attributes from.GroupNotFoundException
OperationFailedException
public javax.ws.rs.core.Response storeGroupAttributes(String groupname, MultiValuedAttributeEntityList attributes) throws GroupNotFoundException, ApplicationPermissionException, OperationFailedException
groupname
- name of the group.attributes
- the attributes to store.GroupNotFoundException
ApplicationPermissionException
OperationFailedException
public javax.ws.rs.core.Response deleteGroupAttribute(String groupname, String attributeName) throws GroupNotFoundException, ApplicationPermissionException, OperationFailedException
groupname
- name of the group.attributeName
- name of the attribute to delete.GroupNotFoundException
ApplicationPermissionException
OperationFailedException
public javax.ws.rs.core.Response getDirectMembersOfGroup(String groupName, String username, int startIndex, int maxResults) throws MembershipNotFoundException, OperationFailedException, GroupNotFoundException
groupName
- name of the group.username
- if specified it will return a single user if the user is a direct member of the specified group.startIndex
- start index if using paged queries, only applicable when username
is not provided.maxResults
- maximum amount of results to return, only applicable when username
is not provided.MembershipNotFoundException
OperationFailedException
GroupNotFoundException
public javax.ws.rs.core.Response addUserAsDirectGroupMember(String groupName, UserEntity user) throws GroupNotFoundException, OperationFailedException, ApplicationPermissionException, MembershipAlreadyExistsException
groupName
- name of the group to which the user will be added.user
- the user to add to the group.GroupNotFoundException
OperationFailedException
ApplicationPermissionException
MembershipAlreadyExistsException
public javax.ws.rs.core.Response removeDirectGroupMembership(String groupName, String username) throws GroupNotFoundException, MembershipNotFoundException, UserNotFoundException, OperationFailedException, ApplicationPermissionException
groupName
- name of the group from which the user membership will be removed.username
- name the user to have their membership removed.GroupNotFoundException
MembershipNotFoundException
UserNotFoundException
OperationFailedException
ApplicationPermissionException
public javax.ws.rs.core.Response getNestedMembersOfGroup(String groupName, String username, int startIndex, int maxResults) throws MembershipNotFoundException, OperationFailedException, GroupNotFoundException
groupName
- name of the group.username
- if specified it will return a single user if the user is a nested member of the specified group.startIndex
- start index if using paged queries, only applicable when username
is not provided.maxResults
- maximum amount of results to return, only applicable when username
is not provided.MembershipNotFoundException
OperationFailedException
GroupNotFoundException
public javax.ws.rs.core.Response getDirectParentsOfGroup(String groupName, String childGroupName, int startIndex, int maxResults) throws MembershipNotFoundException, OperationFailedException
groupName
- if child-groupname
is specified then the direct parents of this group will be returned. Otherwise this is the direct parent group.childGroupName
- if specified this will return a single direct parent group of this group with the name groupname
.startIndex
- start index if using paged queries, only applicable when child-groupname
is not provided.maxResults
- maximum amount of results to return, only applicable when child-groupname
is not provided.MembershipNotFoundException
OperationFailedException
public javax.ws.rs.core.Response addDirectParentGroupMembership(String groupName, GroupEntity parentGroup) throws InvalidMembershipException, OperationFailedException, ApplicationPermissionException, MembershipAlreadyExistsException
groupName
- name of the child group.parentGroup
- the parent group.InvalidMembershipException
OperationFailedException
ApplicationPermissionException
MembershipAlreadyExistsException
public javax.ws.rs.core.Response getNestedParentGroups(String groupName, String parentGroupName, int startIndex, int maxResults) throws MembershipNotFoundException, OperationFailedException
groupName
- name of the group of which the nested parents will be returned.parentGroupName
- if specified then the single nested parent group with this name of the group specified by groupname
will be returned.startIndex
- start index if using paged queries, only applicable when parent-groupname
is not provided.maxResults
- maximum amount of results to return, only applicable when parent-groupname
is not provided.MembershipNotFoundException
OperationFailedException
public javax.ws.rs.core.Response getDirectChildrenOfGroup(String groupName, String childGroupName, int startIndex, int maxResults) throws MembershipNotFoundException, OperationFailedException
groupName
- Name of the parent group which will have its children fetched.childGroupName
- If specified then only the direct child group with this name will be returned.startIndex
- start index if using paged queries, only applicable when child-groupname
is not provided.maxResults
- maximum amount of results to return, only applicable when child-groupname
is not provided.MembershipNotFoundException
OperationFailedException
public javax.ws.rs.core.Response addDirectChildGroupMembership(String groupName, GroupEntity childGroup) throws InvalidMembershipException, ApplicationPermissionException, OperationFailedException, MembershipAlreadyExistsException
groupName
- Name of the parent group to which the direct child group will be added.childGroup
- The child group.InvalidMembershipException
ApplicationPermissionException
OperationFailedException
MembershipAlreadyExistsException
public javax.ws.rs.core.Response removeDirectChildGroupMembership(String groupName, String childGroupName) throws MembershipNotFoundException, GroupNotFoundException, ApplicationPermissionException, OperationFailedException
groupName
- Name of the parent group.childGroupName
- Name of the child group.MembershipNotFoundException
GroupNotFoundException
ApplicationPermissionException
OperationFailedException
public javax.ws.rs.core.Response getNestedChildrenOfGroup(String groupName, String childGroupName, int startIndex, int maxResults) throws MembershipNotFoundException, OperationFailedException
groupName
- Name of the parent group which will have its nested children fetched.childGroupName
- If provided then only a single nested child group with this name will be fetched from the group specified by groupname
.startIndex
- start index if using paged queries, only applicable when child-groupname
is not provided.maxResults
- maximum amount of results to return, only applicable when child-groupname
is not provided.MembershipNotFoundException
OperationFailedException
public javax.ws.rs.core.Response getAllMemberships(@Context javax.ws.rs.core.Request request) throws GroupNotFoundException, NoSuchAlgorithmException
Copyright © 2020 Atlassian. All rights reserved.