Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Web Services Manager
11g (11.1.1)

E10689-01


oracle.wsm.policy.model.impl
Class PolicyReference

java.lang.Object
  extended by oracle.wsm.policy.model.impl.PolicyReference

All Implemented Interfaces:
Serializable, IAssertionAdvertiser, IAssertion, IPolicyReference

public class PolicyReference
extends Object
implements IPolicyReference

PolicyReference class has implicit reference to a external policy. It acts as wrapper to external policies in the standard policy framework.

See Also:
Serialized Form

Nested Class Summary

 

Nested classes/interfaces inherited from interface oracle.wsm.policy.model.IPolicyReference
IPolicyReference.STATUS

 

Nested classes/interfaces inherited from interface oracle.wsm.policy.model.IAssertion
IAssertion.AssertionTypes

 

Field Summary

 

Fields inherited from interface oracle.wsm.policy.model.IPolicyReference
DISABLED, ENABLED, statusAttrQName

 

Constructor Summary
PolicyReference(QName policyRefQName)
           
PolicyReference(QName policyRefQName, String policyURIString)
           
PolicyReference(QName policyRefQName, String policyURIString, long version)
           
PolicyReference(String policyURIString)
           
PolicyReference(String policyURIString, long version)
           

 

Method Summary
 void addAttribute(QName qname, String value)
           
 void advertiseOracleWSPolicy(AdvertisementContext context)
          Generate advertizable Oracle WS Policy with Oracle extensions
 void advertiseWSPolicy(AdvertisementContext context)
          Generate interoperable WS-Policy with no Oracle Extensions.
 IAssertion createInstance(QName qname)
          Creates the appropriate assertion instance NOTE: The base implementation must be overriden by the subclasses!
 boolean equals(Object obj)
          Compares the Assertionlist of two policies .It ignores the order of the Assertions.
 int getAssertionType()
          Returns the type of the assertion.
 String getAttribute(QName qname)
           
 Map<QName,String> getAttributes()
           
 String getCategory()
          Return the category of the PolicyReference.
 String getDigest()
          Create a unique string representation that identifies this policy uniquely independent of the order of the assertions to enable a fast path intersection with another policy
 String getDigest(List<String> namespaces, List<QName> qnames, boolean inclusionOrExclusionCriteria)
          Create a unique string representation that identifies this policy uniquely independent of the order of the assertions to enable a fast path intersection with another policy.
 Set<IOverrideProperty> getOverrideProperties()
          Return the set of override properties that apply for this policy reference.
 IAssertion getParent()
          Returns the parent of self or null if a parent non-exists
 String getPolicyURI()
           
 long getPolicyVersion()
           
 QName getQName()
           
 IPolicyReference.STATUS getStatus()
          Return the status of the PolicyReference - it is enabled by default
 String getStringForMatching()
          The String to be used in the matching algorithim (used for intersection, merge, etc).
 int hashCode()
          Returns an integer value which is uniquely identifies an object of this class.
 boolean hasParent()
          Returns ture if the assertion has a parent
 IAssertion intersect(IAssertion assertion, IIntersectionContext context)
          Returns an assertion which is the equivalent of intersect of self and argument.
 IAssertion intersect(IAssertion assertion, IPolicyRegistry reg, IIntersectionContext context)
          Returns an assertion which is equivalent of intersect of self and argument.
 boolean isIdentical(Object obj)
          It is same as equals method except it emphasizes on the order, while equlas doesn't.
 boolean isLocalReference()
          If the URI starts with "#" then it is a local or intra document link!
 boolean isNormalized()
          Returns true if the Assertion has been normalized.
 boolean isOptional()
          Returns true if the Assertion is optional.
 IAssertion merge(IAssertion assertion)
          Returns the equivalent of merge of self and argument.
 IAssertion merge(IAssertion assertion, IPolicyRegistry reg)
          Returns the equivalent of merge of self and argument.
 IAssertion normalize()
          Normalizes the assertion and returns the normalized Assertion
 IAssertion normalize(IPolicyRegistry reg)
           
 void removeAttribute(QName qname)
           
protected  void setAttribute(QName idAttr, String attrValue)
           
 void setAttributes(Map<QName,String> attributes)
           
 void setCategory(String category)
          Set the category of the PolicyReference.
 void setNormalized(boolean flag)
          WARNING: Do not call this method.
 void setOptional(boolean isOptional)
          Specifies if the Assertion is optional.
 void setOverrideProperties(Set<IOverrideProperty> overrideProps)
          Set the set of override properties for the Policy Reference.
 void setParent(IAssertion parent)
          Set the parent to argument
 void setStatus(IPolicyReference.STATUS status)
          Set the status of the PolicyReference - it is enabled by default
 String toString()
          Returns the assertion list of a policy as a string
 void validate(IValidationContext context)
          Validate this assertion If any errors are found, they are added to the passed Validation Context object

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Constructor Detail

PolicyReference

public PolicyReference(String policyURIString)

PolicyReference

public PolicyReference(String policyURIString,
                       long version)

PolicyReference

public PolicyReference(QName policyRefQName)

PolicyReference

public PolicyReference(QName policyRefQName,
                       String policyURIString)

PolicyReference

public PolicyReference(QName policyRefQName,
                       String policyURIString,
                       long version)

Method Detail

getPolicyURI

public String getPolicyURI()
Specified by:
getPolicyURI in interface IPolicyReference

normalize

public IAssertion normalize()
Description copied from interface: IAssertion
Normalizes the assertion and returns the normalized Assertion
Specified by:
normalize in interface IAssertion
Returns:

normalize

public IAssertion normalize(IPolicyRegistry reg)
Specified by:
normalize in interface IAssertion
Returns:

intersect

public IAssertion intersect(IAssertion assertion,
                            IIntersectionContext context)
Description copied from interface: IAssertion
Returns an assertion which is the equivalent of intersect of self and argument. The rules to construct the equivalent assertion are specified in WS Policy 1.0 specification.
Specified by:
intersect in interface IAssertion
Parameters:
assertion - the assertion to intersect with
context - - The intersection context is passed to capture the running context of the intersection and to accumulate intersection failures
Returns:
the equivalent of intersect of self and the argument

intersect

public IAssertion intersect(IAssertion assertion,
                            IPolicyRegistry reg,
                            IIntersectionContext context)
                     throws UnsupportedOperationException
Description copied from interface: IAssertion
Returns an assertion which is equivalent of intersect of self and argument. Here the external policy are resolved via a policy registry that is supplied as an argument.
Specified by:
intersect in interface IAssertion
Parameters:
assertion - the assertion to intersect with
context - - The intersection context is passed to capture the running context of the intersection and to accumulate intersection failures
Returns:
the equivalent of intersection of self and argument
Throws:
UnsupportedOperationException - if the operation is not meaningful

merge

public IAssertion merge(IAssertion assertion,
                        IPolicyRegistry reg)
                 throws UnsupportedOperationException
Description copied from interface: IAssertion
Returns the equivalent of merge of self and argument. The rules to construct argument are specified in WS Policy specification 1.0 Here the external policy references are resolved via a policy registry that is supplied as an argument
Specified by:
merge in interface IAssertion
Parameters:
assertion - the assertion to merge with
reg - the policy registry that should be used to resolve external policy references
Returns:
the equivalent of merge of self and argument
Throws:
UnsupportedOperationException - if the merge is not meaningful

merge

public IAssertion merge(IAssertion assertion)
Description copied from interface: IAssertion
Returns the equivalent of merge of self and argument. The rules to construct the equivalent of merge are defined in WS Policy specification.
Specified by:
merge in interface IAssertion
Parameters:
assertion - the argument to merge with
Returns:
the equivalent of the merge of self and argument

isNormalized

public boolean isNormalized()
Description copied from interface: IAssertion
Returns true if the Assertion has been normalized.
Specified by:
isNormalized in interface IAssertion
Returns:

setNormalized

public void setNormalized(boolean flag)
Description copied from interface: IAssertion
WARNING: Do not call this method. Instead call the various normalize() methods - which in turn use this method.
Specified by:
setNormalized in interface IAssertion

getStringForMatching

public String getStringForMatching()
Description copied from interface: IAssertion
The String to be used in the matching algorithim (used for intersection, merge, etc). By default the string representation of QName is returned!
Specified by:
getStringForMatching in interface IAssertion
Returns:

getQName

public QName getQName()
Specified by:
getQName in interface IAssertion

setParent

public void setParent(IAssertion parent)
Description copied from interface: IAssertion
Set the parent to argument
Specified by:
setParent in interface IAssertion
Parameters:
parent - the parent that should be parent of self

getParent

public IAssertion getParent()
Description copied from interface: IAssertion
Returns the parent of self or null if a parent non-exists
Specified by:
getParent in interface IAssertion
Returns:
the parent of self

hasParent

public boolean hasParent()
Description copied from interface: IAssertion
Returns ture if the assertion has a parent
Specified by:
hasParent in interface IAssertion
Returns:
true if a parent exists , false otherwise

setAttributes

public void setAttributes(Map<QName,String> attributes)
Specified by:
setAttributes in interface IAssertion

getAttributes

public Map<QName,String> getAttributes()
Specified by:
getAttributes in interface IAssertion

addAttribute

public void addAttribute(QName qname,
                         String value)
Specified by:
addAttribute in interface IAssertion

getAttribute

public String getAttribute(QName qname)
Specified by:
getAttribute in interface IAssertion

removeAttribute

public void removeAttribute(QName qname)
Specified by:
removeAttribute in interface IAssertion

getAssertionType

public int getAssertionType()
Description copied from interface: IAssertion
Returns the type of the assertion.
Specified by:
getAssertionType in interface IAssertion

isOptional

public boolean isOptional()
Description copied from interface: IAssertion
Returns true if the Assertion is optional.
Specified by:
isOptional in interface IAssertion

setOptional

public void setOptional(boolean isOptional)
Description copied from interface: IAssertion
Specifies if the Assertion is optional. Maps to the wsp:Optional attribute defined in WS-Policy.
Specified by:
setOptional in interface IAssertion

getPolicyVersion

public long getPolicyVersion()
Specified by:
getPolicyVersion in interface IPolicyReference

getStatus

public IPolicyReference.STATUS getStatus()
Description copied from interface: IPolicyReference
Return the status of the PolicyReference - it is enabled by default
Specified by:
getStatus in interface IPolicyReference

setStatus

public void setStatus(IPolicyReference.STATUS status)
Description copied from interface: IPolicyReference
Set the status of the PolicyReference - it is enabled by default
Specified by:
setStatus in interface IPolicyReference

equals

public boolean equals(Object obj)
Compares the Assertionlist of two policies .It ignores the order of the Assertions.
Overrides:
equals in class Object

isIdentical

public boolean isIdentical(Object obj)
It is same as equals method except it emphasizes on the order, while equlas doesn't.
Specified by:
isIdentical in interface IAssertion

toString

public String toString()
Returns the assertion list of a policy as a string
Overrides:
toString in class Object

hashCode

public int hashCode()
Returns an integer value which is uniquely identifies an object of this class.
Overrides:
hashCode in class Object

createInstance

public IAssertion createInstance(QName qname)
Description copied from interface: IAssertion
Creates the appropriate assertion instance NOTE: The base implementation must be overriden by the subclasses!
Specified by:
createInstance in interface IAssertion
Returns:

getCategory

public String getCategory()
Description copied from interface: IPolicyReference
Return the category of the PolicyReference. This maps to the category of the Policy.
Specified by:
getCategory in interface IPolicyReference
Returns:
String

setCategory

public void setCategory(String category)
Description copied from interface: IPolicyReference
Set the category of the PolicyReference. This maps to the category of the Policy.
Specified by:
setCategory in interface IPolicyReference

setAttribute

protected void setAttribute(QName idAttr,
                            String attrValue)

validate

public void validate(IValidationContext context)
Description copied from interface: IAssertion
Validate this assertion If any errors are found, they are added to the passed Validation Context object
Specified by:
validate in interface IAssertion

advertiseWSPolicy

public void advertiseWSPolicy(AdvertisementContext context)
                       throws AdvertisementException
Description copied from interface: IAssertionAdvertiser
Generate interoperable WS-Policy with no Oracle Extensions.
Specified by:
advertiseWSPolicy in interface IAssertionAdvertiser
Parameters:
context -
Throws:
AdvertisementException

advertiseOracleWSPolicy

public void advertiseOracleWSPolicy(AdvertisementContext context)
                             throws AdvertisementException
Description copied from interface: IAssertionAdvertiser
Generate advertizable Oracle WS Policy with Oracle extensions
Specified by:
advertiseOracleWSPolicy in interface IAssertionAdvertiser
Parameters:
context -
Throws:
AdvertisementException

isLocalReference

public boolean isLocalReference()
Description copied from interface: IPolicyReference
If the URI starts with "#" then it is a local or intra document link!
Specified by:
isLocalReference in interface IPolicyReference

getDigest

public String getDigest()
Description copied from interface: IAssertion
Create a unique string representation that identifies this policy uniquely independent of the order of the assertions to enable a fast path intersection with another policy
Specified by:
getDigest in interface IAssertion
Returns:
- String - the digest

getDigest

public String getDigest(List<String> namespaces,
                        List<QName> qnames,
                        boolean inclusionOrExclusionCriteria)
Description copied from interface: IAssertion
Create a unique string representation that identifies this policy uniquely independent of the order of the assertions to enable a fast path intersection with another policy. if inclusionOrExclusionCriteria is true then:
Only assertions that are either in the namespace in the namespace list or the assertion qname mentioned in the qnames list are included in digest calculation. Basically this projects out the assertions belonging to the namespace or qname if namespaces is empty and qnames is empty then it is equivalent to calling getDigest() if inclusionOrExclusionCriteria is false then:
The assertions that are in the namespace list or assertion qname are no included in the digest calculation.
Specified by:
getDigest in interface IAssertion
Parameters:
namespaces - - list of strings that define the namespaces to be include or excluded in digest calculation
qnames - - list of qnames that define the qnames to be included or excluded in digest calculation
inclusionOrExclusionCriteria - - whether the list of namespaces or qnames should be included or excluded in the digest calculation

getOverrideProperties

public Set<IOverrideProperty> getOverrideProperties()
Description copied from interface: IPolicyReference
Return the set of override properties that apply for this policy reference. returns null if there are no override properties
Specified by:
getOverrideProperties in interface IPolicyReference
Returns:
Set<IOverrideProperty>

setOverrideProperties

public void setOverrideProperties(Set<IOverrideProperty> overrideProps)
Description copied from interface: IPolicyReference
Set the set of override properties for the Policy Reference.
Specified by:
setOverrideProperties in interface IPolicyReference

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Web Services Manager
11g (11.1.1)

E10689-01


Copyright © 2007, 2009, Oracle and/or its affiliates. All rights reserved.