public class FileRoleManager extends Object implements RoleManager
RoleManager responsible for managing roles stored in a file. The file is
read on construction and written to on the call to #close().| Constructor and Description |
|---|
FileRoleManager(FileServiceAccessor fileServiceAccessor,
boolean isReadOnly) |
| Modifier and Type | Method and Description |
|---|---|
void |
createRole(RoleDetails roleDetails)
Create a new role with the specified
roleDetails. |
void |
deleteRole(String role)
Delete an existing role represented by the specified
role. |
RoleDetails |
getRole(String role)
Retrieve the role details by
role. |
boolean |
isReadOnly()
Indicates that this manager is for read-only purposes, and that any invocation of a
destructive operation will throw an
AccessDeniedException. |
Map<String,RoleDetails> |
mapRoles()
Returns a map containing mapping between role and role-details.
|
boolean |
roleExists(String role)
Queries for presence of a role by role.
|
void |
updateRole(RoleDetails roleDetails)
Updates the role details, excluding the role which must remain the same.
|
public FileRoleManager(FileServiceAccessor fileServiceAccessor, boolean isReadOnly)
public boolean isReadOnly()
RoleManagerAccessDeniedException.isReadOnly in interface RoleManagertrue if read-only access is allowed.public void createRole(RoleDetails roleDetails) throws RoleAlreadyExistsException, RoleDataAccessException, AccessDeniedException
RoleManagerroleDetails.createRole in interface RoleManagerroleDetails - new role details to store.RoleAlreadyExistsException - if the role details represent a non-unique roleRoleDataAccessException - if could not store the specified role details.AccessDeniedException - if read-only access is allowed.public void deleteRole(String role) throws RoleNotFoundException, RoleDataAccessException, AccessDeniedException
RoleManagerrole.deleteRole in interface RoleManagerrole - an existing role name.RoleNotFoundException - if the role was not found.RoleDataAccessException - if could not delete the specified role details.AccessDeniedException - if read-only access is allowed.public RoleDetails getRole(String role) throws RoleNotFoundException, RoleDataAccessException
RoleManagerrole.getRole in interface RoleManagerrole - an existing role to retrieve.RoleNotFoundException - if the role was not found.RoleDataAccessException - if could not retrieve the specified role details.public Map<String,RoleDetails> mapRoles() throws RoleDataAccessException
RoleManagermapRoles in interface RoleManagerRoleDataAccessException - if could not retrieve role-details to map.public boolean roleExists(String role) throws RoleDataAccessException
RoleManagerroleExists in interface RoleManagerrole - the role to check existence for.true if the role exists; false otherwise.RoleDataAccessException - if could not query for the specified role.public void updateRole(RoleDetails roleDetails) throws RoleNotFoundException, RoleDataAccessException, AccessDeniedException
RoleManagerupdateRole in interface RoleManagerroleDetails - the role details to update.RoleNotFoundException - if the role was not found.RoleDataAccessException - if could not update the role details.AccessDeniedException - if read-only access is allowed.Copyright © GigaSpaces.