com.rathravane.clerk.access.AccessManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clerk Show documentation
Show all versions of clerk Show documentation
A framework for user identification, authentication, and access control.
package com.rathravane.clerk.access;
import java.util.Set;
import com.rathravane.clerk.exceptions.IamGroupExists;
import com.rathravane.clerk.exceptions.IamIdentityDoesNotExist;
import com.rathravane.clerk.exceptions.IamSvcException;
import com.rathravane.clerk.identity.Group;
public interface AccessManager extends AccessDb
{
/**
* Create a group
* @param groupDesc
* @return a new group with the given name
* @throws IamSvcException
*/
G createGroup ( String groupDesc ) throws IamSvcException;
/**
* Create a group with a given group ID
* @param groupId
* @param groupDesc
* @return
* @throws IamSvcException
*/
G createGroup ( String groupId, String groupDesc ) throws IamGroupExists, IamSvcException;
/**
* Add a user to a given group
* @param groupId
* @param userId
* @throws IamSvcException
* @throws IamIdentityDoesNotExist
*/
void addUserToGroup ( String groupId, String userId ) throws IamSvcException, IamIdentityDoesNotExist;
/**
* Remove a user from a given group
* @param groupId
* @param userId
* @throws IamSvcException
* @throws IamIdentityDoesNotExist
*/
void removeUserFromGroup ( String groupId, String userId ) throws IamSvcException, IamIdentityDoesNotExist;
/**
* Find out which groups a user is a member of.
* @param userId
* @return a set of 0 or more group IDs
* @throws IamSvcException
* @throws IamIdentityDoesNotExist
*/
Set getUsersGroups ( String userId ) throws IamSvcException, IamIdentityDoesNotExist;
}