Package org.talend.transform.camel

# Class TdmProcessor

java.lang.Object
org.talend.transform.camel.TdmProcessor

All Implemented Interfaces:
  `AutoCloseable`, `org.apache.camel.Processor`, `org.apache.camel.Service`

public class TdmProcessor extends Object implements org.apache.camel.Processor, org.apache.camel.Service
TdmProcessor executes an TDM map. This can be used directly in a Camel route using the `process` method, or can be used in conjunction of the `TdmComponent` and `TdmEndpoint` using the `to` method and providing a URI. See the runtime manual for further information. If used directly, set the necessary properties, i.e. MapPath before executing the `process(Exchange)` method.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected org.talend.transform.runtime.common.SeverityLevel`
`_exceptionThreshold`
What severity level returned from map execution causes this processor to fail.
`protected String`
`_mapPath`
Path to the map that this processor executes
`protected int`
`_outputType`
Type of output requested (one of the OUTPUT_INT_xxx constants)
`static final String`
`EXECUTION_STATUS`
The name of the property in the `Exchange` that contains the `ExecutionStatus` object if it has anything interesting.
`static final String`
`OUTPUT_BYTE_ARRAY`
Byte array output.
`static final String`
`OUTPUT_DEFAULT`
The output is the same as the input, or a Java object if the map is specified that way.
`static final String`
`OUTPUT_INPUT_STREAM`
The output is an InputStream
`protected static final int`
`OUTPUT_INT_BYTE_ARRAY`
`protected static final int`
`OUTPUT_INT_DEFAULT`
`protected static final int`
`OUTPUT_INT_INPUT_STREAM`
`protected static final int`
`OUTPUT_INT_OBJECT`
`protected static final int`
`OUTPUT_INT_STRING`
`static final String`
`OUTPUT_OBJECT`
The output is an Object
`static final String`
`OUTPUT_STRING`
String output.
`static final String`
`THRESHOLD_ERROR`
Throw exception if is the execution status is ERROR or higher.
`static final String`
`THRESHOLD_FATAL`
Throw exception if is the execution status is FATAL or higher.
`static final String`
`THRESHOLD_WARNING`
Throw exception if is the execution status is WARNING or higher.

## Constructor Summary

Constructors
Constructor
Description
`TdmProcessor(String mapPath)`
Creates an TdmProcessor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getCid()`
`String`
`getExceptionThreshold()`
Return the exception threshold.
`String`
`getLoggingLevel()`
`String`
`getMapPath()`
Return the path of the map to execute.
`String`
`getOutputType()`
Return the output type.
`String`
`getVersion()`
`boolean`
`isAllowJavaCall()`
`boolean`
`isRequiresDSQLRuntime()`
`boolean`
`isRequiresEclipseRuntime()`
`boolean`
`isTerminal()`
`void`
`process(org.apache.camel.Exchange exchange)`
Transform the input message of the given `Exchange`.
`void`
`setAllowJavaCall(boolean allowJavaCall)`
`void`
`setCid(String cId)`
`void`
`setExceptionThreshold(String t)`
Set the exception threshold.
`void`
`setExchangeSourceElemPath(String exchangeSourceElemPath)`
`void`
`setLoggingLevel(String loggingLevel)`
`void`
`setMapPath(String mapPath)`
Set the path of the map to execute.
`void`
`setOutputType(String outputType)`
Set the output type.
`void`
`setRequiresDSQLRuntime(boolean requiresDSQLRuntime)`
`void`
`setRequiresEclipseRuntime(boolean requiresEclipseRuntime)`
`void`
`setTerminal(boolean isTerminal)`
`void`
`setVersion(String version)`
`void`
`start()`
Starts and prepares the map to be executed by this processor.
`void`
`stop()`
Stops the processor so that maps can no longer be executed.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.camel.Service

`build, close, init`

## Field Details

### EXECUTION_STATUS

public static final String EXECUTION_STATUS
The name of the property in the `Exchange` that contains the `ExecutionStatus` object if it has anything interesting.

See Also:
  - Constant Field Values

### THRESHOLD_WARNING

public static final String THRESHOLD_WARNING
Throw exception if is the execution status is WARNING or higher.

See Also:
  - Constant Field Values

### THRESHOLD_ERROR

public static final String THRESHOLD_ERROR
Throw exception if is the execution status is ERROR or higher.

See Also:
  - Constant Field Values

### THRESHOLD_FATAL

public static final String THRESHOLD_FATAL
Throw exception if is the execution status is FATAL or higher.

See Also:
  - Constant Field Values

### OUTPUT_DEFAULT

public static final String OUTPUT_DEFAULT
The output is the same as the input, or a Java object if the map is specified that way.

See Also:
  - Constant Field Values

### OUTPUT_STRING

public static final String OUTPUT_STRING
String output.

See Also:
  - Constant Field Values

### OUTPUT_BYTE_ARRAY

public static final String OUTPUT_BYTE_ARRAY
Byte array output.

See Also:
  - Constant Field Values

### OUTPUT_INPUT_STREAM

public static final String OUTPUT_INPUT_STREAM
The output is an InputStream

See Also:
  - Constant Field Values

### OUTPUT_OBJECT

public static final String OUTPUT_OBJECT
The output is an Object

See Also:
  - Constant Field Values

### OUTPUT_INT_DEFAULT

protected static final int OUTPUT_INT_DEFAULT

See Also:
  - Constant Field Values

### OUTPUT_INT_STRING

protected static final int OUTPUT_INT_STRING

See Also:
  - Constant Field Values

### OUTPUT_INT_BYTE_ARRAY

protected static final int OUTPUT_INT_BYTE_ARRAY

See Also:
  - Constant Field Values

### OUTPUT_INT_INPUT_STREAM

protected static final int OUTPUT_INT_INPUT_STREAM

See Also:
  - Constant Field Values

### OUTPUT_INT_OBJECT

protected static final int OUTPUT_INT_OBJECT

See Also:
  - Constant Field Values

### _mapPath

protected String _mapPath
Path to the map that this processor executes

### _outputType

protected int _outputType
Type of output requested (one of the OUTPUT_INT_xxx constants)

### _exceptionThreshold

protected org.talend.transform.runtime.common.SeverityLevel _exceptionThreshold
What severity level returned from map execution causes this processor to fail.

## Constructor Details

### TdmProcessor

public TdmProcessor(String mapPath)
Creates an TdmProcessor.

Parameters:
  `mapPath` - the full path of the map to execute, for example: `//Examples/Maps/PayPal/POPayPal_PO2`
Throws:
  `Exception`

## Method Details

### start

public void start() throws TdmException
Starts and prepares the map to be executed by this processor.

If already started, do nothing

Specified by:
  `start` in interface `org.apache.camel.Service`
Throws:
  `TdmException`

### stop

public void stop() throws TdmException
Stops the processor so that maps can no longer be executed.

Specified by:
  `stop` in interface `org.apache.camel.Service`
Throws:
  `TdmException`

### process

public void process(org.apache.camel.Exchange exchange) throws TdmException
Transform the input message of the given `Exchange`. When this is used directly (not in conjunction with the `TdmComponent`), it will automatically execute the `start()` method to setup the map the first time this method is executed. If there is any warnings or higher in the execution status associated with the map execution, the `EXECUTION_STATUS` property is set to the `ExecutionStatus` object.

Specified by:
  `process` in interface `org.apache.camel.Processor`
Throws:
  `TdmException`

### isRequiresEclipseRuntime

public boolean isRequiresEclipseRuntime()

### setRequiresEclipseRuntime

public void setRequiresEclipseRuntime(boolean requiresEclipseRuntime)

### isRequiresDSQLRuntime

public boolean isRequiresDSQLRuntime()

### setRequiresDSQLRuntime

public void setRequiresDSQLRuntime(boolean requiresDSQLRuntime)

### isAllowJavaCall

public boolean isAllowJavaCall()

### setAllowJavaCall

public void setAllowJavaCall(boolean allowJavaCall)

### getCid

public String getCid()

### setCid

public void setCid(String cId)

### getMapPath

public String getMapPath()
Return the path of the map to execute.

Returns:

### setMapPath

public void setMapPath(String mapPath)
Set the path of the map to execute.

Parameters:
  `mapPath` -

### getVersion

public String getVersion()

### setVersion

public void setVersion(String version)

### getLoggingLevel

public String getLoggingLevel()

### setLoggingLevel

public void setLoggingLevel(String loggingLevel)

### getExceptionThreshold

public String getExceptionThreshold()
Return the exception threshold.

Returns:

### setExceptionThreshold

public void setExceptionThreshold(String t)
Set the exception threshold.

Parameters:
  `t` - the threshold value.

### setOutputType

public void setOutputType(String outputType)
Set the output type.

Parameters:
  `outputType` - the output type value.

### getOutputType

public String getOutputType()
Return the output type.

Returns:

### isTerminal

public boolean isTerminal()

### setTerminal

public void setTerminal(boolean isTerminal)

### setExchangeSourceElemPath

public void setExchangeSourceElemPath(String exchangeSourceElemPath)