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 SimpleAssertion

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

All Implemented Interfaces:
Serializable, IAssertionAdvertiser, IAssertion, ISimpleAssertion, ISimpleOracleAssertion
Direct Known Subclasses:
CompositeAssertion, ElementsAssertion, LogAssertion, MultiElementSimpleAssertion, NestedAssertion, PartsAssertion, ScenarioAssertion

public class SimpleAssertion
extends Object
implements ISimpleAssertion
See Also:
Serialized Form

Nested Class Summary

 

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

 

Field Summary

 

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

 

Constructor Summary
protected SimpleAssertion()
           
  SimpleAssertion(QName qname)
           
  SimpleAssertion(QName qname, Object value)
           

 

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.
protected  Map<QName,String> cloneAttrs(Map<QName,String> attrs)
           
 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)
           
 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 getAttachTo()
           
 String getAttribute(QName qname)
           
 Map<QName,String> getAttributes()
           
 IAssertionBindings getBindings()
           
 String getCategory()
           
protected  SimpleAssertion getCopyOfAssertion()
           
 String getDescription()
           
 String getDescription(Locale locale)
          Convenience method to retrive localized orawsp:description attribute on a <wsp:Policy> element.
 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.
 String getDigestForAttrs(List<String> namespaces, List<QName> qnames, boolean inclusionOrExclusionCriteria)
           
 IAssertionGuard getGuard()
           
 String getName()
           
 IAssertion getParent()
          Returns the parent of self or null if a parent non-exists
 QName getQName()
           
 String getStringForMatching()
          The String to be used in the matching algorithim (used for intersection, merge, etc).
 String getStrValue()
           
protected  String getUniquePathToAssertion()
           
protected  QName getWSPolicy15QName(QName qName, boolean isAdvertVersion11)
          This method will replace namespace of ws-policy2006
protected  QName getWSPolicy2006QName(QName qName, boolean isAdvertVersion11)
          This method will replace namespace of ws-policy15
 boolean hasBindings()
           
 boolean hasGuard()
           
 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 isEnforced()
           
 boolean isIdentical(Object obj)
          It is same as equals method except it emphasizes on the order, while equlas doesn't.
protected  boolean isIncludedInDigestCalculation(QName qname, List<String> namespaces, List<QName> qnames, boolean inclusionOrExclusionCriteria)
          Given a qname parameter and the set of namespaces and qnames and inclusionOrExclusionCriteria determines if the qname needs to be included in the digest calculation.
 boolean isNormalized()
          Returns true if the Assertion has been normalized.
 boolean isOptional()
          Returns true if the Assertion is optional.
 boolean isSilent()
           
 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 removeAttrsForOracleWSPolicyAdvertisement(Map<QName,String> attrs)
           
protected  void removeAttrsForWSPolicyAdvertisement(Map<QName,String> attrs)
           
 void removeBindings()
          Removes IAssertionBindings if any from the assertion
 void removeGuard()
           
 void setAttachTo(String attachTo)
           
protected  void setAttribute(QName idAttr, String attrValue)
           
 void setAttributes(Map<QName,String> attributes)
           
 void setBindings(IAssertionBindings bindings)
           
 void setCategory(String category)
           
protected  void setDefaultValues()
           
 void setDescription(String desc)
           
 void setEnforced(boolean isEnforced)
           
 void setGuard(IAssertionGuard guard)
           
 void setName(String assertionName)
           
 void setNormalized(boolean flag)
          WARNING: Do not call this method.
 void setOptional(boolean isOptional)
          Specifies if the Assertion is optional.
 void setParent(IAssertion parent)
          Set the parent to argument
 void setSilent(boolean isSilent)
           
 void setStrValue(String strValue)
           
 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

SimpleAssertion

protected SimpleAssertion()

SimpleAssertion

public SimpleAssertion(QName qname,
                       Object value)

SimpleAssertion

public SimpleAssertion(QName qname)

Method Detail

setDefaultValues

protected void setDefaultValues()

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

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

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

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

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

getStrValue

public String getStrValue()

setStrValue

public void setStrValue(String strValue)

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

isSilent

public boolean isSilent()
Specified by:
isSilent in interface ISimpleOracleAssertion

setSilent

public void setSilent(boolean isSilent)
Specified by:
setSilent in interface ISimpleOracleAssertion

isEnforced

public boolean isEnforced()
Specified by:
isEnforced in interface ISimpleOracleAssertion

setEnforced

public void setEnforced(boolean isEnforced)
Specified by:
setEnforced in interface ISimpleOracleAssertion

getQName

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

merge

public IAssertion merge(IAssertion assertion,
                        IPolicyRegistry reg)
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

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

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:

getCopyOfAssertion

protected SimpleAssertion getCopyOfAssertion()

intersect

public IAssertion intersect(IAssertion assertion,
                            IIntersectionContext context)
                     throws UnsupportedOperationException
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
Throws:
UnsupportedOperationException

intersect

public IAssertion intersect(IAssertion assertion,
                            IPolicyRegistry reg,
                            IIntersectionContext context)
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

hasBindings

public boolean hasBindings()
Specified by:
hasBindings in interface ISimpleOracleAssertion

setBindings

public void setBindings(IAssertionBindings bindings)
Specified by:
setBindings in interface ISimpleOracleAssertion

getBindings

public IAssertionBindings getBindings()
Specified by:
getBindings in interface ISimpleOracleAssertion

setAttribute

protected void setAttribute(QName idAttr,
                            String attrValue)

getAssertionType

public int getAssertionType()
Description copied from interface: IAssertion
Returns the type of the assertion.
Specified by:
getAssertionType 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:

getDescription

public String getDescription()
Specified by:
getDescription in interface ISimpleOracleAssertion

getDescription

public String getDescription(Locale locale)
Description copied from interface: ISimpleOracleAssertion
Convenience method to retrive localized orawsp:description 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:
getDescription in interface ISimpleOracleAssertion

setDescription

public void setDescription(String desc)
Specified by:
setDescription in interface ISimpleOracleAssertion

getCategory

public String getCategory()
Specified by:
getCategory in interface ISimpleOracleAssertion

setCategory

public void setCategory(String category)
Specified by:
setCategory in interface ISimpleOracleAssertion

getUniquePathToAssertion

protected String getUniquePathToAssertion()

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

hashCode

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

toString

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

advertiseOracleWSPolicy

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

advertiseWSPolicy

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

cloneAttrs

protected Map<QName,String> cloneAttrs(Map<QName,String> attrs)

removeAttrsForOracleWSPolicyAdvertisement

protected void removeAttrsForOracleWSPolicyAdvertisement(Map<QName,String> attrs)

removeAttrsForWSPolicyAdvertisement

protected void removeAttrsForWSPolicyAdvertisement(Map<QName,String> attrs)

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:

createInstance

public IAssertion createInstance(QName qname,
                                 boolean setExtensions)

removeBindings

public void removeBindings()
Description copied from interface: ISimpleOracleAssertion
Removes IAssertionBindings if any from the assertion
Specified by:
removeBindings in interface ISimpleOracleAssertion

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

getAttachTo

public String getAttachTo()
Specified by:
getAttachTo in interface ISimpleOracleAssertion

setAttachTo

public void setAttachTo(String attachTo)
Specified by:
setAttachTo in interface ISimpleOracleAssertion

getName

public String getName()
Specified by:
getName in interface ISimpleOracleAssertion

setName

public void setName(String assertionName)
Specified by:
setName in interface ISimpleOracleAssertion

getDigest

public 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
Specified by:
getDigest in interface IAssertion
Returns:
- String - the digest

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
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

isIncludedInDigestCalculation

protected boolean isIncludedInDigestCalculation(QName qname,
                                                List<String> namespaces,
                                                List<QName> qnames,
                                                boolean inclusionOrExclusionCriteria)
Given a qname parameter and the set of namespaces and qnames and inclusionOrExclusionCriteria determines if the qname needs to be included in the digest calculation. Note: If namespaces or qnames both are null - then the qname is always included in the digest calculation irrespective of the value of the param inclusionOrExclusionCriteria
Parameters:
qname - - the qname that needs to be include in the digest calculation
namespaces - - can be null
qnames - - can be null
inclusionOrExclusionCriteria - - if namespaces or qnames are not null then should these lists be used as inclusion or exclusion criteria.
Returns:

getDigestForAttrs

public String getDigestForAttrs(List<String> namespaces,
                                List<QName> qnames,
                                boolean inclusionOrExclusionCriteria)

getWSPolicy15QName

protected QName getWSPolicy15QName(QName qName,
                                   boolean isAdvertVersion11)
This method will replace namespace of ws-policy2006
Parameters:
qName -
isAdvertVersion11 -
Returns:

getWSPolicy2006QName

protected QName getWSPolicy2006QName(QName qName,
                                     boolean isAdvertVersion11)
This method will replace namespace of ws-policy15
Parameters:
qName -
isAdvertVersion11 -
Returns:

getGuard

public IAssertionGuard getGuard()
Specified by:
getGuard in interface ISimpleOracleAssertion

hasGuard

public boolean hasGuard()
Specified by:
hasGuard in interface ISimpleOracleAssertion

removeGuard

public void removeGuard()
Specified by:
removeGuard in interface ISimpleOracleAssertion

setGuard

public void setGuard(IAssertionGuard guard)
Specified by:
setGuard in interface ISimpleOracleAssertion

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.