public abstract class AbstractAuthorizationModule extends Object implements AuthorizationModule
| Modifier and Type | Field and Description |
|---|---|
protected static Map<String,Class<?>> |
clazzMap
A map that is available to reduce the loadClass synchronization
|
protected Map<ResourceType,String> |
delegateMap
Map of delegates for the various layers
|
protected CallbackHandler |
handler |
protected Map<String,Object> |
options |
protected RoleGroup |
role |
protected Map<String,Object> |
sharedState |
protected Subject |
subject |
| Constructor and Description |
|---|
AbstractAuthorizationModule() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
abort()
Abort the Authorization Process
|
abstract int |
authorize(Resource resource)
Authorize the resource
|
boolean |
commit()
Overall authorization process has succeeded.
|
boolean |
destroy()
A final cleanup opportunity offered
|
protected AuthorizationModuleDelegate |
getDelegate(String delegateStr)
Load the delegate
|
void |
initialize(Subject subject,
CallbackHandler handler,
Map<String,Object> sharedState,
Map<String,Object> options,
RoleGroup subjectRole)
Initialize the module
|
protected int |
invokeDelegate(Resource resource)
Subclasses can use this method to leave the authorization
decision to the delegate configured
|
protected void |
populateDelegateMap(String commaSeparatedDelegates)
Options may have a comma separated delegate map
|
String |
toString()
Override to print more details
|
protected Subject subject
protected CallbackHandler handler
protected RoleGroup role
protected Map<ResourceType,String> delegateMap
public abstract int authorize(Resource resource)
AuthorizationModuleauthorize in interface AuthorizationModuleAuthorizationModule.authorize(Resource)public boolean abort()
throws AuthorizationException
AuthorizationModuleabort in interface AuthorizationModuleAuthorizationExceptionAuthorizationModule.abort()public boolean commit()
throws AuthorizationException
AuthorizationModulecommit in interface AuthorizationModuleAuthorizationExceptionAuthorizationModule.commit()public boolean destroy()
AuthorizationModuledestroy in interface AuthorizationModuleAuthorizationModule.destroy()public void initialize(Subject subject, CallbackHandler handler, Map<String,Object> sharedState, Map<String,Object> options, RoleGroup subjectRole)
AuthorizationModuleinitialize in interface AuthorizationModulesubject - the authenticated subjecthandler - CallbackHandlersharedState - state shared with other configured modulesoptions - options specified in the Configuration
for this particular modulesubjectRole - Roles of the subjectAuthorizationModule.initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map, org.jboss.security.identity.RoleGroup)public String toString()
protected int invokeDelegate(Resource resource)
protected AuthorizationModuleDelegate getDelegate(String delegateStr) throws Exception
delegateStr - FQN of the delegateExceptionprotected void populateDelegateMap(String commaSeparatedDelegates)
commaSeparatedDelegates - Copyright © 2018 JBoss by Red Hat. All rights reserved.