Package org.talend.transform.runtime.api

# Interface MapRuntime

All Superinterfaces:
  `MapOrStructRuntime`

public interface MapRuntime extends MapOrStructRuntime
Runtime interface used for map execution. Objects of this type are obtained from the RuntimeEngine class.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`SHUT_IMMEDIATE`
`static final int`
`SHUT_NORMAL`

## Method Summary

Modifier and Type
Method
Description
`String`
`getExecutionStatusMap()`
Returns the path of the map set to process the `ExecutionStatus`.
`Result`
`getRequiredResult(String element)`
Returns the Result object that's used for the specified map element.
`InputStream`
`getResultAsInputStream(MapExecutionContext ec)`
Returns an InputStream object that will execute the map and provide the result data.
`String`
`getRuntimeCodeString(MapExecutionContext ec, boolean optimize)`
Returns the generated underlying engine runtime code associated with this map.
`String`
`getRuntimeCodeString(MapExecutionContext ec, boolean compile, boolean optimize)`
Returns the generated underlying engine runtime code associated with this map.
`String`
`getSampleDocumentPath()`
Returns the path of any sample input document associated with this map.
`void`
`ignoreSkipLinesInput()`
Ignore the skip of lines
`boolean`
`isUseOutputValidation()`
Returns true if the output of the map is validated.
`boolean`
`isUseStructValidation()`
Returns true if the structure constraints are validated on the map.
`ExecutionStatus`
`prepare()`
Prepares the map for execution by validating it and compiling it.
`ExecutionStatus`
`prepare(MapExecutionContext ec)`
Prepares the map for execution by validating it and compiling it.
`boolean`
`requiresJavaInput()`
Returns true if this map requires a Java object as input.
`boolean`
`requiresJavaOutput()`
Returns true if this map requires a Java object as output.
`ExecutionStatus`
`run(Source source, Result result)`
Executes this map.
`void`
`runAsync(MapExecutionContext ec)`
Executes the map in asynchronous mode one time.
`void`
`runAsyncForever(MapExecutionContext ec)`
Executes the map in asynchronous mode until shutdown.
`void`
`setExecutionStatusMap(String path)`
Sets the map that is to be executed to process the `ExecutionStatus` from all executions of this map.
`void`
`shutdown(int options)`
Terminates this currently executing map.
`ExecutionStatus`
`validate()`
Validates this map against any inherited maps and their structures.

### Methods inherited from interface org.talend.transform.runtime.api.MapOrStructRuntime

`getName, getRelativeName, run, validate`

## Field Details

### SHUT_NORMAL

static final int SHUT_NORMAL

See Also:
  - Constant Field Values

### SHUT_IMMEDIATE

static final int SHUT_IMMEDIATE

See Also:
  - Constant Field Values

## Method Details

### isUseStructValidation

boolean isUseStructValidation()
Returns true if the structure constraints are validated on the map.

### isUseOutputValidation

boolean isUseOutputValidation()
Returns true if the output of the map is validated. The validation is with the structure contstraints iff #isUseStructValidation() is set.

### getRuntimeCodeString

String getRuntimeCodeString(MapExecutionContext ec, boolean optimize)
Returns the generated underlying engine runtime code associated with this map. The code is not compiled.

### getRuntimeCodeString

String getRuntimeCodeString(MapExecutionContext ec, boolean compile, boolean optimize)
Returns the generated underlying engine runtime code associated with this map. For the XQuery engine, this will be XQuery. For other types of engines it will be specific to the engine. This is intended for diagnostic purposes only. The generated code can be compiled or not according to the specified option.

### validate

ExecutionStatus validate()
Validates this map against any inherited maps and their structures. Returns the results in the Results object. This is an optional step which is done when the map is first executed with a run method, however this may be done to check that there are no errors without running the map.

Returns:
  ExecutionStatus

### prepare

ExecutionStatus prepare()
Prepares the map for execution by validating it and compiling it. This is an optional step that is done when the map is first executed with a run method. As this step may take a second or more, in cases where you can't tolerate that delay the first time the map is run, use this method.

Returns:
  ExecutionStatus

### prepare

ExecutionStatus prepare(MapExecutionContext ec)
Prepares the map for execution by validating it and compiling it. This is an optional step that is done when the map is first executed with a run method. As this step may take a second or more, in cases where you can't tolerate that delay the first time the map is run, use this method. This version has the MapExecutionContext which could be neccessary when using map execution properties for databases. When the map is prepared, the databases are connected to read the metadata, so if the database definition uses map execution properties, e.g. ${context.hostname}, then they must be provided here if the prepare() method is used.

Returns:
  ExecutionStatus

### run

ExecutionStatus run(Source source, Result result)
Executes this map. Returns the results in the Results object.

Returns:
  ExecutionStatus

### runAsync

void runAsync(MapExecutionContext ec)
Executes the map in asynchronous mode one time.

### runAsyncForever

void runAsyncForever(MapExecutionContext ec)
Executes the map in asynchronous mode until shutdown. Used for maps that produce events

### getResultAsInputStream

InputStream getResultAsInputStream(MapExecutionContext ec)
Returns an InputStream object that will execute the map and provide the result data. This works only if the map result is a StreamResult.

Returns:

### setExecutionStatusMap

void setExecutionStatusMap(String path)
Sets the map that is to be executed to process the `ExecutionStatus` from all executions of this map. This may be overridden in the `MapExecutionContext`.

Parameters:
  `path` - the path of the map to process the execution status. Follows the same path rules as
  invalid @link

      {@link RuntimeEngine.getMapRuntime()

  }.

### getExecutionStatusMap

String getExecutionStatusMap()
Returns the path of the map set to process the `ExecutionStatus`. @see setExecutionStatusMap().

Returns:
  the path of the map

### shutdown

void shutdown(int options)
Terminates this currently executing map. This is used only for maps that are driven by events.

### getSampleDocumentPath

String getSampleDocumentPath()
Returns the path of any sample input document associated with this map.

Returns:
  a fully qualified path, that begins with the project of the sample document associated with the map, or null if there is no sample document.

### requiresJavaInput

boolean requiresJavaInput()
Returns true if this map requires a Java object as input. This is used to tell an ESB to get the Java object from the message if that's available.

Returns:
  true if a Java object is required as the input.

### requiresJavaOutput

boolean requiresJavaOutput()
Returns true if this map requires a Java object as output.

Returns:
  true if a Java object is required as the output.

### getRequiredResult

Result getRequiredResult(String element)
Returns the Result object that's used for the specified map element. Used in conjunction with the
invalid @link

    {@link MapExecutionContext.addOutputResult()

} method.

Parameters:
  `element` - an element path for an output element that has an I/O expression.
Returns:
  a `Result` object of the correct type.

### ignoreSkipLinesInput

void ignoreSkipLinesInput()
Ignore the skip of lines