Interface AttachmentMessage

All Superinterfaces:
org.apache.camel.Message
All Known Implementing Classes:
DefaultAttachmentMessage

public interface AttachmentMessage extends org.apache.camel.Message
Extended Message for Java Attachment Support (with jakarta.activation).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAttachment(String id, jakarta.activation.DataHandler content)
    Adds an attachment to the message using the id
    void
    Adds an attachment to the message using the id
    jakarta.activation.DataHandler
    Returns the attachment specified by the id
    Returns a set of attachment names of the message
    Returns the attachment specified by the id
    Returns all attachments of the message
    Map<String,jakarta.activation.DataHandler>
    Returns all attachments of the message
    boolean
    Returns whether this message has attachments.
    void
    Removes the attachment specified by the id
    void
    Set all the attachments associated with this message
    void
    setAttachments(Map<String,jakarta.activation.DataHandler> attachments)
    Set all the attachments associated with this message

    Methods inherited from interface org.apache.camel.Message

    copy, copyFrom, copyFromWithNewBody, getBody, getBody, getExchange, getHeader, getHeader, getHeader, getHeader, getHeader, getHeader, getHeaders, getMandatoryBody, getMandatoryBody, getMessageId, getMessageTimestamp, getPayloadForTrait, hasHeaders, hasMessageId, hasTrait, removeHeader, removeHeaders, removeHeaders, reset, setBody, setBody, setHeader, setHeaders, setMessageId, setPayloadForTrait
  • Method Details

    • getAttachment

      jakarta.activation.DataHandler getAttachment(String id)
      Returns the attachment specified by the id
      Parameters:
      id - the id under which the attachment is stored
      Returns:
      the data handler for this attachment or null
    • getAttachmentObject

      Attachment getAttachmentObject(String id)
      Returns the attachment specified by the id
      Parameters:
      id - the id under which the attachment is stored
      Returns:
      the attachment or null
    • getAttachmentNames

      Set<String> getAttachmentNames()
      Returns a set of attachment names of the message
      Returns:
      a set of attachment names
    • removeAttachment

      void removeAttachment(String id)
      Removes the attachment specified by the id
      Parameters:
      id - the id of the attachment to remove
    • addAttachment

      void addAttachment(String id, jakarta.activation.DataHandler content)
      Adds an attachment to the message using the id
      Parameters:
      id - the id to store the attachment under
      content - the data handler for the attachment
    • addAttachmentObject

      void addAttachmentObject(String id, Attachment content)
      Adds an attachment to the message using the id
      Parameters:
      id - the id to store the attachment under
      content - the attachment
    • getAttachments

      Map<String,jakarta.activation.DataHandler> getAttachments()
      Returns all attachments of the message
      Returns:
      the attachments in a map or null
    • getAttachmentObjects

      Map<String,Attachment> getAttachmentObjects()
      Returns all attachments of the message
      Returns:
      the attachments in a map or null
    • setAttachments

      void setAttachments(Map<String,jakarta.activation.DataHandler> attachments)
      Set all the attachments associated with this message
      Parameters:
      attachments - the attachments
    • setAttachmentObjects

      void setAttachmentObjects(Map<String,Attachment> attachments)
      Set all the attachments associated with this message
      Parameters:
      attachments - the attachments
    • hasAttachments

      boolean hasAttachments()
      Returns whether this message has attachments.
      Returns:
      true if this message has any attachments.