Package io.continual.iam.access
Interface AccessManager<G extends Group>
- All Superinterfaces:
AccessDb<G>
- All Known Subinterfaces:
IamDb<I,G>
- All Known Implementing Classes:
CommonJsonDb,JsonDocDb,MultiSourceDb
-
Field Summary
Fields inherited from interface io.continual.iam.access.AccessDb
kCreateOperation, kDeleteOperation, kReadOperation, kWriteOperation -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUserToGroup(String groupId, String userId) Add a user to a given groupcreateGroup(String groupDesc) Create a groupcreateGroup(String groupId, String groupDesc) Create a group with a given group IDGet all group IDs in this db.getUsersGroups(String userId) Find out which groups a user is a member of.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 Details
-
createGroup
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
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
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
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
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
-