com.taleo.integration.client.customstep.http
Class HttpPostPostStep

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.http.HttpPostPostStep
All Implemented Interfaces:
com.taleo.integration.client.step.CustomStep, com.taleo.integration.client.step.Step

public class HttpPostPostStep
extends BaseCustomStep

Post-processing step to HTTP Post the current workflow file or other files corresponding to a pattern.

The result of this step is a file containing each HTTP Post response, in the following structure:

 <HTTPPosts>
   <HTTPPost filename="" url="">
     <Request>
       <Headers>
         <Header name="" value=""/>
         ...
       </Headers>
       <Body>
       ...
       </Body>
     </Request>
     <Response status="">
       <Headers>
         <Header name="" value=""/>
         ...
       </Headers>
       <Body>
       ...
       </Body>
     </Response>
   </HTTPPost>
   ...
 </HTTPPosts>
 
Response status corresponds to HTTP status codes.

This file becomes current in the pipeline at the end of the step.

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

This class is dependent on:

Here are two examples 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
HttpPostPostStep()
          Constructor without arguments.
 
Method Summary
protected  org.w3c.dom.Document doHttpPost(java.io.File file, java.lang.String url)
          HTTP Post the file.
 void execute(com.taleo.ws.integration.client.Pipeline pipeline)
           
 java.lang.String getDescription()
           
 java.lang.String getFilePattern()
          Get the file pattern.
 java.lang.String getHeader(java.lang.String name)
          Get the header by its name.
 java.lang.String getIdentifier()
           
 java.lang.String getMoveFolder()
          Get the move folder.
 java.lang.String getName()
           
 int getNbRetries()
          Get the number of retries.
 java.lang.String getPassword()
          Get the HTTP password.
 int getRetryFactor()
          Get the retry factor.
 int getRetryInterval()
          Get the retry interval, in seconds.
 com.taleo.ws.integration.client.SupportedPipeline getSupportedPipeline()
           
 java.lang.String getURL()
          Get the URL.
 java.lang.String getUsername()
          Get the HTTP username.
 org.w3c.dom.Document httpPost(java.io.File pattern)
          HTTP Post the files corresponding to the file pattern.
 void init(com.taleo.ws.integration.client.GlobalConfig config)
           
 void setFilePattern(java.lang.String filePattern)
          Set the file pattern.
 void setHeader(java.lang.String name, java.lang.String value)
          Set the header by its name.
 void setMoveFolder(java.lang.String moveFolder)
          Set the move folder.
 void setNbRetries(int nbRetries)
          Set the number of retries.
 void setPassword(java.lang.String password)
          Set the HTTP password.
 void setRetryFactor(int retryFactor)
          Set the retry factor.
 void setRetryInterval(int retryInterval)
          Set the retry interval, in seconds.
 void setURL(java.lang.String url)
          Set the URL.
 void setUsername(java.lang.String username)
          Set the HTTP username.
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
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

HttpPostPostStep

public HttpPostPostStep()
Constructor without arguments.

Method Detail

validateParameterNames

protected void validateParameterNames()
Validate the parameters names.

Override the default method to allow for HTTP headers to be passed.

Overrides:
validateParameterNames in class BaseCustomStep

getURL

public java.lang.String getURL()
Get the URL.

Returns:

setURL

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

Parameters:
url -

getPassword

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

Returns:

setPassword

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

Parameters:
password -

getFilePattern

public java.lang.String getFilePattern()
Get the file pattern.

Returns:

setFilePattern

public void setFilePattern(java.lang.String filePattern)
Set the file pattern.

Parameters:
filePattern -

getMoveFolder

public java.lang.String getMoveFolder()
Get the move folder.

Returns:

setMoveFolder

public void setMoveFolder(java.lang.String moveFolder)
Set the move folder.

Parameters:
moveFolder -

getUsername

public java.lang.String getUsername()
Get the HTTP username.

Returns:

setUsername

public void setUsername(java.lang.String username)
Set the HTTP username.

Parameters:
username -

getNbRetries

public int getNbRetries()
Get the number of retries.

Returns:

setNbRetries

public void setNbRetries(int nbRetries)
Set the number of retries.

Parameters:
nbRetries -

getRetryInterval

public int getRetryInterval()
Get the retry interval, in seconds.

Returns:

setRetryInterval

public void setRetryInterval(int retryInterval)
Set the retry interval, in seconds.

Parameters:
retryInterval -

getRetryFactor

public int getRetryFactor()
Get the retry factor.

Returns:

setRetryFactor

public void setRetryFactor(int retryFactor)
Set the retry factor.

Parameters:
retryFactor -

getHeader

public java.lang.String getHeader(java.lang.String name)
Get the header by its name.

Parameters:
name -
Returns:

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String value)
Set the header by its name.

Parameters:
name -
value -

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

getSupportedPipeline

public com.taleo.ws.integration.client.SupportedPipeline getSupportedPipeline()
Specified by:
getSupportedPipeline in interface com.taleo.integration.client.step.Step
Overrides:
getSupportedPipeline in class com.taleo.integration.client.step.BaseCustomStep

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

httpPost

public org.w3c.dom.Document httpPost(java.io.File pattern)
                              throws java.io.IOException
HTTP Post the files corresponding to the file pattern.

Parameters:
pattern - The file pattern.
Returns:
A DOM Document containing the requests and responses, with the following structure:
 <HTTPPosts>
   <HTTPPost>
        ...
   </HTTPPost>
   ...
 </HTTPPosts>
 
Throws:
java.io.IOException

doHttpPost

protected org.w3c.dom.Document doHttpPost(java.io.File file,
                                          java.lang.String url)
                                   throws java.io.IOException
HTTP Post the file.

Parameters:
file - The file to post.
url - The URL to post to.
Returns:
A DOM Document containing the request and response, with the following structure:
   <HTTPPost>
        ...
   </HTTPPost>
 
Throws:
java.io.IOException