public abstract class ATransformationPipelet extends java.lang.Object implements Pipelet
Modifier and Type | Field and Description |
---|---|
protected AnyMap |
_config
the configuration.
|
protected Log |
_log
local logger.
|
static java.lang.String |
ENCODING_ATTACHMENT
encoding to use for storing results as attachments.
|
static java.lang.String |
PROP_INPUT_NAME
Name of the input Attribute/Attachment.
|
static java.lang.String |
PROP_INPUT_TYPE
The type of the inputName: Attribute/Attachment.
|
static java.lang.String |
PROP_OUTPUT_NAME
Name of the output Attribute/Attachment.
|
static java.lang.String |
PROP_OUTPUT_TYPE
The type of the inputName: Attribute/Attachment.
|
static java.lang.String |
PROP_OUTPUT_VALUE_TYPE |
Constructor and Description |
---|
ATransformationPipelet() |
Modifier and Type | Method and Description |
---|---|
void |
configure(AnyMap configuration)
set configuration of pipelet. called once after instantiation before the pipelet is actually used in a workflow.
|
java.lang.String |
getInputName(ParameterAccessor paramAccessor) |
protected java.io.InputStream |
getInputStream(Blackboard blackboard,
java.lang.String id,
ParameterAccessor paramAccessor)
Reads input data from the Blackboard as InputStream.
|
SourceType |
getInputType(ParameterAccessor paramAccessor) |
java.lang.String |
getOutputName(ParameterAccessor paramAccessor) |
SourceType |
getOutputType(ParameterAccessor paramAccessor) |
Any.ValueType |
getOutputValueType(ParameterAccessor paramAccessor) |
boolean |
isReadFromAttribute(SourceType inputType)
Checks if to read the input from an Attribute.
|
boolean |
isStoreInAttribute(SourceType outputType)
Checks if to store the output in an Attribute.
|
protected byte[] |
readInput(Blackboard blackboard,
java.lang.String id,
ParameterAccessor paramAccessor)
Reads input data from the Blackboard as byte[].
|
protected java.lang.String |
readStringInput(Blackboard blackboard,
java.lang.String id,
ParameterAccessor paramAccessor)
Reads input data from the Blackboard as a String.
|
protected void |
storeResult(Blackboard blackboard,
java.lang.String id,
byte[] bytes,
ParameterAccessor paramAccessor)
Stores result byte[] on the blackboard.
|
protected void |
storeResult(Blackboard blackboard,
java.lang.String id,
java.io.InputStream resultStream,
ParameterAccessor paramAccessor)
store result from a stream on the blackboard.
|
protected void |
storeResult(Blackboard blackboard,
java.lang.String id,
java.lang.String result,
ParameterAccessor paramAccessor)
store result strings on the blackboard.
|
protected void |
storeResults(Blackboard blackboard,
java.lang.String id,
java.util.Collection<java.lang.String> results,
ParameterAccessor paramAccessor)
store result strings on the blackboard.
|
public static final java.lang.String PROP_INPUT_TYPE
public static final java.lang.String PROP_OUTPUT_TYPE
public static final java.lang.String PROP_OUTPUT_VALUE_TYPE
public static final java.lang.String PROP_INPUT_NAME
public static final java.lang.String PROP_OUTPUT_NAME
public static final java.lang.String ENCODING_ATTACHMENT
protected final Log _log
protected AnyMap _config
public void configure(AnyMap configuration) throws ProcessingException
configure
in interface Pipelet
configuration
- configuration of pipelet.ProcessingException
- configuration is not applicable for pipelet (missing properties, wrong datatypes)public SourceType getInputType(ParameterAccessor paramAccessor) throws MissingParameterException
MissingParameterException
public java.lang.String getInputName(ParameterAccessor paramAccessor) throws MissingParameterException
MissingParameterException
public SourceType getOutputType(ParameterAccessor paramAccessor) throws MissingParameterException
MissingParameterException
public Any.ValueType getOutputValueType(ParameterAccessor paramAccessor) throws MissingParameterException
MissingParameterException
public java.lang.String getOutputName(ParameterAccessor paramAccessor) throws MissingParameterException
MissingParameterException
public boolean isReadFromAttribute(SourceType inputType)
public boolean isStoreInAttribute(SourceType outputType)
protected void storeResult(Blackboard blackboard, java.lang.String id, java.lang.String result, ParameterAccessor paramAccessor) throws ProcessingException
blackboard
- blackboardid
- record idresult
- result stringProcessingException
- error.protected void storeResult(Blackboard blackboard, java.lang.String id, java.io.InputStream resultStream, ParameterAccessor paramAccessor) throws ProcessingException
blackboard
- blackboardid
- record idresultStream
- result streamProcessingException
- error.protected void storeResults(Blackboard blackboard, java.lang.String id, java.util.Collection<java.lang.String> results, ParameterAccessor paramAccessor) throws ProcessingException, BlackboardAccessException
blackboard
- blackboardid
- record idresults
- result stringsProcessingException
- error.BlackboardAccessException
- error.protected void storeResult(Blackboard blackboard, java.lang.String id, byte[] bytes, ParameterAccessor paramAccessor) throws java.lang.Exception
blackboard
- the Blackboardid
- the Id of the recordbytes
- the byte[] to savejava.lang.Exception
- if any error occursprotected byte[] readInput(Blackboard blackboard, java.lang.String id, ParameterAccessor paramAccessor) throws BlackboardAccessException, java.io.UnsupportedEncodingException, MissingParameterException
blackboard
- the Blackboardid
- the Id of the recordBlackboardAccessException
- if any error occursjava.io.UnsupportedEncodingException
- if converting string to bytes failsMissingParameterException
protected java.lang.String readStringInput(Blackboard blackboard, java.lang.String id, ParameterAccessor paramAccessor) throws BlackboardAccessException, java.io.UnsupportedEncodingException, MissingParameterException
blackboard
- the Blackboardid
- the Id of the recordBlackboardAccessException
- if any error occursjava.io.UnsupportedEncodingException
- if converting bytes to string failsMissingParameterException
protected java.io.InputStream getInputStream(Blackboard blackboard, java.lang.String id, ParameterAccessor paramAccessor) throws BlackboardAccessException, java.io.UnsupportedEncodingException, MissingParameterException
blackboard
- the Blackboardid
- the Id of the recordBlackboardAccessException
- if any error occursjava.io.UnsupportedEncodingException
- if converting string to bytes failsMissingParameterException