Package io.continual.iam.access
Interface AccessManager<G extends Group>
-
-
Field Summary
-
Fields inherited from interface io.continual.iam.access.AccessDb
kCreateOperation, kDeleteOperation, kReadOperation, kWriteOperation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddUserToGroup(String groupId, String userId)Add a user to a given groupGcreateGroup(String groupDesc)Create a groupGcreateGroup(String groupId, String groupDesc)Create a group with a given group IDCollection<String>getAllGroups()Get all group IDs in this db.Set<String>getUsersGroups(String userId)Find out which groups a user is a member of.Set<String>getUsersInGroup(String groupId)Get the set of user IDs in a particular group.voidremoveUserFromGroup(String groupId, String userId)Remove a user from a given group
-
-
-
Method Detail
-
createGroup
G createGroup(String groupDesc) throws IamGroupExists, IamSvcException
Create a group- Parameters:
groupDesc- the group description- Returns:
- a new group with the given description
- Throws:
IamGroupExists- if the group already existsIamSvcException- when the call cannot be completed due to a service error
-
createGroup
G createGroup(String groupId, String groupDesc) throws IamGroupExists, IamSvcException
Create a group with a given group ID- Parameters:
groupId- a group IDgroupDesc- a group description- Returns:
- a new group with the given id and description
- Throws:
IamGroupExists- if the group already existsIamSvcException- when the call cannot be completed due to a service error
-
addUserToGroup
void addUserToGroup(String groupId, String userId) throws IamSvcException, IamIdentityDoesNotExist, IamGroupDoesNotExist
Add a user to a given group- Parameters:
groupId- a group IDuserId- a user ID- Throws:
IamSvcException- when the call cannot be completed due to a service errorIamIdentityDoesNotExist- when the identity doesn't existIamGroupDoesNotExist- if the group does not exist
-
removeUserFromGroup
void removeUserFromGroup(String groupId, String userId) throws IamSvcException, IamIdentityDoesNotExist, IamGroupDoesNotExist
Remove a user from a given group- Parameters:
groupId- a group IDuserId- a user ID- Throws:
IamSvcException- when the call cannot be completed due to a service errorIamIdentityDoesNotExist- when the identity doesn't existIamGroupDoesNotExist- if the group does not exist
-
getUsersGroups
Set<String> getUsersGroups(String userId) throws IamSvcException, IamIdentityDoesNotExist
Find out which groups a user is a member of.- Parameters:
userId- a user ID- Returns:
- a set of 0 or more group IDs
- Throws:
IamSvcException- when the call cannot be completed due to a service errorIamIdentityDoesNotExist- when the identity doesn't exist
-
getUsersInGroup
Set<String> getUsersInGroup(String groupId) throws IamSvcException, IamGroupDoesNotExist
Get the set of user IDs in a particular group.- Parameters:
groupId- a group ID- Returns:
- a set of 0 or more user IDs
- Throws:
IamSvcException- when the call cannot be completed due to a service errorIamGroupDoesNotExist- when the identity doesn't exist
-
getAllGroups
Collection<String> getAllGroups() throws IamSvcException
Get all group IDs in this db. Clearly not suitable for systems beyond a few thousand groups. For larger scale, this call may throw an IamSvcException signaling that the underlying database won't return a group list.- Returns:
- a collection of group Ids
- Throws:
IamSvcException- when the call cannot be completed due to a service error
-
-