com.metamatrix.cdk
Class ConnectorShellCommandTarget

java.lang.Object
  extended by com.metamatrix.core.commandshell.CommandTarget
      extended by com.metamatrix.core.commandshell.ScriptCommandTarget
          extended by com.metamatrix.cdk.QueryCommandTarget
              extended by com.metamatrix.cdk.ConnectorShellCommandTarget
All Implemented Interfaces:
StringUtil.Constants

public class ConnectorShellCommandTarget
extends QueryCommandTarget

Implements the commands supported by the ConnectorShell. Delegates to a ConnectorHost to execute queries.


Field Summary
 
Fields inherited from class com.metamatrix.cdk.QueryCommandTarget
currentPreparedStmtName, preparedStmts, prepareStmt, usePreparedStatement
 
Fields inherited from class com.metamatrix.core.commandshell.ScriptCommandTarget
SETUP_SCRIPT, TEST_PREFIX, testCount, testFailureCount, testFailureMessage
 
Fields inherited from class com.metamatrix.core.commandshell.CommandTarget
shell
 
Fields inherited from interface com.metamatrix.core.util.StringUtil.Constants
CARRIAGE_RETURN, CARRIAGE_RETURN_CHAR, DBL_SPACE, DOT, DOT_CHAR, EMPTY_STRING, EMPTY_STRING_ARRAY, LINE_FEED, LINE_FEED_CHAR, NEW_LINE, NEW_LINE_CHAR, PATTERN_BACK_SLASH, PATTERN_QUESTION, PATTERN_STAR, SPACE, SPACE_CHAR, TAB, TAB_CHAR
 
Constructor Summary
ConnectorShellCommandTarget()
           
ConnectorShellCommandTarget(IConnectorHost connectorHost)
           
 
Method Summary
 void createArchive(java.lang.String fileName, java.lang.String cdkName, java.lang.String extDirName)
          Build the connector archive file.
 void createTemplate(java.lang.String filename)
           
protected  java.lang.String execute(java.lang.String query)
           
protected  java.util.Set getMethodsToIgnore()
           
 java.lang.String getProperties()
           
 void load(java.lang.String connectorClassName, java.lang.String vdbFileName)
           
 void loadArchive(java.lang.String fileName, java.lang.String typeName)
          Load the archive file, so that the connector can be started
 void loadFromScript(java.lang.String configurationScriptFileName)
          Executes the provided script and expects the script to produce a ConnectorHost for executing queries.
 void loadProperties(java.lang.String propertyFileName)
           
 void setBatchSize(int batchSize)
           
 void setFailOnError(boolean failOnError)
           
 void setPrintStackOnError(boolean printStackOnError)
           
 void setProperty(java.lang.String propertyName, java.lang.String propertyValue)
           
 void setSecurityContext(java.lang.String vdbName, java.lang.String vdbVersion, java.lang.String userName)
           
 void start()
           
 void stop()
           
 
Methods inherited from class com.metamatrix.cdk.QueryCommandTarget
delete, exec, executeSql, insert, readSql, select, setUsePreparedStatement, update
 
Methods inherited from class com.metamatrix.core.commandshell.ScriptCommandTarget
clone, getTestSummary, hasSetupScript, resetTestStatistics, run, runAll, runningScript, runRep, runScript, setScriptFile, setSilent
 
Methods inherited from class com.metamatrix.core.commandshell.CommandTarget
exit, getShell, help, quit, setShell
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectorShellCommandTarget

public ConnectorShellCommandTarget()

ConnectorShellCommandTarget

public ConnectorShellCommandTarget(IConnectorHost connectorHost)
Method Detail

execute

protected java.lang.String execute(java.lang.String query)
Specified by:
execute in class QueryCommandTarget

getMethodsToIgnore

protected java.util.Set getMethodsToIgnore()
Overrides:
getMethodsToIgnore in class CommandTarget

loadFromScript

public void loadFromScript(java.lang.String configurationScriptFileName)
Executes the provided script and expects the script to produce a ConnectorHost for executing queries.

Parameters:
configurationScriptFileName - Resource name of the script file to be loaded from the class path.

load

public void load(java.lang.String connectorClassName,
                 java.lang.String vdbFileName)
          throws java.lang.IllegalAccessException,
                 java.lang.InstantiationException,
                 java.lang.ClassNotFoundException
Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.ClassNotFoundException

start

public void start()
           throws java.lang.IllegalAccessException,
                  java.lang.InstantiationException,
                  java.lang.ClassNotFoundException
Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.ClassNotFoundException

stop

public void stop()

loadProperties

public void loadProperties(java.lang.String propertyFileName)

setFailOnError

public void setFailOnError(boolean failOnError)

setPrintStackOnError

public void setPrintStackOnError(boolean printStackOnError)

setSecurityContext

public void setSecurityContext(java.lang.String vdbName,
                               java.lang.String vdbVersion,
                               java.lang.String userName)

setBatchSize

public void setBatchSize(int batchSize)

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.String propertyValue)

getProperties

public java.lang.String getProperties()

createTemplate

public void createTemplate(java.lang.String filename)

createArchive

public void createArchive(java.lang.String fileName,
                          java.lang.String cdkName,
                          java.lang.String extDirName)
Build the connector archive file. ( This is duplicate code from the ConnectorArchiveImportExport class, due to dependency reasons I had to write)

Parameters:
filename -
cdkName -
extDirName -
Since:
4.3.2

loadArchive

public void loadArchive(java.lang.String fileName,
                        java.lang.String typeName)
Load the archive file, so that the connector can be started

Parameters:
fileName -
typeName - Name to give the new connector type.
Since:
4.3.2


Copyright © 2009. All Rights Reserved.