Class 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 Detail

      • AddPayloadService

        public AddPayloadService()
    • 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 underlying Exceptions
      • prepare

        public void prepare()
        Prepare for initialisation..