org.jboss.security.jacc
Class JBossPolicyConfiguration

java.lang.Object
  extended byorg.jboss.security.jacc.JBossPolicyConfiguration
All Implemented Interfaces:
PolicyConfiguration (src)

public class JBossPolicyConfiguration
extends java.lang.Object
implements PolicyConfiguration (src)

The JACC PolicyConfiguration implementation. This class associates a context id with the permission ops it passes along to the global DelegatingPolicy instance.


Constructor Summary
protected JBossPolicyConfiguration(java.lang.String contextID, DelegatingPolicy (src)  policy, StateMachine (src)  configStateMachine)
           
 
Method Summary
 void addToExcludedPolicy(java.security.Permission permission)
          Adds a single excluded permission to the PolicyConfiguration.
 void addToExcludedPolicy(java.security.PermissionCollection permissions)
          Adds a collection of excluded permissions to the PolicyConfiguration
 void addToRole(java.lang.String roleName, java.security.Permission permission)
          Add a single permission to a named role in the PolicyConfiguration.
 void addToRole(java.lang.String roleName, java.security.PermissionCollection permissions)
          Add permissions to a named role in the PolicyConfiguration.
 void addToUncheckedPolicy(java.security.Permission permission)
          Add a single unchecked permission to the PolicyConfiguration.
 void addToUncheckedPolicy(java.security.PermissionCollection permissions)
          Add unchecked permissions to the PolicyConfiguration.
 void commit()
          This method is used to set to "inService" the state of the policy context whose interface is this PolicyConfiguration Object.
 void delete()
          Causes all policy statements to be deleted from this PolicyConfiguration and sets its internal state such that calling any method, other than delete, getContextID, or inService on the PolicyConfiguration will be rejected and cause an UnsupportedOperationException to be thrown.
 java.lang.String getContextID()
          This method returns this object's policy context identifier.
 boolean inService()
          This method is used to determine if the policy context whose interface is this PolicyConfiguration Object is in the "inService" state.
 void linkConfiguration(PolicyConfiguration (src)  link)
          Creates a relationship between this configuration and another such that they share the same principal-to-role mappings.
 void removeExcludedPolicy()
          Used to remove any excluded policy statements from this PolicyConfiguration
 void removeRole(java.lang.String roleName)
          Used to remove a role and all its permissions from this PolicyConfiguration.
 void removeUncheckedPolicy()
          Used to remove any unchecked policy statements from this PolicyConfiguration.
protected  void validateState(java.lang.String action)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JBossPolicyConfiguration

protected JBossPolicyConfiguration(java.lang.String contextID,
                                   DelegatingPolicy (src)  policy,
                                   StateMachine (src)  configStateMachine)
                            throws PolicyContextException (src) 
Method Detail

addToExcludedPolicy

public void addToExcludedPolicy(java.security.Permission permission)
                         throws PolicyContextException (src) 
Description copied from interface: PolicyConfiguration (src)
Adds a single excluded permission to the PolicyConfiguration.

Specified by:
addToExcludedPolicy in interface PolicyConfiguration (src)
Parameters:
permission -
Throws:
PolicyContextException (src)

addToExcludedPolicy

public void addToExcludedPolicy(java.security.PermissionCollection permissions)
                         throws PolicyContextException (src) 
Description copied from interface: PolicyConfiguration (src)
Adds a collection of excluded permissions to the PolicyConfiguration

Specified by:
addToExcludedPolicy in interface PolicyConfiguration (src)
Parameters:
permissions -
Throws:
PolicyContextException (src)

addToRole

public void addToRole(java.lang.String roleName,
                      java.security.Permission permission)
               throws PolicyContextException (src) 
Description copied from interface: PolicyConfiguration (src)
Add a single permission to a named role in the PolicyConfiguration. If the named Role does not exist in the PolicyConfiguration, it is created as a result of the call to this function.

Specified by:
addToRole in interface PolicyConfiguration (src)
Parameters:
roleName -
permission -
Throws:
PolicyContextException (src)

addToRole

public void addToRole(java.lang.String roleName,
                      java.security.PermissionCollection permissions)
               throws PolicyContextException (src) 
Description copied from interface: PolicyConfiguration (src)
Add permissions to a named role in the PolicyConfiguration. If the named Role does not exist in the PolicyConfiguration, it is created as a result of the call to this function.

Specified by:
addToRole in interface PolicyConfiguration (src)
Parameters:
roleName -
permissions -
Throws:
PolicyContextException (src)

addToUncheckedPolicy

public void addToUncheckedPolicy(java.security.Permission permission)
                          throws PolicyContextException (src) 
Description copied from interface: PolicyConfiguration (src)
Add a single unchecked permission to the PolicyConfiguration.

Specified by:
addToUncheckedPolicy in interface PolicyConfiguration (src)
Parameters:
permission -
Throws:
PolicyContextException (src)

addToUncheckedPolicy

public void addToUncheckedPolicy(java.security.PermissionCollection permissions)
                          throws PolicyContextException (src) 
Description copied from interface: PolicyConfiguration (src)
Add unchecked permissions to the PolicyConfiguration.

Specified by:
addToUncheckedPolicy in interface PolicyConfiguration (src)
Parameters:
permissions -
Throws:
PolicyContextException (src)

commit

public void commit()
            throws PolicyContextException (src) 
Description copied from interface: PolicyConfiguration (src)
This method is used to set to "inService" the state of the policy context whose interface is this PolicyConfiguration Object. Only those policy contexts whose state is "inService" will be included in the policy contexts processed by the Policy.refresh method. A policy context whose state is "inService" may be returned to the "open" state by calling the getPolicyConfiguration method of the PolicyConfiguration factory with the policy context identifier of the policy context. When the state of a policy context is "inService", calling any method other than commit, delete, getContextID, or inService on its PolicyConfiguration Object will cause an UnsupportedOperationException to be thrown.

Specified by:
commit in interface PolicyConfiguration (src)
Throws:
PolicyContextException (src) - - if the implementation throws a checked exception that has not been accounted for by the commit method signature.

delete

public void delete()
            throws PolicyContextException (src) 
Description copied from interface: PolicyConfiguration (src)
Causes all policy statements to be deleted from this PolicyConfiguration and sets its internal state such that calling any method, other than delete, getContextID, or inService on the PolicyConfiguration will be rejected and cause an UnsupportedOperationException to be thrown. This operation has no affect on any linked PolicyConfigurations other than removing any links involving the deleted PolicyConfiguration.

Specified by:
delete in interface PolicyConfiguration (src)
Throws:
PolicyContextException (src)

getContextID

public java.lang.String getContextID()
                              throws PolicyContextException (src) 
Description copied from interface: PolicyConfiguration (src)
This method returns this object's policy context identifier.

Specified by:
getContextID in interface PolicyConfiguration (src)
Returns:
this object's policy context identifier.
Throws:
PolicyContextException (src)

inService

public boolean inService()
                  throws PolicyContextException (src) 
Description copied from interface: PolicyConfiguration (src)
This method is used to determine if the policy context whose interface is this PolicyConfiguration Object is in the "inService" state.

Specified by:
inService in interface PolicyConfiguration (src)
Returns:
true if the state of the associated policy context is "inService", false otherwise.
Throws:
PolicyContextException (src)

linkConfiguration

public void linkConfiguration(PolicyConfiguration (src)  link)
                       throws PolicyContextException (src) 
Description copied from interface: PolicyConfiguration (src)
Creates a relationship between this configuration and another such that they share the same principal-to-role mappings. PolicyConfigurations are linked to apply a common principal-to-role mapping to multiple seperately manageable PolicyConfigurations, as is required when an application is composed of multiple modules.

Specified by:
linkConfiguration in interface PolicyConfiguration (src)
Parameters:
link - - a reference to a different PolicyConfiguration than this PolicyConfiguration. The relationship formed by this method is symetric, transitive and idempotent. If the argument PolicyConfiguration does not have a different Policy context identifier than this PolicyConfiguration no relationship is formed, and an IllegalArgumentException is thrown.
Throws:
PolicyContextException (src)

removeExcludedPolicy

public void removeExcludedPolicy()
                          throws PolicyContextException (src) 
Description copied from interface: PolicyConfiguration (src)
Used to remove any excluded policy statements from this PolicyConfiguration

Specified by:
removeExcludedPolicy in interface PolicyConfiguration (src)
Throws:
PolicyContextException (src)

removeRole

public void removeRole(java.lang.String roleName)
                throws PolicyContextException (src) 
Description copied from interface: PolicyConfiguration (src)
Used to remove a role and all its permissions from this PolicyConfiguration.

Specified by:
removeRole in interface PolicyConfiguration (src)
Parameters:
roleName - - the name of the Role to remove from this PolicyConfiguration.
Throws:
PolicyContextException (src)

removeUncheckedPolicy

public void removeUncheckedPolicy()
                           throws PolicyContextException (src) 
Description copied from interface: PolicyConfiguration (src)
Used to remove any unchecked policy statements from this PolicyConfiguration.

Specified by:
removeUncheckedPolicy in interface PolicyConfiguration (src)
Throws:
PolicyContextException (src)

validateState

protected void validateState(java.lang.String action)
                      throws PolicyContextException (src) 
Throws:
PolicyContextException (src)