public class JBossPolicyConfiguration extends Object implements PolicyConfiguration
Modifier | Constructor and Description |
---|---|
protected |
JBossPolicyConfiguration(String contextID,
DelegatingPolicy policy,
StateMachine configStateMachine) |
Modifier and Type | Method and Description |
---|---|
void |
addToExcludedPolicy(Permission permission)
Used to add a single excluded policy statement to this PolicyConfiguration.
|
void |
addToExcludedPolicy(PermissionCollection permissions)
Used to add excluded policy statements to this PolicyConfiguration.
|
void |
addToRole(String roleName,
Permission permission)
Used to add a single permission to a named role in this PolicyConfiguration.
|
void |
addToRole(String roleName,
PermissionCollection permissions)
Used to add permissions to a named role in this PolicyConfiguration.
|
void |
addToUncheckedPolicy(Permission permission)
Used to add a single unchecked policy statement to this PolicyConfiguration.
|
void |
addToUncheckedPolicy(PermissionCollection permissions)
Used to add unchecked policy statements to this 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.
|
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 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(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(String action) |
protected JBossPolicyConfiguration(String contextID, DelegatingPolicy policy, StateMachine configStateMachine) throws PolicyContextException
PolicyContextException
public void addToExcludedPolicy(Permission permission) throws PolicyContextException
PolicyConfiguration
Used to add a single excluded policy statement to this PolicyConfiguration.
addToExcludedPolicy
in interface PolicyConfiguration
permission
- - the permission to be added to the excluded policy statements.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(PermissionCollection permissions) throws PolicyContextException
PolicyConfiguration
Used to add excluded policy statements to this PolicyConfiguration.
addToExcludedPolicy
in interface PolicyConfiguration
permissions
- - the collection of permissions to be added to the excluded policy statements. The collection may be
either a homogeneous or heterogeneous collection.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 addToRole(String roleName, Permission permission) throws PolicyContextException
PolicyConfiguration
Used to add a single permission to a named role in this PolicyConfiguration. If the named role does not exist in the PolicyConfiguration, it is created as a result of the call to this function.
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 PolicyConfiguration
roleName
- - the name of the Role to which the permission is to be added.permission
- - the permission to be added to the role.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(String roleName, PermissionCollection permissions) throws PolicyContextException
PolicyConfiguration
Used to add permissions to a named role in this PolicyConfiguration. If the named role does not exist in the PolicyConfiguration, it is created as a result of the call to this function.
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 PolicyConfiguration
roleName
- - 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 homogeneous or
heterogeneous collection.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(Permission permission) throws PolicyContextException
PolicyConfiguration
Used to add a single unchecked policy statement to this PolicyConfiguration.
addToUncheckedPolicy
in interface PolicyConfiguration
permission
- - the permission to be added to the unchecked policy statements.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(PermissionCollection permissions) throws PolicyContextException
PolicyConfiguration
Used to add unchecked policy statements to this PolicyConfiguration.
addToUncheckedPolicy
in interface PolicyConfiguration
permissions
- - the collection of permissions to be added as unchecked policy statements. The collection may be either
a homogeneous or heterogeneous collection.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 commit() throws PolicyContextException
PolicyConfiguration
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.
commit
in interface PolicyConfiguration
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 void delete() throws PolicyContextException
PolicyConfiguration
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.
delete
in interface PolicyConfiguration
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 String getContextID() throws PolicyContextException
PolicyConfiguration
This method returns this object’s policy context identifier.
getContextID
in interface PolicyConfiguration
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 boolean inService() throws PolicyContextException
PolicyConfiguration
This method is used to determine if the policy context whose interface is this PolicyConfiguration Object is in the "inService" state.
inService
in interface PolicyConfiguration
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.public void linkConfiguration(PolicyConfiguration link) throws PolicyContextException
PolicyConfiguration
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 separately manageable PolicyConfigurations, as is required when an application is composed of multiple modules.
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 PolicyConfiguration
link
- - a reference to a different PolicyConfiguration than this PolicyConfiguration. The relationship formed
by this method is symmetric, 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.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 removeExcludedPolicy() throws PolicyContextException
PolicyConfiguration
Used to remove any excluded policy statements from this PolicyConfiguration. This method has no effect on the links between this PolicyConfiguration and others.
removeExcludedPolicy
in interface PolicyConfiguration
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 removeRole(String roleName) throws PolicyContextException
PolicyConfiguration
Used to remove a role and all its permissions from this PolicyConfiguration. This method has no effect on the links between this PolicyConfiguration and others.
removeRole
in interface PolicyConfiguration
roleName
- - the name of the role to remove from this PolicyConfiguration. If the value of the roleName parameter
is “*” and no role with name “*” exists in this PolicyConfiguration, then all roles must be removed from
this PolicyConfiguration.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
PolicyConfiguration
Used to remove any unchecked policy statements from this PolicyConfiguration. This method has no effect on the links between this PolicyConfiguration and others.
removeUncheckedPolicy
in interface PolicyConfiguration
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.protected void validateState(String action) throws PolicyContextException
PolicyContextException
Copyright © 2017 JBoss by Red Hat. All rights reserved.