org.apache.muse.ws.dm.muws.impl
Class MatchCorrelation

java.lang.Object
  extended by org.apache.muse.ws.dm.muws.impl.MatchCorrelation
All Implemented Interfaces:
XmlSerializable, Correlation, Match

public class MatchCorrelation
extends Object
implements Correlation, Match

MatchCorrelation represents correlation expressions formatted with the MUWS Simple Property Boolean Match (PBM) schema. PBM allows the user to declare fairly complex conditionals for evaluating two resources for equality. Each MatchCorrelation will contain one or more instances of Match.

Author:
Dan Jemiolo (danj)

Constructor Summary
MatchCorrelation(WsResource resource)
          This is a convenience constructor that calls this(Resource, boolean) with a 'false' second parameter.
MatchCorrelation(WsResource resource, boolean negativeAssertion)
           
MatchCorrelation(WsResource resource, Element xml)
           
 
Method Summary
 void addMatch(Match child)
           
 String getDialect()
           
 List getMatches()
           
 WsResource getWsResource()
           
 boolean hasNegativeAssertion()
           
 boolean matches(EndpointReference epr)
           
 void removeMatch(Match child)
           
 Element toXML()
          Converts this object into an XML representation, as defined by its related schema or specification.
 Element toXML(Document doc)
          Converts this object into an XML representation, as defined by its related schema or specification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchCorrelation

public MatchCorrelation(WsResource resource)
This is a convenience constructor that calls this(Resource, boolean) with a 'false' second parameter.

See Also:
MatchCorrelation(WsResource, boolean)

MatchCorrelation

public MatchCorrelation(WsResource resource,
                        boolean negativeAssertion)
Parameters:
resource - The resource that is defining the CorrelatableProperties capability and, thus, this correlation.
negativeAssertion - True if this correlation guarantees that a false match equates to two resources being different.

MatchCorrelation

public MatchCorrelation(WsResource resource,
                        Element xml)
Parameters:
resource - The resource that is defining the CorrelatableProperties capability and, thus, this correlation.
xml - The DOM Element representing an instance of CorrelatableProperties that uses the PBM dialect (is defined by Matches).
Method Detail

addMatch

public void addMatch(Match child)
Specified by:
addMatch in interface Match
Parameters:
child - A subexpression that must be evaluated as part of this larger expression.

getDialect

public String getDialect()
Specified by:
getDialect in interface Correlation
Returns:
The dialect, or type, of the correlation expression. Users may define their own correlation types and declare the syntax with this method.

getMatches

public List getMatches()
Specified by:
getMatches in interface Match
Returns:
An ordered list of subexpressions in this Match. If there are no subexpressions, the list is empty.

getWsResource

public WsResource getWsResource()
Specified by:
getWsResource in interface Correlation
Specified by:
getWsResource in interface Match
Returns:
The local resource that is defining the CorrelatableProperties capability and, thus, this correlation expression.

hasNegativeAssertion

public boolean hasNegativeAssertion()
Specified by:
hasNegativeAssertion in interface Correlation
Returns:
True if there is a guarantee that two resources are not the same when matches(Resource) returns 'false'. If this method returns 'false', the caller must rely on some other means to confirm that the resources are, in fact, different.

matches

public boolean matches(EndpointReference epr)
                throws SoapFault
Specified by:
matches in interface Correlation
Specified by:
matches in interface Match
Parameters:
epr - The EPR of another resource which may be the same as this resource.
Returns:
True if the two resources are the same according to their WSDM ResourceId values or their WSDM CorrelatableProperties expressions. Note that if the method returns 'false', this does not guarantee that the two resources are actually different - you can only confirm this by checking with the hasNegativeAssertions() method.
Throws:
SoapFault -
  • If there is a problem reading the correlatable properties from either resource.
  • If the values or dialects of the correlatable properties are not supported. The built-in dialects are WSDM Property Boolean Match (PBM) and XPath 1.0.
See Also:
Correlation.hasNegativeAssertion()

removeMatch

public void removeMatch(Match child)
Specified by:
removeMatch in interface Match

toXML

public Element toXML()
Description copied from interface: XmlSerializable
Converts this object into an XML representation, as defined by its related schema or specification. The format of the XML is dependent on the concrete type.

Specified by:
toXML in interface XmlSerializable
Returns:
An XML representation of this object.

toXML

public Element toXML(Document doc)
Description copied from interface: XmlSerializable
Converts this object into an XML representation, as defined by its related schema or specification. The format of the XML is dependent on the concrete type.

Specified by:
toXML in interface XmlSerializable
Parameters:
doc - The DOM Document that will be used to create all of the nodes in the resulting XML fragment.
Returns:
An XML representation of this object.


Copyright © 2005-2011 Apache Web Services - Muse. All Rights Reserved.