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 Policy

java.lang.Object
  extended by oracle.wsm.policy.model.impl.SimpleAssertion
      extended by oracle.wsm.policy.model.impl.CompositeAssertion
          extended by oracle.wsm.policy.model.impl.AndCompositeAssertion
              extended by oracle.wsm.policy.model.impl.Policy

All Implemented Interfaces:
Serializable, IAssertionAdvertiser, IAndCompositeAssertion, IAssertion, ICompositeAssertion, IPolicy, ISimpleAssertion, ISimpleOracleAssertion

public class Policy
extends AndCompositeAssertion
implements IPolicy

import oracle.wsm.resources.policyvalidation.PolicyValidationMessageID; Policy is the access point for policy framework. It the object model that represents a policy at runtime.

See Also:
Serialized Form

Nested Class Summary

 

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

 

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

 

Field Summary

 

Fields inherited from interface oracle.wsm.policy.model.IPolicy
DISABLED, displayNameAttrQName, ENABLED, idAttrQName, localOptimizationAttrQName, nameAttrQName, oracleSmartDigestAttrQName, pipelineAttrQName, revPipelineAttrQName, smartDigestAttrQName, validationClassNameAttrQName

 

Fields inherited from interface oracle.wsm.policy.model.ISimpleAssertion
attachToAttrQName, categoryAttrQName, descAttrQName, enforcedAttrQName, NameAttrQName, optionalAttrQName, silentAttrQName, StageAttrQName, statusAttrQName

 

Constructor Summary
Policy()
           
Policy(boolean setExtensions)
           
Policy(QName qname)
           
Policy(QName qname, boolean setExtensions)
           
Policy(String id)
           
Policy(String name, String id)
           
Policy(String name, String id, Map<QName,String> attrMap)
           

 

Method Summary
 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!
 IAssertion createInstance(QName qname, boolean setExtensions)
           
 IPolicyReference createLocalPolicyReference(boolean includeExtensions)
          WS-Policy Attachment defines two types of Policy Referneces.
 IPolicyReference createRemotePolicyReference(boolean includeExtensions)
          WS-Policy Attachment defines two types of Policy Referneces.
 boolean equals(Object obj)
          Compares the Assertionlist of two policies .It ignores the order of the Assertions.
 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.
 String getDisplayName()
          Convenience method to retrive the orawsp:displayName attribute on a <wsp:Policy> element.
 String getDisplayName(Locale locale)
          Convenience method to retrive localized orawsp:displayName attribute on a <wsp:Policy> element.
 String getLocalOptimization()
          Returns the local-optimzation attribute value of the policy
 String getOracleSmartDigest()
          Return the oracle fast path digest for the policy
 String getPolicyId()
          Convenience method to retrive the wsu:Id attribute on a <wsp:Policy> element.
 String getPolicyName()
          Convenience method to retrive the wsp:Name attribute on a <wsp:Policy> element.
 String getSmartDigest()
          Return the smart digest for the policy
 IPolicy.STATUS getStatus()
           
 int getSubjectCount()
          Get a count of subject to which this policy is attached to
 String getValidatorClass()
          Returns the name of validator class set for this Policy object
 List<String> getValidAttachToValues()
           
 IVersionInfo getVersionInfo()
           
 int hashCode()
          Returns an integer value which is uniquely identifies an object of this class.
 boolean hasPolicyAlternatives()
          Returns true if the Policy has alternatives i.e.
 IAssertion intersect(IAssertion assertion, IPolicyRegistry reg, IIntersectionContext context)
          Returns the intersection of self and argument against a specified Policy Registry.
 boolean isEnabled()
          Convenience method returns true if getStatus() returns STATUS.enabled
 boolean isIdentical(Object obj)
          It is same as equals method except it emphasizes on the order, while equlas doesn't.
 boolean isPipeline()
          Convenience method to retrive the orawsp:Pipeline attribute on a <wsp:Policy> element.
 boolean isReferenceablePolicy()
           
 boolean isReversePipeline()
          Convenience method to set the orawsp:ReversePipeline attribute on a <wsp:Policy> element.
 IAssertion merge(IAssertion assertion, IPolicyRegistry reg)
          Returns an assertion which is equivalent to merge of self and the argument.
 IAssertion normalize()
          Normalizes the assertion and returns the normalized Assertion
 IAssertion normalize(IPolicyRegistry reg)
          Returns an IAssertion which is normalized using a specified policy registry.
protected  void removeAttrsForOracleWSPolicyAdvertisement(Map<QName,String> attrs)
           
protected  void removeAttrsForWSPolicyAdvertisement(Map<QName,String> attrs)
           
 void setAttributes(Map<QName,String> attrMap)
           
protected  void setDefaultValues()
           
 void setDisplayName(String displayName)
          Convenience method to set the orawsp:displayName attribute on a <wsp:Policy> element.
 void setLocalOptimzation(String localOptimization)
          Sets the local-optimzation parameter value
 void setOracleSmartDigest(String smartDigest)
          Set the value for the attribute "oraSmartDigest" - it represents the "hash" of the value returned by the getDigest call for Policies containing oracle scenario assertions.
 void setPipeline(boolean isPipeline)
          Set the orawsp:Pipeline attribute
 void setPolicyId(String id)
           
 void setPolicyName(String name)
           
 void setReversePipeline(boolean revPipeline)
          Convenience method to set the orawsp:ReversePipeline attribute on a <wsp:Policy> element.
 void setSmartDigest(String smartDigest)
          Set the value for the attribute "smartDigest" - it represents the "hash" of the value returned by the getDigest call.
 void setStatus(IPolicy.STATUS status)
           
 void setSubjectCount(int subjectCount)
          Set the number of end-points that reference this policy
 void setValidatorClass(String className)
          Sets the class name of the java class to validate this policy
 void setVersionInfo(IVersionInfo versionInfo)
           
 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 oracle.wsm.policy.model.impl.AndCompositeAssertion
addAssertion

 

Methods inherited from class oracle.wsm.policy.model.impl.CompositeAssertion
addAssertion, addAssertions, clearAssertions, getAssertion, getAssertions, getAssertionsArray, getAssertionsByQName, intersect, isEmpty, isOptional, merge, removeAssertion, removeAssertion, removeAssertions, setAssertions, setNormalized, setOptional, size

 

Methods inherited from class oracle.wsm.policy.model.impl.SimpleAssertion
addAttribute, cloneAttrs, getAssertionType, getAttachTo, getAttribute, getAttributes, getBindings, getCategory, getCopyOfAssertion, getDescription, getDescription, getDigest, getDigestForAttrs, getGuard, getName, getParent, getQName, getStringForMatching, getStrValue, getUniquePathToAssertion, getWSPolicy15QName, getWSPolicy2006QName, hasBindings, hasGuard, hasParent, isEnforced, isIncludedInDigestCalculation, isNormalized, isSilent, removeAttribute, removeBindings, removeGuard, setAttachTo, setAttribute, setBindings, setCategory, setDescription, setEnforced, setGuard, setName, setParent, setSilent, setStrValue

 

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

 

Methods inherited from interface oracle.wsm.policy.model.IPolicy
getAttachTo, getCategory, getDescription, getDescription, setAttachTo, setCategory, setDescription

 

Methods inherited from interface oracle.wsm.policy.model.ICompositeAssertion
addAssertion, addAssertion, addAssertions, clearAssertions, getAssertion, getAssertions, getAssertionsArray, getAssertionsByQName, isEmpty, removeAssertion, removeAssertions, setAssertions, size

 

Methods inherited from interface oracle.wsm.policy.model.IAssertion
addAttribute, getAssertionType, getAttribute, getAttributes, getDigest, getParent, getQName, getStringForMatching, hasParent, intersect, isNormalized, isOptional, merge, removeAttribute, setNormalized, setOptional, setParent

 

Constructor Detail

Policy

public Policy()

Policy

public Policy(boolean setExtensions)

Policy

public Policy(QName qname,
              boolean setExtensions)

Policy

public Policy(QName qname)

Policy

public Policy(String id)

Policy

public Policy(String name,
              String id)

Policy

public Policy(String name,
              String id,
              Map<QName,String> attrMap)

Method Detail

setPolicyName

public void setPolicyName(String name)
Specified by:
setPolicyName in interface IPolicy

getPolicyName

public String getPolicyName()
Description copied from interface: IPolicy
Convenience method to retrive the wsp:Name attribute on a <wsp:Policy> element.
This is equivalent to getAttributes().get(nameAttrQName).
Specified by:
getPolicyName in interface IPolicy

setPolicyId

public void setPolicyId(String id)
Specified by:
setPolicyId in interface IPolicy

getPolicyId

public String getPolicyId()
Description copied from interface: IPolicy
Convenience method to retrive the wsu:Id attribute on a <wsp:Policy> element.
This is equivalent to getAttributes().get(idAttrQName).
Specified by:
getPolicyId in interface IPolicy

setReversePipeline

public void setReversePipeline(boolean revPipeline)
Description copied from interface: IPolicy
Convenience method to set the orawsp:ReversePipeline attribute on a <wsp:Policy> element.
Specified by:
setReversePipeline in interface IPolicy

isReversePipeline

public boolean isReversePipeline()
Description copied from interface: IPolicy
Convenience method to set the orawsp:ReversePipeline attribute on a <wsp:Policy> element.
This is equivalent to setAttributes().get(revPipelineAttrQName).
Specified by:
isReversePipeline in interface IPolicy

isReferenceablePolicy

public boolean isReferenceablePolicy()
Specified by:
isReferenceablePolicy in interface IPolicy

normalize

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

normalize

public IAssertion normalize(IPolicyRegistry reg)
Description copied from class: AndCompositeAssertion
Returns an IAssertion which is normalized using a specified policy registry.
Specified by:
normalize in interface IAssertion
Overrides:
normalize in class AndCompositeAssertion
Parameters:
reg - the policy registry used to resolve policy references
Returns:
an IAssertion which is the normalized form of self

intersect

public IAssertion intersect(IAssertion assertion,
                            IPolicyRegistry reg,
                            IIntersectionContext context)
Description copied from class: AndCompositeAssertion
Returns the intersection of self and argument against a specified Policy Registry.
Specified by:
intersect in interface IAssertion
Overrides:
intersect in class AndCompositeAssertion
Parameters:
assertion - the assertion to intersect with self
reg - a sepcified policy registry
context - - The intersection context is passed to capture the running context of the intersection and to accumulate intersection failures
Returns:
assertion the assertion which is equivalent to intersection between self and the argument

merge

public IAssertion merge(IAssertion assertion,
                        IPolicyRegistry reg)
Description copied from class: AndCompositeAssertion
Returns an assertion which is equivalent to merge of self and the argument.
Specified by:
merge in interface IAssertion
Overrides:
merge in class AndCompositeAssertion
Parameters:
assertion - the assertion to be merged with
reg - the policy registry which the is used resolve external policy references
Returns:
assertion the resultant assertion which is equivalent to merge of self and argument

setAttributes

public void setAttributes(Map<QName,String> attrMap)
Specified by:
setAttributes in interface IAssertion
Overrides:
setAttributes in class SimpleAssertion

setDefaultValues

protected void setDefaultValues()
Overrides:
setDefaultValues in class SimpleAssertion

hasPolicyAlternatives

public boolean hasPolicyAlternatives()
Description copied from interface: IPolicy
Returns true if the Policy has alternatives i.e. it is not an empty Policy.
Specified by:
hasPolicyAlternatives in interface IPolicy
Returns:

isEnabled

public boolean isEnabled()
Description copied from interface: IPolicy
Convenience method returns true if getStatus() returns STATUS.enabled
Specified by:
isEnabled in interface IPolicy
Returns:

getStatus

public IPolicy.STATUS getStatus()
Specified by:
getStatus in interface IPolicy

setStatus

public void setStatus(IPolicy.STATUS status)
Specified by:
setStatus in interface IPolicy

createLocalPolicyReference

public IPolicyReference createLocalPolicyReference(boolean includeExtensions)
WS-Policy Attachment defines two types of Policy Referneces.
<p/> References to Policy within an XML document - a.k.a intra-document linkages and References to Policy external to the XML document.
<p/> This method creates a PolicyReference that can be used for intra-document linkages i.e. the URI attribute is set to Id attribute of the Policy (actually #<value-of-Id> attribute).
<p/> Returns null if getPolicyId() returns null i.e. if the Policy does not have an wsu:Id attribute then the Policy does not support intra-document linkages.
Note: Both wsu:Id and wsp:Name can be null.
Specified by:
createLocalPolicyReference in interface IPolicy
Returns:

createRemotePolicyReference

public IPolicyReference createRemotePolicyReference(boolean includeExtensions)
WS-Policy Attachment defines two types of Policy Referneces. <p/>
References to Policy within an XML document - a.k.a intra-document linkages and References to Policy external to the XML document. <p/>
This method creates a PolicyReference that can be used for inter-document linkages i.e. the URI attribute is set to 'Name' of the Policy. <p/>
Returns null if getPolicyName() returns null i.e. if the Policy does not have an wsp:Name attribute then the Policy does not support inter-document linkages. <p/>
Note: Both wsu:Id and wsp:Name can be null.
Specified by:
createRemotePolicyReference in interface IPolicy
Returns:

isPipeline

public boolean isPipeline()
Convenience method to retrive the orawsp:Pipeline attribute on a <wsp:Policy> element.
Attribute to indicate that ordering of the Assertions is important.
This attribute is ignored in the intersection, merge, normalization semantics.
Specified by:
isPipeline in interface IPolicy
Returns:

setPipeline

public void setPipeline(boolean isPipeline)
Description copied from interface: IPolicy
Set the orawsp:Pipeline attribute
Specified by:
setPipeline in interface IPolicy
Parameters:
isPipeline - - true if it is a pipeline

getVersionInfo

public IVersionInfo getVersionInfo()
Specified by:
getVersionInfo in interface IPolicy

equals

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

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
Overrides:
isIdentical in class AndCompositeAssertion

hashCode

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

advertiseOracleWSPolicy

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

advertiseWSPolicy

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

removeAttrsForOracleWSPolicyAdvertisement

protected void removeAttrsForOracleWSPolicyAdvertisement(Map<QName,String> attrs)
Overrides:
removeAttrsForOracleWSPolicyAdvertisement in class SimpleAssertion

removeAttrsForWSPolicyAdvertisement

protected void removeAttrsForWSPolicyAdvertisement(Map<QName,String> attrs)
Overrides:
removeAttrsForWSPolicyAdvertisement in class SimpleAssertion

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
Overrides:
createInstance in class AndCompositeAssertion
Returns:

createInstance

public IAssertion createInstance(QName qname,
                                 boolean setExtensions)
Overrides:
createInstance in class AndCompositeAssertion

toString

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

setVersionInfo

public void setVersionInfo(IVersionInfo versionInfo)
Specified by:
setVersionInfo in interface IPolicy

getValidatorClass

public String getValidatorClass()
Description copied from interface: IPolicy
Returns the name of validator class set for this Policy object
Specified by:
getValidatorClass in interface IPolicy
Returns:
Fully qualified class name of the validating class

setValidatorClass

public void setValidatorClass(String className)
Description copied from interface: IPolicy
Sets the class name of the java class to validate this policy
Specified by:
setValidatorClass in interface IPolicy
Parameters:
className - fully qualified class name of the validator class

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
Overrides:
validate in class CompositeAssertion

getValidAttachToValues

public List<String> getValidAttachToValues()
Specified by:
getValidAttachToValues in interface IPolicy
Returns:
the valid attach to values

getSubjectCount

public int getSubjectCount()
Description copied from interface: IPolicy
Get a count of subject to which this policy is attached to
Specified by:
getSubjectCount in interface IPolicy
Returns:

setSubjectCount

public void setSubjectCount(int subjectCount)
Description copied from interface: IPolicy
Set the number of end-points that reference this policy
Specified by:
setSubjectCount in interface IPolicy

getLocalOptimization

public String getLocalOptimization()
Description copied from interface: IPolicy
Returns the local-optimzation attribute value of the policy
Specified by:
getLocalOptimization in interface IPolicy
Returns:

setLocalOptimzation

public void setLocalOptimzation(String localOptimization)
Description copied from interface: IPolicy
Sets the local-optimzation parameter value
Specified by:
setLocalOptimzation in interface IPolicy

getDisplayName

public String getDisplayName(Locale locale)
Description copied from interface: IPolicy
Convenience method to retrive localized orawsp:displayName attribute on a <wsp:Policy> element.
This will check if the description field has the above key for the provided locale. If so it will lookup the resource bundle and return the localized description.
Specified by:
getDisplayName in interface IPolicy

getDisplayName

public String getDisplayName()
Description copied from interface: IPolicy
Convenience method to retrive the orawsp:displayName attribute on a <wsp:Policy> element.
This is equivalent to getAttributes().get(displayNameAttrQName).
Specified by:
getDisplayName in interface IPolicy

setDisplayName

public void setDisplayName(String displayName)
Description copied from interface: IPolicy
Convenience method to set the orawsp:displayName attribute on a <wsp:Policy> element.
Specified by:
setDisplayName in interface IPolicy

getDigest

public 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. 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
Overrides:
getDigest in class CompositeAssertion
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

setSmartDigest

public void setSmartDigest(String smartDigest)
Set the value for the attribute "smartDigest" - it represents the "hash" of the value returned by the getDigest call.
Specified by:
setSmartDigest in interface IPolicy
Parameters:
smartDigest - - This is the string representation of the "hash" of the value returned by the method

getSmartDigest

public String getSmartDigest()
Return the smart digest for the policy
Specified by:
getSmartDigest in interface IPolicy
Returns:
String - returns the value of the attribute "smartDigest"

setOracleSmartDigest

public void setOracleSmartDigest(String smartDigest)
Set the value for the attribute "oraSmartDigest" - it represents the "hash" of the value returned by the getDigest call for Policies containing oracle scenario assertions.
Specified by:
setOracleSmartDigest in interface IPolicy
Parameters:
smartDigest - - This is the string representation of the "hash" of the value returned by the method

getOracleSmartDigest

public String getOracleSmartDigest()
Return the oracle fast path digest for the policy
Specified by:
getOracleSmartDigest in interface IPolicy
Returns:
This is the string representation of the "hash" of the value returned by the method

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.