Package com.adaptris.core
Class AddPayloadService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.AddPayloadService
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="Add a new payload to a multi-payload message", tag="multi-payload,multi,payload,add") public class AddPayloadService extends ServiceImp
Add a new payload to the message.<add-payload-service> <unique-id>add-payload-unique-id</unique-id> <new-payload-id>payload-2</new-payload-id> <new-payload class="file-data-input-parameter"> <destination class="configured-destination"> <destination><!-- path to file to include as new payload --></destination> </destination> </new-payload> </add-payload-service>
- Since:
- 3.9.x
-
-
Constructor Summary
Constructors Constructor Description AddPayloadService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeService()
.void
doService(AdaptrisMessage msg)
Add a new payload to the message.DataInputParameter<java.lang.String>
getNewPayload()
Get the source of the new payload.java.lang.String
getNewPayloadEncoding()
Get the encoding for the new payload.java.lang.String
getNewPayloadId()
Get the ID of the payload to add.protected void
initService()
.void
prepare()
Prepare for initialisation.void
setNewPayload(DataInputParameter<java.lang.String> newPayload)
Set the source of the new payload.void
setNewPayloadEncoding(java.lang.String newPayloadEncoding)
Set the encoding for the new payload, if it's a String.void
setNewPayloadId(java.lang.String newPayloadId)
Set the ID of the payload to add.-
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
-
-
-
Method Detail
-
setNewPayloadId
public void setNewPayloadId(java.lang.String newPayloadId)
Set the ID of the payload to add.- Parameters:
newPayloadId
- The new payload ID.
-
getNewPayloadId
public java.lang.String getNewPayloadId()
Get the ID of the payload to add.- Returns:
- The new payload ID.
-
setNewPayload
public void setNewPayload(DataInputParameter<java.lang.String> newPayload)
Set the source of the new payload.- Parameters:
newPayload
- The new payload.
-
getNewPayload
public DataInputParameter<java.lang.String> getNewPayload()
Get the source of the new payload.- Returns:
- The new payload.
-
setNewPayloadEncoding
public void setNewPayloadEncoding(java.lang.String newPayloadEncoding)
Set the encoding for the new payload, if it's a String.- Parameters:
newPayloadEncoding
- The payload encoding.
-
getNewPayloadEncoding
public java.lang.String getNewPayloadEncoding()
Get the encoding for the new payload.- Returns:
- The payload encoding.
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
Add a new payload to the message.Apply the service to the message.
.- Parameters:
msg
- The message to which the payload should be added.- Throws:
ServiceException
- wrapping any underlyingException
s
-
initService
protected void initService()
.- Specified by:
initService
in classServiceImp
-
closeService
protected void closeService()
.- Specified by:
closeService
in classServiceImp
-
prepare
public void prepare()
Prepare for initialisation..
-
-