org.wso2.carbon.registry.core.dataaccess
Interface QueryProcessor

All Known Implementing Classes:
SQLQueryProcessor

public interface QueryProcessor

All query processors should extend this class. All configured query processor implementations will be associated with a query type. Once an execute operation 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.


Method Summary
 Collection executeQuery(Registry registry, Resource query, Map parameters)
          This method will be called when a query of a registered type is executed.
 

Method Detail

executeQuery

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

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.