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 Details

    • AddPayloadService

      public AddPayloadService()
  • Method Details

    • setNewPayloadId

      public void setNewPayloadId(String newPayloadId)
      Set the ID of the payload to add.
      Parameters:
      newPayloadId - The new payload ID.
    • getNewPayloadId

      public String getNewPayloadId()
      Get the ID of the payload to add.
      Returns:
      The new payload ID.
    • setNewPayload

      public void setNewPayload(DataInputParameter<String> newPayload)
      Set the source of the new payload.
      Parameters:
      newPayload - The new payload.
    • getNewPayload

      public DataInputParameter<String> getNewPayload()
      Get the source of the new payload.
      Returns:
      The new payload.
    • setNewPayloadEncoding

      public void setNewPayloadEncoding(String newPayloadEncoding)
      Set the encoding for the new payload, if it's a String.
      Parameters:
      newPayloadEncoding - The payload encoding.
    • getNewPayloadEncoding

      public 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 underlying Exceptions
    • initService

      protected void initService()
      .
      Specified by:
      initService in class ServiceImp
    • closeService

      protected void closeService()
      .
      Specified by:
      closeService in class ServiceImp
    • prepare

      public void prepare()
      Prepare for initialisation..