org.openadaptor.adaptor.standard
Class DOWrapperPipe
java.lang.Object
org.openadaptor.adaptor.SimpleComponent
org.openadaptor.adaptor.AbstractSimplePipe
org.openadaptor.adaptor.standard.DOWrapperPipe
- All Implemented Interfaces:
- CallbackProvider, Component, Configurable, IbafTransactionalResource, Sink, DOMessageReaderDelegate
public class DOWrapperPipe
- extends AbstractSimplePipe
takes each DataObject from the message and "wraps" each one as the payload
inside another DataObject. The attributes of the wrapper DataObject are
defined in the properties file. Additionally, the original DataObject's type
is stored as an attribute of the new DataObject.
Unless overridden in the properties file, the original DataObject is stored
in the "payload" attribute of the wrapper. Note that if you define a similarly
named attribute int he properties file then it's value will be overwritten.
- Author:
- Russ Fennell
Field Summary |
(package private) java.lang.Object[] |
_newAttributes
array of the new attributes to be added to the wrapper DataObject |
(package private) SimpleDataObject |
_wrapper
reference to the current wrapper DataObject |
(package private) static org.apache.log4j.Logger |
log
|
Method Summary |
void |
init(java.lang.String name,
java.util.Properties properties,
java.lang.String propsPrefix,
Controller controller)
initialises the pipe. |
protected DataObject[] |
transformDataObjects(DataObject[] inDobs)
returns an array of DataObjects that is made up of the original DataObjects
wrapped inside an wrapper DataObject whose new attributes are based on the
definitions in the properties file. |
Methods inherited from class org.openadaptor.adaptor.SimpleComponent |
addCallback, cleanUp, customControl, didReceiveMessage, getCallbackManager, getCurrentState, getCustomControlProperties, getLastUID, getName, getProperty, getProperty, getPropsPrefix, getRequestedState, getSecurityManager, getStatus, getTextEncoding, getXMLFormatter, notifyEvent, pause, removeCallback, resume, setCallbackManager, setCallbackManager, setCurrentState, setFromProperties, setFromResource, setName, setPropsPrefix, setRequestedState, terminate, txnBegin, txnCommit, txnCommitWithExceptions, txnRollback, txnRollback, waitForRequestedStateChange |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.openadaptor.adaptor.Component |
cleanUp, customControl, getName, getPropsPrefix, getRequestedState, getStatus, pause, resume, setName, setPropsPrefix, terminate |
log
static org.apache.log4j.Logger log
_wrapper
SimpleDataObject _wrapper
- reference to the current wrapper DataObject
_newAttributes
java.lang.Object[] _newAttributes
- array of the new attributes to be added to the wrapper DataObject
DOWrapperPipe
public DOWrapperPipe()
init
public void init(java.lang.String name,
java.util.Properties properties,
java.lang.String propsPrefix,
Controller controller)
throws IbafException
- initialises the pipe. Gets any wrapper attributes, the DataObject type to filter
by and the name of the attribute that will hold the incoming DataObject as the
payload.
- Specified by:
init
in interface Component
- Overrides:
init
in class AbstractSimplePipe
- Parameters:
name
- the adaptor nameproperties
- reference to the properties filepropsPrefix
- property tag prefix made up of adaptor and component namescontroller
- reference to the adaptor controller
- Throws:
IbafException
- See Also:
AbstractSimpleSink.init(String,Properties,String,Controller)
,
CheckMandatory.init(String,Properties,String,Controller)
transformDataObjects
protected DataObject[] transformDataObjects(DataObject[] inDobs)
throws PipelineException
- returns an array of DataObjects that is made up of the original DataObjects
wrapped inside an wrapper DataObject whose new attributes are based on the
definitions in the properties file.
- Specified by:
transformDataObjects
in class AbstractSimplePipe
- Parameters:
inDobs
- array of DataOBjects to be modified
- Returns:
- the array of wrapper DataObjects
- Throws:
PipelineException
- See Also:
AbstractSimplePipe.processMessage(Message)