com.ibm.wsspi.security.policy
Class AbstractPolicies
- java.lang.Object
com.ibm.wsspi.security.policy.AbstractPolicies
- public abstract class AbstractPolicies
- extends java.lang.Object
- implements WSPolicy
isComplete()
to implement the appropriate
semantics for the policy domain of concern, e.g. role-based access control, rule-based authorization, etc.
Field Summary
Modifier and Type | Field and Description |
---|---|
|
adapterCache
|
Constructor Summary
Constructor and Description |
---|
AbstractPolicies()
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
add(WSPolicy policy)
|
|
getExtensionAdapter(java.lang.Class clz)
|
|
isComplete()
Default implementation returns true if
isComplete() in all
nested WSPolicy instances of this WSPolicy return true.
|
|
iterator()
|
|
remove(WSPolicy policy)
Removes the given WSPolicy from the list of immediate child WSPolicy
instances.
|
|
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail
adapterCache
- protected java.util.Map<java.lang.Class,java.lang.Object> adapterCache
Constructor Detail
AbstractPolicies
- public AbstractPolicies()
Method Detail
add
- public void add(WSPolicy policy)
policy
- to be added to this WSPolicy instance. getExtensionAdapter
- public java.lang.Object getExtensionAdapter( java.lang.Class clz)
Extensible
getExtensionAdapter
in interface Extensible
clz
- the adapter class to be found. isComplete
- public boolean isComplete()
isComplete()
in all
nested WSPolicy instances of this WSPolicy return true.
Subclasses should override this operation to provide appropriate semantics as required. A WSPolicy is generally considered to be complete when all metadata necessary to evaluate or process the policy has been collected. The metadata is collected from annotations or XML documents. For example, if a SCDL document for a component contains "RunAs" and "PermitAll" definitions, it is not necessary to retrieve the corresponding language annotations from the component implementation class or any of the methods because SCDL definitions override language annotations. In this case, the WSPolicy instance is logically complete, regardless of whether or not all the child WSPolicy instances are complete or not.
isComplete
in interface WSPolicy
isComplete()
in all contained WSPolicy instances returns true. iterator
- public java.util.Iterator<WSPolicy> iterator( )
iterator
in interface java.lang.Iterable<WSPolicy>
remove
- public void remove(WSPolicy policy)
Default implementation removes only the immediate child policy instances
found in the policies
member List. If it is desirable to
remove all nested policy instances, subclasses can override this method,
and iterate thru all child policies and remove all policies found using
the iterator.remove() method, as illustrated below.
Iterator<WSPolicy> iter = this.iterator(); while (iter.hasNext()) { WSPolicy child = iter.next(); if (child.equals(policy)) { iter.remove(); } }
policy
- to be removed from this WSPolicy instance. toString
- public java.lang.String toString( )
toString
in class java.lang.Object
WSPolicy