org.wso2.registry.jdbc.queries
Class QueryProcessor

java.lang.Object
  extended by org.wso2.registry.jdbc.queries.QueryProcessor
Direct Known Subclasses:
SQLQueryProcessor

public abstract class QueryProcessor
extends java.lang.Object

All query processors should extend this class. All configured query processor implementations will be associated with a query type. Once an execute opration is called for a query of that type, the associated query processor is invoked. Then all the tasks required for processing that query should be taken over by the query processor implementation. This processing steps include interpreting of given query parameters, constructing the resulting resource object, etc.


Field Summary
protected  javax.sql.DataSource dataSource
          Datasource of the registry database.
protected  UserRealm realm
          Default realm of the user manager used in the registry.
 
Constructor Summary
QueryProcessor(javax.sql.DataSource dataSource, UserRealm realm)
           
 
Method Summary
abstract  Collection executeQuery(Resource query, java.util.Map parameters)
          This method will be called when a query of a registered type is executed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataSource

protected javax.sql.DataSource dataSource
Datasource of the registry database. URL handlers can access this to contruct resources by combining various tables (e.g. comments).


realm

protected UserRealm realm
Default realm of the user manager used in the registry. This can be used by the URL handler implementations to check authorizations on resources.

Constructor Detail

QueryProcessor

public QueryProcessor(javax.sql.DataSource dataSource,
                      UserRealm realm)
Method Detail

executeQuery

public abstract Collection executeQuery(Resource query,
                                        java.util.Map parameters)
                                 throws RegistryException
This method will be called when a query of a registered type is executed.

Parameters:
query - query resource, possibly containing the query string
parameters - query parameters as name->value pairs
Returns:
QueryProcessor impl should map the query results to a resource and return the resource. If the query may return multiple results it can return a collection resource, containing the paths of individual results. Then a URL handler can be registered to process those individual paths and return actual resulting resource.
Throws:
RegistryException - QueryProcessor impl should handle all exceptions and throw RegisrtyException if the exception has to propagated to the client.


Copyright © 2007 Apache Web Services Project. All Rights Reserved.