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.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Class,java.lang.Object> |
adapterCache |
Constructor and Description |
---|
AbstractPolicies() |
Modifier and Type | Method and Description |
---|---|
void |
add(WSPolicy policy)
Adds the given policy to this WSPolicy instance.
|
java.lang.Object |
getExtensionAdapter(java.lang.Class clz)
Returns an object that is an instance of the given class/interface or null if no such extension adapter
is available.
|
boolean |
isComplete()
Default implementation returns true if
isComplete() in all
nested WSPolicy instances of this WSPolicy return true. |
java.util.Iterator<WSPolicy> |
iterator() |
void |
remove(WSPolicy policy)
Removes the given WSPolicy from the list of immediate child WSPolicy
instances.
|
java.lang.String |
toString() |
public void add(WSPolicy policy)
WSPolicy
public java.lang.Object getExtensionAdapter(java.lang.Class clz)
Extensible
getExtensionAdapter
in interface Extensible
clz
- the adapter class to be found.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.public java.util.Iterator<WSPolicy> iterator()
iterator
in interface java.lang.Iterable<WSPolicy>
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(); } }
public java.lang.String toString()
toString
in class java.lang.Object