Interface MultiPayloadAdaptrisMessage

    • Field Detail

      • DEFAULT_PAYLOAD_ID

        static final java.lang.String DEFAULT_PAYLOAD_ID
        The ID to use for the default payload.
        See Also:
        Constant Field Values
    • Method Detail

      • switchPayload

        void switchPayload​(@NotNull
                           @NotNull java.lang.String id)
        Switch from one payload to another, given by the ID.
        Parameters:
        id - The ID of the payload to switch to.
      • hasPayloadId

        boolean hasPayloadId​(@NotNull
                             @NotNull java.lang.String id)
        Indicates whether the given payload ID exists in the message.
        Parameters:
        id - The payload ID to check.
        Returns:
        True if there's a payload with the given ID, false otherwise.
      • getCurrentPayloadId

        java.lang.String getCurrentPayloadId()
        Get the ID of the current payload.
        Returns:
        The payload ID.
      • getPayloadIDs

        java.util.Set<java.lang.String> getPayloadIDs()
        Get the payload IDs used within this message.
        Returns:
        The payload IDs.
      • setCurrentPayloadId

        void setCurrentPayloadId​(@NotNull
                                 @NotNull java.lang.String id)
        Update the ID of the current payload. This does not change the current working payload, rather updates the ID of the current working payload.
        Parameters:
        id - The new payload ID.
      • addPayload

        void addPayload​(@NotNull
                        @NotNull java.lang.String id,
                        byte[] payload)
        Add a new payload to the message, with the given ID and data.
        Parameters:
        id - The new payload ID.
        payload - The payload data.
      • deletePayload

        void deletePayload​(@NotNull
                           @NotNull java.lang.String id)
        Delete an existing payload, with the given payload ID.
        Parameters:
        id - The payload ID.
      • getPayload

        byte[] getPayload​(@NotNull
                          @NotNull java.lang.String id)
        Get the payload data for the given ID.
        Parameters:
        id - The payload ID.
        Returns:
        The payload data.
      • getSize

        long getSize​(@NotNull
                     @NotNull java.lang.String id)
        Get the size of the payload for the given ID.
        Parameters:
        id - The payload ID.
        Returns:
        The payload size.
      • getPayloadCount

        int getPayloadCount()
        Return the number of payloads contained within the message.
        Returns:
        The number of payloads.
      • addContent

        void addContent​(@NotNull
                        @NotNull java.lang.String id,
                        java.lang.String content)
        Add a new payload to the message, with the given ID and content.
        Parameters:
        id - The new payload ID.
        content - The payload content.
      • addContent

        void addContent​(@NotNull
                        @NotNull java.lang.String id,
                        java.lang.String content,
                        java.lang.String encoding)
        Add a new payload to the message, with the given ID and content and encoding.
        Parameters:
        id - The new payload ID.
        content - The payload content.
        encoding - The content encoding.
      • setContent

        void setContent​(@NotNull
                        @NotNull java.lang.String id,
                        java.lang.String content,
                        java.lang.String encoding)
        Add a new payload to the message, with the given ID and content and encoding.
        Parameters:
        id - The new payload ID.
        content - The payload content.
        encoding - The content encoding.
      • getContent

        java.lang.String getContent​(@NotNull
                                    @NotNull java.lang.String id)
        Get the payload content for the given ID.
        Parameters:
        id - The payload ID.
        Returns:
        The payload content.
      • setContentEncoding

        void setContentEncoding​(@NotNull
                                @NotNull java.lang.String id,
                                java.lang.String encoding)
        Set the payload content encoding for the given payload ID.
        Parameters:
        id - The payload ID.
        encoding - The content encoding.
      • getContentEncoding

        java.lang.String getContentEncoding​(@NotNull
                                            @NotNull java.lang.String id)
        Get the content encoding for the given payload ID.
        Parameters:
        id - The payload ID.
        Returns:
        The content encoding.
      • getInputStream

        java.io.InputStream getInputStream​(@NotNull
                                           @NotNull java.lang.String id)
        Get the input stream for the given payload ID.
        Parameters:
        id - The payload ID.
        Returns:
        The payload input stream.
      • getOutputStream

        java.io.OutputStream getOutputStream​(@NotNull
                                             @NotNull java.lang.String id)
        Get the output stream for the given payload ID.
        Parameters:
        id - The payload ID.
        Returns:
        The payload output stream.
      • getWriter

        java.io.Writer getWriter​(@NotNull
                                 @NotNull java.lang.String id)
                          throws java.io.IOException
        Return a writer ready for writing the payload for the given payload ID.
        Specified by:
        getWriter in interface InterlokMessage
        Parameters:
        id - The payload ID.
        Returns:
        an Writer that can be used to write the payload using the existing encoding.
        Throws:
        java.io.IOException - if the Writer could not be created.
      • getWriter

        java.io.Writer getWriter​(@NotNull
                                 @NotNull java.lang.String id,
                                 java.lang.String encoding)
                          throws java.io.IOException
        Return a writer ready for writing the payload for the given payload ID.
        Parameters:
        id - The payload ID.
        encoding - The payload encoding.
        Returns:
        an Writer that can be used to write the payload using the existing encoding.
        Throws:
        java.io.IOException - if the Writer could not be created.