org.wso2.carbon.registry.core.jdbc.dataaccess
Class SQLQueryProcessor

java.lang.Object
  extended by org.wso2.carbon.registry.core.jdbc.dataaccess.SQLQueryProcessor
All Implemented Interfaces:
QueryProcessor

public class SQLQueryProcessor
extends java.lang.Object
implements QueryProcessor

The query processor to execute sql queries.


Field Summary
protected  javax.sql.DataSource dataSource
          DataSource of the registry database.
 
Constructor Summary
SQLQueryProcessor(DataAccessManager dataAccessManager)
          Initialize the sql query processor
 
Method Summary
 Collection executeQuery(Registry registry, 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 construct resources by combining various tables (e.g. comments).

Constructor Detail

SQLQueryProcessor

public SQLQueryProcessor(DataAccessManager dataAccessManager)
Initialize the sql query processor

Parameters:
dataAccessManager - the data access manager to be set.
Method Detail

executeQuery

public Collection executeQuery(Registry registry,
                               Resource query,
                               java.util.Map parameters)
                        throws RegistryException
Description copied from interface: QueryProcessor
This method will be called when a query of a registered type is executed.

Specified by:
executeQuery in interface QueryProcessor
Parameters:
registry - the registry to execute the query
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 RegistryException if the exception has to propagated to the client.


Copyright © 2011 WSO2 Inc. All Rights Reserved.