com.taleo.integration.client.customstep.db
Class SelectPreStep

java.lang.Object
  extended by com.taleo.integration.client.step.BaseStep
      extended by com.taleo.integration.client.step.BaseCustomStep
          extended by com.taleo.integration.client.customstep.BaseCustomStep
              extended by com.taleo.integration.client.customstep.db.SelectPreStep
All Implemented Interfaces:
com.taleo.integration.client.step.CustomStep, com.taleo.integration.client.step.Step

public class SelectPreStep
extends BaseCustomStep

This step executes a Select query on a database and sets the result as input to the TCC import process.

This step takes all parameters from its base class BaseCustomStep and the following additional parameters:

This class is dependent on:

Here is an example of how to define this custom step in the TCC configuration file.

Author:
Romain Guay, Taleo Corporation

Field Summary
 
Fields inherited from class com.taleo.integration.client.customstep.BaseCustomStep
parameterNames
 
Fields inherited from class com.taleo.integration.client.step.BaseCustomStep
parameters
 
Fields inherited from class com.taleo.integration.client.step.BaseStep
commType, ERROR_NULL_GLOBAL_CONFIG, ERROR_NULL_PIPELINE, ERROR_NULL_STEP_CONFIG, productCode, tempFolder, type, version
 
Constructor Summary
SelectPreStep()
          Constructor without arguments.
 
Method Summary
 void execute(java.io.File outFile)
          Execute the step and write result in the given file.
 void execute(com.taleo.ws.integration.client.Pipeline pipeline)
           
 char getCsvDelimiter()
          Get the CSV delimiter.
 char getCsvQuoteCharacter()
          Get the CSV quote character.
 java.lang.String getDescription()
           
 java.lang.String getDriverClassName()
          Get the driver class name.
 java.lang.String getIdentifier()
           
 java.lang.String getName()
           
 java.lang.String getPassword()
          Get the database password.
 java.lang.String getQuery()
          Get the SQL query.
 java.lang.String getQueryFile()
          Get the SQL query file.
 java.lang.String getSqlParameter(java.lang.String name)
          Get the SQL parameter by its name.
 java.lang.String getUrl()
          Get the database URL.
 java.lang.String getUsername()
          Get the database user name.
 void init(com.taleo.ws.integration.client.GlobalConfig config)
           
 boolean isCsvHeaderPresent()
          Indicate if the CSV header is to be present.
protected  java.lang.String prepareQuery(java.lang.String query, java.util.Properties parameters)
          Prepare the query by stripping any ";" ending character and resolving named parameters.
 void setCsvDelimiter(char csvDelimiter)
          Set the CSV delimiter.
 void setCsvHeaderPresent(boolean csvHeaderPresent)
          Set if the CSV header is to be present.
 void setCsvQuoteCharacter(char csvQuoteCharacter)
          Set the CSV quote character.
 void setDriverClassName(java.lang.String driverClassName)
          Set the driver class name.
 void setPassword(java.lang.String password)
          Set the database password.
 void setQuery(java.lang.String query)
          Set the SQL query.
 void setQueryFile(java.lang.String queryFile)
          Set the SQL query file.
 void setSqlParameter(java.lang.String name, java.lang.String value)
          Set the SQL parameter by its name.
 void setUrl(java.lang.String url)
          Set the database URL.
 void setUsername(java.lang.String username)
          Set the database user name.
protected  void validateParameterNames()
          Validate the parameters names.
 
Methods inherited from class com.taleo.integration.client.customstep.BaseCustomStep
createTempFile, createTempFile, getEncoding, getTempFolder, isActive, registerParameterName, setActive, setEncoding
 
Methods inherited from class com.taleo.integration.client.step.BaseCustomStep
getSupportedPipeline, getType, init
 
Methods inherited from class com.taleo.integration.client.step.BaseStep
getAllProcessSupportPipeline, getCurrentFile, getCurrentFile, getCurrentMessage, getPostProcessSupportPipeline, getPreProcessSupportPipeline, isOriginalFile, validateLastStepType, validateMessageType, validatePipeline
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.taleo.integration.client.step.Step
validatePipeline
 

Constructor Detail

SelectPreStep

public SelectPreStep()
Constructor without arguments.

Method Detail

validateParameterNames

protected void validateParameterNames()
Validate the parameters names.

Override the default method to allow for extra parameters to be passed to the SQL query.

Overrides:
validateParameterNames in class BaseCustomStep

getIdentifier

public java.lang.String getIdentifier()
Specified by:
getIdentifier in interface com.taleo.integration.client.step.CustomStep
Specified by:
getIdentifier in interface com.taleo.integration.client.step.Step
Specified by:
getIdentifier in class com.taleo.integration.client.step.BaseCustomStep

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface com.taleo.integration.client.step.CustomStep
Specified by:
getDescription in interface com.taleo.integration.client.step.Step
Specified by:
getDescription in class com.taleo.integration.client.step.BaseCustomStep

getName

public java.lang.String getName()
Specified by:
getName in interface com.taleo.integration.client.step.CustomStep
Specified by:
getName in interface com.taleo.integration.client.step.Step
Specified by:
getName in class com.taleo.integration.client.step.BaseCustomStep

getQuery

public java.lang.String getQuery()
Get the SQL query.

Returns:

setQuery

public void setQuery(java.lang.String query)
Set the SQL query.

Parameters:
query -

getQueryFile

public java.lang.String getQueryFile()
Get the SQL query file.

Returns:

setQueryFile

public void setQueryFile(java.lang.String queryFile)
Set the SQL query file.

Parameters:
queryFile -

getDriverClassName

public java.lang.String getDriverClassName()
Get the driver class name.

Returns:

setDriverClassName

public void setDriverClassName(java.lang.String driverClassName)
Set the driver class name.

Parameters:
driverClassName -

getUrl

public java.lang.String getUrl()
Get the database URL.

Returns:

setUrl

public void setUrl(java.lang.String url)
Set the database URL.

Parameters:
url -

getUsername

public java.lang.String getUsername()
Get the database user name.

Returns:

setUsername

public void setUsername(java.lang.String username)
Set the database user name.

Parameters:
username -

getPassword

public java.lang.String getPassword()
Get the database password.

Returns:

setPassword

public void setPassword(java.lang.String password)
Set the database password.

Parameters:
password -

getCsvDelimiter

public char getCsvDelimiter()
Get the CSV delimiter.

Returns:

setCsvDelimiter

public void setCsvDelimiter(char csvDelimiter)
Set the CSV delimiter.

Parameters:
csvDelimiter -

isCsvHeaderPresent

public boolean isCsvHeaderPresent()
Indicate if the CSV header is to be present.

Returns:

setCsvHeaderPresent

public void setCsvHeaderPresent(boolean csvHeaderPresent)
Set if the CSV header is to be present.

Parameters:
csvHeaderPresent -

getCsvQuoteCharacter

public char getCsvQuoteCharacter()
Get the CSV quote character.

Returns:

setCsvQuoteCharacter

public void setCsvQuoteCharacter(char csvQuoteCharacter)
Set the CSV quote character.

Parameters:
csvQuoteCharacter -

getSqlParameter

public java.lang.String getSqlParameter(java.lang.String name)
Get the SQL parameter by its name.

Parameters:
name -
Returns:

setSqlParameter

public void setSqlParameter(java.lang.String name,
                            java.lang.String value)
Set the SQL parameter by its name.

Parameters:
name -
value -

init

public void init(com.taleo.ws.integration.client.GlobalConfig config)
Overrides:
init in class BaseCustomStep

execute

public void execute(com.taleo.ws.integration.client.Pipeline pipeline)
             throws com.taleo.integration.client.step.StepException
Throws:
com.taleo.integration.client.step.StepException

execute

public void execute(java.io.File outFile)
             throws java.lang.Exception
Execute the step and write result in the given file.

Throws:
java.lang.Exception

prepareQuery

protected java.lang.String prepareQuery(java.lang.String query,
                                        java.util.Properties parameters)
Prepare the query by stripping any ";" ending character and resolving named parameters.

Parameters:
query -
Returns: