|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.enterprise.security.jacc.provider.SimplePolicyConfiguration
public class SimplePolicyConfiguration
| Field Summary | |
|---|---|
static int |
DELETED_STATE
|
static int |
INSERVICE_STATE
|
static int |
OPEN_STATE
|
| Constructor Summary | |
|---|---|
protected |
SimplePolicyConfiguration(java.lang.String contextID)
Creates a new instance of SimplePolicyConfiguration |
| Method Summary | |
|---|---|
void |
addToExcludedPolicy(java.security.Permission permission)
Used to add a single excluded policy statement to this PolicyConfiguration. |
void |
addToExcludedPolicy(java.security.PermissionCollection permissions)
Used to add excluded policy statements to this PolicyConfiguration. |
void |
addToRole(java.lang.String roleName,
java.security.Permission permission)
Used to add a single permission to a named role in this PolicyConfiguration. |
void |
addToRole(java.lang.String roleName,
java.security.PermissionCollection permissions)
Used to add permissions to a named role in this PolicyConfiguration. |
void |
addToUncheckedPolicy(java.security.Permission permission)
Used to add a single unchecked policy statement to this PolicyConfiguration. |
void |
addToUncheckedPolicy(java.security.PermissionCollection permissions)
Used to add unchecked policy statements to this PolicyConfiguration. |
protected static void |
checkSetPolicyPermission()
|
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. |
static java.security.PermissionCollection |
getPermissions(java.security.PermissionCollection basePerms,
java.security.CodeSource codesource)
Evaluates the global policy and returns a PermissionCollection object specifying the set of permissions allowed for code from the specified code source. |
static java.security.PermissionCollection |
getPermissions(java.security.PermissionCollection basePerms,
java.security.ProtectionDomain domain)
Evaluates the policy and returns a PermissionCollection object specifying the set of permissions allowed given the characteristics of the protection domain. |
protected static SimplePolicyConfiguration |
getPolicyConfig(java.lang.String pcid,
boolean remove)
|
static int |
implies(java.security.ProtectionDomain domain,
java.security.Permission p)
Evaluates the policy to determine whether the permissions is granted to the ProtectionDomain. |
boolean |
inService()
This method is used to determine if the policy context whose interface is this PolicyConfiguration Object is in the "inService" state. |
protected static boolean |
inService(java.lang.String pcid)
|
void |
linkConfiguration(PolicyConfiguration 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int OPEN_STATE
public static final int INSERVICE_STATE
public static final int DELETED_STATE
| Constructor Detail |
|---|
protected SimplePolicyConfiguration(java.lang.String contextID)
| Method Detail |
|---|
public java.lang.String getContextID()
throws PolicyContextException
getContextID in interface PolicyConfigurationjava.lang.SecurityException - if called by an AccessControlContext that has not been
granted the "setPolicy" SecurityPermission.
PolicyContextException - if the implementation throws a checked exception that has not been
accounted for by the getContextID method signature. The exception thrown
by the implementation class will be encapsulated (during construction)
in the thrown PolicyContextException.
public void addToRole(java.lang.String roleName,
java.security.PermissionCollection permissions)
throws PolicyContextException
It is the job of the Policy provider to ensure that all the permissions added to a role are granted to principals "mapped to the role".
addToRole in interface PolicyConfigurationroleName - the name of the Role to which the permissions are
to be added.
permissions - the collection of permissions to be added
to the role. The collection may be either a homogenous or
heterogenous collection.
java.lang.SecurityException - if called by an AccessControlContext that has not been
granted the "setPolicy" SecurityPermission.
java.lang.UnsupportedOperationException - if the state of the policy context whose interface is this
PolicyConfiguration Object is "deleted" or "inService" when this
method is called.
PolicyContextException - if the implementation throws a checked exception that has not been
accounted for by the addToRole method signature. The exception thrown
by the implementation class will be encapsulated (during construction)
in the thrown PolicyContextException.
public void addToRole(java.lang.String roleName,
java.security.Permission permission)
throws PolicyContextException
It is the job of the Policy provider to ensure that all the permissions added to a role are granted to principals "mapped to the role".
addToRole in interface PolicyConfigurationroleName - the name of the Role to which the permission is
to be added.
permission - the permission to be added
to the role.
java.lang.SecurityException - if called by an AccessControlContext that has not been
granted the "setPolicy" SecurityPermission.
java.lang.UnsupportedOperationException - if the state of the policy context whose interface is this
PolicyConfiguration Object is "deleted" or "inService" when this
method is called.
PolicyContextException - if the implementation throws a checked exception that has not been
accounted for by the addToRole method signature. The exception thrown
by the implementation class will be encapsulated (during construction)
in the thrown PolicyContextException.
public void addToUncheckedPolicy(java.security.PermissionCollection permissions)
throws PolicyContextException
addToUncheckedPolicy in interface PolicyConfigurationpermissions - the collection of permissions to be added
as unchecked policy statements. The collection may be either
a homogenous or heterogenous collection.
java.lang.SecurityException - if called by an AccessControlContext that has not been
granted the "setPolicy" SecurityPermission.
java.lang.UnsupportedOperationException - if the state of the policy context whose interface is this
PolicyConfiguration Object is "deleted" or "inService" when this
method is called.
PolicyContextException - if the implementation throws a checked exception that has not been
accounted for by the addToUncheckedPolicy method signature.
The exception thrown
by the implementation class will be encapsulated (during construction)
in the thrown PolicyContextException.
public void addToUncheckedPolicy(java.security.Permission permission)
throws PolicyContextException
addToUncheckedPolicy in interface PolicyConfigurationpermission - the permission to be added
to the unchecked policy statements.
java.lang.SecurityException - if called by an AccessControlContext that has not been
granted the "setPolicy" SecurityPermission.
java.lang.UnsupportedOperationException - if the state of the policy context whose interface is this
PolicyConfiguration Object is "deleted" or "inService" when this
method is called.
PolicyContextException - if the implementation throws a checked exception that has not been
accounted for by the addToUncheckedPolicy method signature.
The exception thrown
by the implementation class will be encapsulated (during construction)
in the thrown PolicyContextException.
public void addToExcludedPolicy(java.security.PermissionCollection permissions)
throws PolicyContextException
addToExcludedPolicy in interface PolicyConfigurationpermissions - the collection of permissions to be added
to the excluded policy statements. The collection may be either
a homogenous or heterogenous collection.
java.lang.SecurityException - if called by an AccessControlContext that has not been
granted the "setPolicy" SecurityPermission.
java.lang.UnsupportedOperationException - if the state of the policy context whose interface is this
PolicyConfiguration Object is "deleted" or "inService" when this
method is called.
PolicyContextException - if the implementation throws a checked exception that has not been
accounted for by the addToExcludedPolicy method signature.
The exception thrown
by the implementation class will be encapsulated (during construction)
in the thrown PolicyContextException.
public void addToExcludedPolicy(java.security.Permission permission)
throws PolicyContextException
addToExcludedPolicy in interface PolicyConfigurationpermission - the permission to be added
to the excluded policy statements.
java.lang.SecurityException - if called by an AccessControlContext that has not been
granted the "setPolicy" SecurityPermission.
java.lang.UnsupportedOperationException - if the state of the policy context whose interface is this
PolicyConfiguration Object is "deleted" or "inService" when this
method is called.
PolicyContextException - if the implementation throws a checked exception that has not been
accounted for by the addToExcludedPolicy method signature.
The exception thrown
by the implementation class will be encapsulated (during construction)
in the thrown PolicyContextException.
public void removeRole(java.lang.String roleName)
throws PolicyContextException
removeRole in interface PolicyConfigurationroleName - the name of the Role to remove from this
PolicyConfiguration.
java.lang.SecurityException - if called by an AccessControlContext that has not been
granted the "setPolicy" SecurityPermission.
java.lang.UnsupportedOperationException - if the state of the policy context whose interface is this
PolicyConfiguration Object is "deleted" or "inService" when this
method is called.
PolicyContextException - if the implementation throws a checked exception that has not been
accounted for by the removeRole method signature. The exception thrown
by the implementation class will be encapsulated (during construction)
in the thrown PolicyContextException.
public void removeUncheckedPolicy()
throws PolicyContextException
removeUncheckedPolicy in interface PolicyConfigurationjava.lang.SecurityException - if called by an AccessControlContext that has not been
granted the "setPolicy" SecurityPermission.
java.lang.UnsupportedOperationException - if the state of the policy context whose interface is this
PolicyConfiguration Object is "deleted" or "inService" when this
method is called.
PolicyContextException - if the implementation throws a checked exception that has not been
accounted for by the removeUncheckedPolicy method signature.
The exception thrown
by the implementation class will be encapsulated (during construction)
in the thrown PolicyContextException.
public void removeExcludedPolicy()
throws PolicyContextException
removeExcludedPolicy in interface PolicyConfigurationjava.lang.SecurityException - if called by an AccessControlContext that has not been
granted the "setPolicy" SecurityPermission.
java.lang.UnsupportedOperationException - if the state of the policy context whose interface is this
PolicyConfiguration Object is "deleted" or "inService" when this
method is called.
PolicyContextException - if the implementation throws a checked exception that has not been
accounted for by the removeExcludedPolicy method signature.
The exception thrown
by the implementation class will be encapsulated (during construction)
in the thrown PolicyContextException.
public void linkConfiguration(PolicyConfiguration link)
throws PolicyContextException
Note that the policy statements which comprise a role, or comprise the excluded or unchecked policy collections in a PolicyConfiguration are unaffected by the configuration being linked to another.
linkConfiguration in interface PolicyConfigurationlink - 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 exception, as described below, is thrown.
java.lang.SecurityException - if called by an AccessControlContext that has not been
granted the "setPolicy" SecurityPermission.
java.lang.UnsupportedOperationException - if the state of the policy context whose interface is this
PolicyConfiguration Object is "deleted" or "inService" when this
method is called.
java.lang.IllegalArgumentException - if called with an argument PolicyConfiguration whose Policy context
is equivalent to that of this PolicyConfiguration.
PolicyContextException - if the implementation throws a checked exception that has not been
accounted for by the linkConfiguration method signature. The exception
thrown
by the implementation class will be encapsulated (during construction)
in the thrown PolicyContextException.
public void delete()
throws PolicyContextException
This operation has no affect on any linked PolicyConfigurations other than removing any links involving the deleted PolicyConfiguration.
delete in interface PolicyConfigurationjava.lang.SecurityException - if called by an AccessControlContext that has not been
granted the "setPolicy" SecurityPermission.
PolicyContextException - if the implementation throws a checked exception that has not been
accounted for by the delete method signature. The exception thrown
by the implementation class will be encapsulated (during construction)
in the thrown PolicyContextException.
public void commit()
throws PolicyContextException
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.
commit in interface PolicyConfigurationjava.lang.SecurityException - if called by an AccessControlContext that has not been
granted the "setPolicy" SecurityPermission.
java.lang.UnsupportedOperationException - if the state of the policy context whose interface is this
PolicyConfiguration Object is "deleted" when this
method is called.
PolicyContextException - if the implementation throws a checked exception that has not been
accounted for by the commit method signature. The exception thrown
by the implementation class will be encapsulated (during construction)
in the thrown PolicyContextException.
public boolean inService()
throws PolicyContextException
inService in interface PolicyConfigurationjava.lang.SecurityException - if called by an AccessControlContext that has not been
granted the "setPolicy" SecurityPermission.
PolicyContextException - if the implementation throws a checked exception that has not been
accounted for by the inService method signature. The exception thrown
by the implementation class will be encapsulated (during construction)
in the thrown PolicyContextException.
protected static SimplePolicyConfiguration getPolicyConfig(java.lang.String pcid,
boolean remove)
throws PolicyContextException
PolicyContextException
protected static boolean inService(java.lang.String pcid)
throws PolicyContextException
PolicyContextExceptionprotected static void checkSetPolicyPermission()
public static java.security.PermissionCollection getPermissions(java.security.PermissionCollection basePerms,
java.security.CodeSource codesource)
throws PolicyContextException
codeSource - the CodeSource associated with the caller.
This encapsulates the original location of the code (where the code
came from) and the public key(s) of its signer.
PolicyContextException
public static java.security.PermissionCollection getPermissions(java.security.PermissionCollection basePerms,
java.security.ProtectionDomain domain)
throws PolicyContextException
domain - the ProtectionDomain associated with the caller.
PolicyContextExceptionProtectionDomain,
SecureClassLoader
public static int implies(java.security.ProtectionDomain domain,
java.security.Permission p)
throws PolicyContextException
domain - the ProtectionDomain to testpermission - the Permission object to be tested for implication.
PolicyContextException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||