Package com.adaptris.core
Class AddPayloadService
java.lang.Object
com.adaptris.core.ServiceImp
com.adaptris.core.AddPayloadService
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConfigComment
,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
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
.void
doService
(AdaptrisMessage msg) Add a new payload to the message.Get the source of the new payload.Get the encoding for the new payload.Get the ID of the payload to add.protected void
.void
prepare()
Prepare for initialisation.void
setNewPayload
(DataInputParameter<String> newPayload) Set the source of the new payload.void
setNewPayloadEncoding
(String newPayloadEncoding) Set the encoding for the new payload, if it's a String.void
setNewPayloadId
(String newPayloadId) Set the ID of the payload to add.Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getComments, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setComments, setContinueOnFail, setIsTrackingEndpoint, setUniqueId, start, stop
-
Constructor Details
-
AddPayloadService
public AddPayloadService()
-
-
Method Details
-
setNewPayloadId
Set the ID of the payload to add.- Parameters:
newPayloadId
- The new payload ID.
-
getNewPayloadId
Get the ID of the payload to add.- Returns:
- The new payload ID.
-
setNewPayload
Set the source of the new payload.- Parameters:
newPayload
- The new payload.
-
getNewPayload
Get the source of the new payload.- Returns:
- The new payload.
-
setNewPayloadEncoding
Set the encoding for the new payload, if it's a String.- Parameters:
newPayloadEncoding
- The payload encoding.
-
getNewPayloadEncoding
Get the encoding for the new payload.- Returns:
- The payload encoding.
-
doService
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..
-