Style Intelligence v12.0

inetsoft.uql.service
Class XHandler

java.lang.Object
  extended by inetsoft.uql.service.XHandler
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RemoteHandler

public abstract class XHandler
extends Object
implements Serializable

XHandler defines the API for query handlers. A handler is responsible for a particular protocol. All interfaces to a data source, including connection, meta data retrieval, and query execution are processed through a handler.

See Also:
Serialized Form

Field Summary
protected  XRepository repository
           
protected  Object session
           
 
Constructor Summary
XHandler()
           
 
Method Summary
abstract  void close()
          Close the data source connection.
abstract  void connect(XDataSource datasource, VariableTable params)
          Connect to the data source.
abstract  XNode execute(XQuery query, VariableTable params, Principal user, inetsoft.util.DataCacheVisitor visitor)
          Execute the query.
abstract  XNode getMetaData(XNode mtype)
          Build the meta data of this data source as a XNode tree.
 String getQueryKey(XQuery query, VariableTable qvars, Principal user)
          Get a query key for query caching.
 XNode postProcess(XNode root, XQuery query, VariableTable params)
          Apply max rows to the resultset.
protected  void prepareVariableTable(XQuery xquery, VariableTable vars)
          Get the variable table to serve as base table.
 void reset()
          Clear the internal cached states.
 void reset(XQuery query)
          Clear the internal cached states of a query.
 void setRepository(XRepository repository)
          Set the repository associated with this handler.
 void setSession(Object session)
          Set the session associated with this handler.
abstract  void testDataSource(XDataSource datasource, VariableTable params)
          Test the data source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

protected Object session

repository

protected XRepository repository
Constructor Detail

XHandler

public XHandler()
Method Detail

execute

public abstract XNode execute(XQuery query,
                              VariableTable params,
                              Principal user,
                              inetsoft.util.DataCacheVisitor visitor)
                       throws Exception
Execute the query.

Parameters:
params - parameters for query.
Returns:
the result as a hierarchical tree.
Throws:
Exception

connect

public abstract void connect(XDataSource datasource,
                             VariableTable params)
                      throws Exception
Connect to the data source.

Parameters:
datasource - the data source name.
params - parameters for connection.
Throws:
Exception

testDataSource

public abstract void testDataSource(XDataSource datasource,
                                    VariableTable params)
                             throws Exception
Test the data source.

Parameters:
datasource - the data source name.
params - parameters for connection.
Throws:
Exception

getMetaData

public abstract XNode getMetaData(XNode mtype)
                           throws Exception
Build the meta data of this data source as a XNode tree. This method will rebuild the meta data tree everytime it's called. The meta data should be cached by the caller.

Parameters:
mtype - meta data type, defined in each data source.
Returns:
return the root node of the meta data tree.
Throws:
Exception

close

public abstract void close()
                    throws Exception
Close the data source connection.

Throws:
Exception

setSession

public void setSession(Object session)
Set the session associated with this handler.


setRepository

public void setRepository(XRepository repository)
Set the repository associated with this handler.


reset

public void reset()
Clear the internal cached states.


reset

public void reset(XQuery query)
Clear the internal cached states of a query.

Parameters:
query - the specified query

postProcess

public XNode postProcess(XNode root,
                         XQuery query,
                         VariableTable params)
                  throws Exception
Apply max rows to the resultset.

Throws:
Exception

prepareVariableTable

protected void prepareVariableTable(XQuery xquery,
                                    VariableTable vars)
Get the variable table to serve as base table. This contains all query variables, whose values are calculated at runtime.


getQueryKey

public String getQueryKey(XQuery query,
                          VariableTable qvars,
                          Principal user)
                   throws Exception
Get a query key for query caching.

Throws:
Exception

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.