org.apache.muse.ws.resource.properties.query.impl
Class SimpleQueryCapability

java.lang.Object
  extended byorg.apache.muse.core.AbstractCapability
      extended byorg.apache.muse.ws.resource.impl.AbstractWsResourceCapability
          extended byorg.apache.muse.ws.resource.properties.query.impl.SimpleQueryCapability
All Implemented Interfaces:
Capability, Initialization, InitializationParameters, QueryCapability, QueryResourceProperties, Shutdown, WsResourceCapability, org.apache.muse.ws.resource.WsResourceCapabilityProperties

public class SimpleQueryCapability
extends AbstractWsResourceCapability
implements QueryCapability

SimpleQueryCapability is Muse's default implementation of the WS-RP QueryResourceProperties port type. It uses an implementation of the QueryExpressionFactory component that supports XPath 1.0; users can augment the list of supported capabilities by providing an alternate implementation class for this factory (see the documentation of the createQueryExpressionFactory() method).

Author:
Dan Jemiolo (danj)

Field Summary
 
Fields inherited from interface org.apache.muse.ws.resource.properties.query.QueryResourceProperties
PROPERTIES
 
Constructor Summary
SimpleQueryCapability()
           
 
Method Summary
protected  QueryExpressionFactory createQueryExpressionFactory()
          Users can override this method to provide alternative implementations of QueryExpressionFactory that support other dialects.
protected  MessageHandler createQueryHandler()
           
 QName[] getPropertyNames()
          Concrete capability classes that define properties MUST override this method and provide the names of the properties.
 java.lang.String[] getQueryExpressionDialect()
           
protected  QueryExpressionFactory getQueryExpressionFactory()
           
 void initialize()
          

AbstractWsResourceCapability continues the initialization process by inspecting the concrete class to find all of the getters (and, if applicable, setters) for its resource properties. It then registers itself with the resource's WSRP collection so that read and write requests for its properties are delegated to it.

AbstractWsResourceCapability continues the initialization process by inspecting the concrete class to find all of the getters (and, if applicable, setters) for its resource properties.
 org.w3c.dom.Node[] queryResourceProperties(java.lang.String query, java.lang.String dialect)
          Returns a set of DOM Nodes that correlates to the given query string.
protected  void setQueryExpressionFactory(QueryExpressionFactory factory)
           
 
Methods inherited from class org.apache.muse.ws.resource.impl.AbstractWsResourceCapability
createGettersAndSetters, deleteProperty, getGetter, getProperty, getPropertyElements, getSetter, getWsResource, insertProperty, invokeMethod, setResource, updateProperty
 
Methods inherited from class org.apache.muse.core.AbstractCapability
getActions, getCapabilityURI, getEnvironment, getInitializationParameter, getInitializationParameters, getLog, getMessageHandler, getPersistence, getResource, hasBeenInitialized, hasBeenShutdown, initializeCompleted, prepareShutdown, setCapabilityURI, setEnvironment, setInitializationParameters, setLog, setMessageHandler, setMessageHandlers, setPersistence, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.muse.ws.resource.WsResourceCapability
deleteProperty, getProperty, getWsResource, insertProperty, updateProperty
 
Methods inherited from interface org.apache.muse.core.Capability
getActions, getCapabilityURI, getEnvironment, getLog, getMessageHandler, getPersistence, getResource, initializeCompleted, prepareShutdown, setCapabilityURI, setEnvironment, setLog, setMessageHandlers, setPersistence, setResource
 
Methods inherited from interface org.apache.muse.core.Initialization
hasBeenInitialized
 
Methods inherited from interface org.apache.muse.core.InitializationParameters
getInitializationParameter, getInitializationParameters, setInitializationParameters
 
Methods inherited from interface org.apache.muse.core.Shutdown
hasBeenShutdown, shutdown
 

Constructor Detail

SimpleQueryCapability

public SimpleQueryCapability()
Method Detail

createQueryExpressionFactory

protected QueryExpressionFactory createQueryExpressionFactory()
Users can override this method to provide alternative implementations of QueryExpressionFactory that support other dialects.

Returns:
An instance of XPathQueryExpressionFactory.

createQueryHandler

protected MessageHandler createQueryHandler()

getPropertyNames

public QName[] getPropertyNames()
Description copied from interface: org.apache.muse.ws.resource.WsResourceCapabilityProperties
Concrete capability classes that define properties MUST override this method and provide the names of the properties.

Specified by:
getPropertyNames in interface org.apache.muse.ws.resource.WsResourceCapabilityProperties
Overrides:
getPropertyNames in class AbstractWsResourceCapability

getQueryExpressionDialect

public java.lang.String[] getQueryExpressionDialect()
Specified by:
getQueryExpressionDialect in interface QueryResourceProperties

getQueryExpressionFactory

protected QueryExpressionFactory getQueryExpressionFactory()

initialize

public void initialize()
                throws SoapFault
Description copied from class: AbstractWsResourceCapability


AbstractWsResourceCapability continues the initialization process by inspecting the concrete class to find all of the getters (and, if applicable, setters) for its resource properties. It then registers itself with the resource's WSRP collection so that read and write requests for its properties are delegated to it.

Specified by:
initialize in interface Initialization
Overrides:
initialize in class AbstractWsResourceCapability
Throws:
SoapFault

queryResourceProperties

public org.w3c.dom.Node[] queryResourceProperties(java.lang.String query,
                                                  java.lang.String dialect)
                                           throws UnknownQueryExpressionDialectFault,
                                                  InvalidQueryExpressionFault,
                                                  QueryEvaluationErrorFault,
                                                  BaseFault
Description copied from interface: QueryResourceProperties
Returns a set of DOM Nodes that correlates to the given query string.

Specified by:
queryResourceProperties in interface QueryResourceProperties
Parameters:
query - The query expression to evaluate against the WS-RP document.
dialect - The name of the query language used for the query.
Returns:
The set of DOM Nodes that correlates to the given query string. These XML nodes may be entire property instances or just fragments of instances (sub-elements, text, etc.). There is no guarantee that all of the nodes have a similar structure or type. There may be further restrictions on the return value depending on which query language(s) is supported by the WS-RP implementation.
Throws:
BaseFault -
  • If the dialect (query language) is not supported by the implementation.
  • If the query expression is invalid, or there was an error processing the results of the query.
UnknownQueryExpressionDialectFault
InvalidQueryExpressionFault
QueryEvaluationErrorFault

setQueryExpressionFactory

protected void setQueryExpressionFactory(QueryExpressionFactory factory)