Package org.infinispan.security.mappers
Class ClusterPermissionMapper
- java.lang.Object
-
- org.infinispan.security.mappers.ClusterPermissionMapper
-
- All Implemented Interfaces:
MutableRolePermissionMapper
,RolePermissionMapper
public class ClusterPermissionMapper extends Object implements MutableRolePermissionMapper
ClusterPermissionMapper. This class implements both aMutableRolePermissionMapper
storing the mappings in a persistent replicated internal cache named org.infinispan.PERMISSIONS- Since:
- 14.0
- Author:
- Tristan Tarrant
-
-
Constructor Summary
Constructors Constructor Description ClusterPermissionMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletionStage<Void>
addRole(Role role)
Adds a new roleMap<String,Role>
getAllRoles()
Role
getRole(String name)
boolean
hasRole(String name)
CompletionStage<Boolean>
removeRole(String name)
Removes a rolevoid
setContext(AuthorizationMapperContext context)
Sets the context for thisRolePermissionMapper
-
-
-
Method Detail
-
setContext
public void setContext(AuthorizationMapperContext context)
Description copied from interface:RolePermissionMapper
Sets the context for thisRolePermissionMapper
- Specified by:
setContext
in interfaceRolePermissionMapper
-
addRole
public CompletionStage<Void> addRole(Role role)
Description copied from interface:MutableRolePermissionMapper
Adds a new role- Specified by:
addRole
in interfaceMutableRolePermissionMapper
- Parameters:
role
- the role
-
removeRole
public CompletionStage<Boolean> removeRole(String name)
Description copied from interface:MutableRolePermissionMapper
Removes a role- Specified by:
removeRole
in interfaceMutableRolePermissionMapper
- Parameters:
name
- the name of the role to be removed- Returns:
- true if a role with the supplied name was found and removed
-
getAllRoles
public Map<String,Role> getAllRoles()
- Specified by:
getAllRoles
in interfaceRolePermissionMapper
- Returns:
- all roles handled by this RolePermissionMapper
-
getRole
public Role getRole(String name)
- Specified by:
getRole
in interfaceRolePermissionMapper
- Parameters:
name
- the name of the role- Returns:
- the
Role
-
hasRole
public boolean hasRole(String name)
- Specified by:
hasRole
in interfaceRolePermissionMapper
- Returns:
- whether this permission mapper contains the named role
-
-