org.jboss.security.authorization.modules
Class AbstractAuthorizationModule

java.lang.Object
  extended by org.jboss.security.authorization.modules.AbstractAuthorizationModule
All Implemented Interfaces:
org.jboss.security.authorization.AuthorizationModule
Direct Known Subclasses:
AllDenyAuthorizationModule, AllPermitAuthorizationModule, DelegatingAuthorizationModule, JACCAuthorizationModule, WebAuthorizationModule, XACMLAuthorizationModule

public abstract class AbstractAuthorizationModule
extends Object
implements org.jboss.security.authorization.AuthorizationModule

Abstraction of Authorization Module

Since:
Jun 14, 2006
Version:
$Revision: 86122 $
Author:
Anil Saldhana

Field Summary
protected  Map<org.jboss.security.authorization.ResourceType,String> delegateMap
          Map of delegates for the various layers
protected  CallbackHandler handler
           
protected  org.jboss.logging.Logger log
           
protected  Map<String,Object> options
           
protected  org.jboss.security.identity.RoleGroup role
           
protected  Map<String,Object> sharedState
           
protected  Subject subject
           
 
Constructor Summary
AbstractAuthorizationModule()
           
 
Method Summary
 boolean abort()
           
abstract  int authorize(org.jboss.security.authorization.Resource resource)
           
 boolean commit()
           
 boolean destroy()
           
protected  AuthorizationModuleDelegate getDelegate(String delegateStr)
          Load the delegate
 void initialize(Subject subject, CallbackHandler handler, Map<String,Object> sharedState, Map<String,Object> options, org.jboss.security.identity.RoleGroup subjectRole)
           
protected  int invokeDelegate(org.jboss.security.authorization.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

subject

protected Subject subject

handler

protected CallbackHandler handler

sharedState

protected Map<String,Object> sharedState

options

protected Map<String,Object> options

role

protected org.jboss.security.identity.RoleGroup role

log

protected org.jboss.logging.Logger log

delegateMap

protected Map<org.jboss.security.authorization.ResourceType,String> delegateMap
Map of delegates for the various layers

Constructor Detail

AbstractAuthorizationModule

public AbstractAuthorizationModule()
Method Detail

authorize

public abstract int authorize(org.jboss.security.authorization.Resource resource)
Specified by:
authorize in interface org.jboss.security.authorization.AuthorizationModule
See Also:
AuthorizationModule.authorize(Resource)

abort

public boolean abort()
              throws org.jboss.security.authorization.AuthorizationException
Specified by:
abort in interface org.jboss.security.authorization.AuthorizationModule
Throws:
org.jboss.security.authorization.AuthorizationException
See Also:
AuthorizationModule.abort()

commit

public boolean commit()
               throws org.jboss.security.authorization.AuthorizationException
Specified by:
commit in interface org.jboss.security.authorization.AuthorizationModule
Throws:
org.jboss.security.authorization.AuthorizationException
See Also:
AuthorizationModule.commit()

destroy

public boolean destroy()
Specified by:
destroy in interface org.jboss.security.authorization.AuthorizationModule
See Also:
AuthorizationModule.destroy()

initialize

public void initialize(Subject subject,
                       CallbackHandler handler,
                       Map<String,Object> sharedState,
                       Map<String,Object> options,
                       org.jboss.security.identity.RoleGroup subjectRole)
Specified by:
initialize in interface org.jboss.security.authorization.AuthorizationModule
See Also:
AuthorizationModule#initialize(Subject, CallbackHandler, Map, Map, Role)

toString

public String toString()
Override to print more details

Overrides:
toString in class Object

invokeDelegate

protected int invokeDelegate(org.jboss.security.authorization.Resource resource)
Subclasses can use this method to leave the authorization decision to the delegate configured


getDelegate

protected AuthorizationModuleDelegate getDelegate(String delegateStr)
                                           throws Exception
Load the delegate

Parameters:
delegateStr - FQN of the delegate
Returns:
Delegate Instance
Throws:
Exception

populateDelegateMap

protected void populateDelegateMap(String commaSeparatedDelegates)
Options may have a comma separated delegate map

Parameters:
commaSeparatedDelegates -


Copyright © 2009 JBoss Inc.. All Rights Reserved.