com.taleo.integration.client.customstep.csv
Class AbstractSortStep

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.csv.BaseCustomCsvStep
                  extended by com.taleo.integration.client.customstep.csv.AbstractSortStep
All Implemented Interfaces:
com.taleo.integration.client.step.CustomStep, com.taleo.integration.client.step.Step
Direct Known Subclasses:
HierarchicalSortStep

public abstract class AbstractSortStep
extends BaseCustomCsvStep

Abstract processing step to sort CSV data.

This step takes all parameters from its base class BaseCustomCsvStep.

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
AbstractSortStep()
          Constructor without arguments.
 
Method Summary
 void execute(java.io.File inFile, java.io.File outFile)
          Copy the input file to the output file while applying the required sorting.
 void execute(com.taleo.ws.integration.client.Pipeline pipeline)
           
protected abstract  java.util.Comparator getComparator(java.io.File file)
          Get the comparator for the CSV rows.
 
Methods inherited from class com.taleo.integration.client.customstep.csv.BaseCustomCsvStep
getColumnIndex, getColumnName, getCsvDelimiter, getCsvQuoteCharacter, init, isCsvHeaderPresent, setCsvDelimiter, setCsvHeaderPresent, setCsvQuoteCharacter
 
Methods inherited from class com.taleo.integration.client.customstep.BaseCustomStep
createTempFile, createTempFile, getEncoding, getTempFolder, isActive, registerParameterName, setActive, setEncoding, validateParameterNames
 
Methods inherited from class com.taleo.integration.client.step.BaseCustomStep
getDescription, getIdentifier, getName, 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

AbstractSortStep

public AbstractSortStep()
Constructor without arguments.

Method Detail

execute

public void execute(com.taleo.ws.integration.client.Pipeline pipeline)
             throws com.taleo.integration.client.step.StepException
Specified by:
execute in interface com.taleo.integration.client.step.Step
Overrides:
execute in class BaseCustomCsvStep
Throws:
com.taleo.integration.client.step.StepException

execute

public void execute(java.io.File inFile,
                    java.io.File outFile)
             throws java.io.IOException,
                    InvalidCSVFileFormat
Copy the input file to the output file while applying the required sorting.

Parameters:
inFile - The input file
outFile - The output file
Throws:
java.io.IOException
InvalidCSVFileFormat

getComparator

protected abstract java.util.Comparator getComparator(java.io.File file)
                                               throws java.io.IOException,
                                                      InvalidCSVFileFormat
Get the comparator for the CSV rows.

The comparator must take String[] or List as arguments, each representing a CSV row.

Parameters:
file - The CSV file.
Returns:
Throws:
java.io.IOException
InvalidCSVFileFormat