com.metamatrix.cdk.api
Class ConnectorHost

java.lang.Object
  extended by com.metamatrix.cdk.api.ConnectorHost
All Implemented Interfaces:
IConnectorHost

public class ConnectorHost
extends java.lang.Object
implements IConnectorHost

A simple test environment to execute commands on a connector. Provides an alternative to deploying the connector in the full DQP environment. Can be used for testing a connector.


Constructor Summary
ConnectorHost(Connector connector, java.util.Properties connectorEnvironmentProperties, java.lang.String vdbFileName)
          Create a new environment to test a connector.
ConnectorHost(Connector connector, java.util.Properties connectorEnvironmentProperties, java.lang.String vdbFileName, boolean showLog)
           
ConnectorHost(Connector connector, java.util.Properties connectorEnvironmentProperties, TranslationUtility util)
           
ConnectorHost(Connector connector, java.util.Properties connectorEnvironmentProperties, TranslationUtility util, boolean showLog)
           
 
Method Summary
 void addResourceToConnectorEnvironment(java.lang.String resourceName, java.lang.Object resource)
           
 int[] executeBatchedUpdates(Connection connection, ICommand[] commands, RuntimeMetadata runtimeMetadata)
           
 int[] executeBatchedUpdates(java.lang.String[] updates)
           
 java.util.List executeCommand(ICommand command)
           
 java.util.List executeCommand(java.lang.String query)
           
 ICommand getCommand(java.lang.String query)
           
 java.util.Properties getConnectorEnvironmentProperties()
           
 void setExecutionContext(ExecutionContext context)
           
 void setSecurityContext(java.lang.String vdbName, java.lang.String vdbVersion, java.lang.String userName, java.io.Serializable trustedPayload)
           
 void setSecurityContext(java.lang.String vdbName, java.lang.String vdbVersion, java.lang.String userName, java.io.Serializable trustedPayload, java.io.Serializable executionPayload)
           
 void startConnectorIfNeeded()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectorHost

public ConnectorHost(Connector connector,
                     java.util.Properties connectorEnvironmentProperties,
                     java.lang.String vdbFileName)
Create a new environment to test a connector.

Parameters:
connector - a newly constructed connector to host in the new environment
connectorEnvironmentProperties - the properties to expose to the connector as part of the connector environment
vdbFileName - the path to the VDB file to load and use as the source of metadata for the queries sent to this connector

ConnectorHost

public ConnectorHost(Connector connector,
                     java.util.Properties connectorEnvironmentProperties,
                     java.lang.String vdbFileName,
                     boolean showLog)

ConnectorHost

public ConnectorHost(Connector connector,
                     java.util.Properties connectorEnvironmentProperties,
                     TranslationUtility util)

ConnectorHost

public ConnectorHost(Connector connector,
                     java.util.Properties connectorEnvironmentProperties,
                     TranslationUtility util,
                     boolean showLog)
Method Detail

startConnectorIfNeeded

public void startConnectorIfNeeded()
                            throws ConnectorException
Throws:
ConnectorException

getConnectorEnvironmentProperties

public java.util.Properties getConnectorEnvironmentProperties()
Specified by:
getConnectorEnvironmentProperties in interface IConnectorHost

addResourceToConnectorEnvironment

public void addResourceToConnectorEnvironment(java.lang.String resourceName,
                                              java.lang.Object resource)

setSecurityContext

public void setSecurityContext(java.lang.String vdbName,
                               java.lang.String vdbVersion,
                               java.lang.String userName,
                               java.io.Serializable trustedPayload)
Specified by:
setSecurityContext in interface IConnectorHost
Since:
4.2
See Also:
IConnectorHost.setSecurityContext(java.lang.String, java.lang.String, java.lang.String, java.io.Serializable)

setSecurityContext

public void setSecurityContext(java.lang.String vdbName,
                               java.lang.String vdbVersion,
                               java.lang.String userName,
                               java.io.Serializable trustedPayload,
                               java.io.Serializable executionPayload)
Specified by:
setSecurityContext in interface IConnectorHost

setExecutionContext

public void setExecutionContext(ExecutionContext context)

executeCommand

public java.util.List executeCommand(java.lang.String query)
                              throws ConnectorException
Specified by:
executeCommand in interface IConnectorHost
Throws:
ConnectorException

executeCommand

public java.util.List executeCommand(ICommand command)
                              throws ConnectorException
Specified by:
executeCommand in interface IConnectorHost
Throws:
ConnectorException

executeBatchedUpdates

public int[] executeBatchedUpdates(java.lang.String[] updates)
                            throws ConnectorException
Specified by:
executeBatchedUpdates in interface IConnectorHost
Throws:
ConnectorException

executeBatchedUpdates

public int[] executeBatchedUpdates(Connection connection,
                                   ICommand[] commands,
                                   RuntimeMetadata runtimeMetadata)
                            throws ConnectorException
Throws:
ConnectorException

getCommand

public ICommand getCommand(java.lang.String query)
Specified by:
getCommand in interface IConnectorHost


Copyright © 2009. All Rights Reserved.