Package com.gigaspaces.security.fs
Class FileRoleManager
java.lang.Object
com.gigaspaces.security.fs.FileRoleManager
- All Implemented Interfaces:
RoleManager
A file based
RoleManager responsible for managing roles stored in a file. The file is
read on construction and written to on the call to #close().- Since:
- 7.0.1
- Author:
- Moran Avigdor
-
Constructor Summary
ConstructorsConstructorDescriptionFileRoleManager(FileServiceAccessor fileServiceAccessor, boolean isReadOnly) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateRole(RoleDetails roleDetails) Create a new role with the specifiedroleDetails.voiddeleteRole(String role) Delete an existing role represented by the specifiedrole.Retrieve the role details byrole.booleanIndicates that this manager is for read-only purposes, and that any invocation of a destructive operation will throw anAccessDeniedException.mapRoles()Returns a map containing mapping between role and role-details.booleanroleExists(String role) Queries for presence of a role by role.voidupdateRole(RoleDetails roleDetails) Updates the role details, excluding the role which must remain the same.
-
Constructor Details
-
FileRoleManager
-
-
Method Details
-
isReadOnly
public boolean isReadOnly()Description copied from interface:RoleManagerIndicates that this manager is for read-only purposes, and that any invocation of a destructive operation will throw anAccessDeniedException.- Specified by:
isReadOnlyin interfaceRoleManager- Returns:
trueif read-only access is allowed.
-
createRole
public void createRole(RoleDetails roleDetails) throws RoleAlreadyExistsException, RoleDataAccessException, AccessDeniedException Description copied from interface:RoleManagerCreate a new role with the specifiedroleDetails.- Specified by:
createRolein interfaceRoleManager- Parameters:
roleDetails- new role details to store.- Throws:
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.
-
deleteRole
public void deleteRole(String role) throws RoleNotFoundException, RoleDataAccessException, AccessDeniedException Description copied from interface:RoleManagerDelete an existing role represented by the specifiedrole.- Specified by:
deleteRolein interfaceRoleManager- Parameters:
role- an existing role name.- Throws:
RoleNotFoundException- if the role was not found.RoleDataAccessException- if could not delete the specified role details.AccessDeniedException- if read-only access is allowed.
-
getRole
Description copied from interface:RoleManagerRetrieve the role details byrole.- Specified by:
getRolein interfaceRoleManager- Parameters:
role- an existing role to retrieve.- Returns:
- the role details of the specified role.
- Throws:
RoleNotFoundException- if the role was not found.RoleDataAccessException- if could not retrieve the specified role details.
-
mapRoles
Description copied from interface:RoleManagerReturns a map containing mapping between role and role-details.- Specified by:
mapRolesin interfaceRoleManager- Returns:
- a mapping between role name and role-details.
- Throws:
RoleDataAccessException- if could not retrieve role-details to map.
-
roleExists
Description copied from interface:RoleManagerQueries for presence of a role by role.- Specified by:
roleExistsin interfaceRoleManager- Parameters:
role- the role to check existence for.- Returns:
trueif the role exists;falseotherwise.- Throws:
RoleDataAccessException- if could not query for the specified role.
-
updateRole
public void updateRole(RoleDetails roleDetails) throws RoleNotFoundException, RoleDataAccessException, AccessDeniedException Description copied from interface:RoleManagerUpdates the role details, excluding the role which must remain the same. In order to update a role, a role must be removed and re-created.- Specified by:
updateRolein interfaceRoleManager- Parameters:
roleDetails- the role details to update.- Throws:
RoleNotFoundException- if the role was not found.RoleDataAccessException- if could not update the role details.AccessDeniedException- if read-only access is allowed.
-