Package org.apache.camel.attachment
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 TypeMethodDescriptionvoid
addAttachment
(String id, jakarta.activation.DataHandler content) Adds an attachment to the message using the idvoid
addAttachmentObject
(String id, Attachment content) Adds an attachment to the message using the idjakarta.activation.DataHandler
getAttachment
(String id) Returns the attachment specified by the idReturns a set of attachment names of the messageReturns the attachment specified by the idReturns all attachments of the messageReturns all attachments of the messageboolean
Returns whether this message has attachments.void
Removes the attachment specified by the idvoid
setAttachmentObjects
(Map<String, Attachment> attachments) Set all the attachments associated with this messagevoid
setAttachments
(Map<String, jakarta.activation.DataHandler> attachments) Set all the attachments associated with this messageMethods 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
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
Returns the attachment specified by the id- Parameters:
id
- the id under which the attachment is stored- Returns:
- the attachment or null
-
getAttachmentNames
Returns a set of attachment names of the message- Returns:
- a set of attachment names
-
removeAttachment
Removes the attachment specified by the id- Parameters:
id
- the id of the attachment to remove
-
addAttachment
Adds an attachment to the message using the id- Parameters:
id
- the id to store the attachment undercontent
- the data handler for the attachment
-
addAttachmentObject
Adds an attachment to the message using the id- Parameters:
id
- the id to store the attachment undercontent
- the attachment
-
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
Set all the attachments associated with this message- Parameters:
attachments
- the attachments
-
setAttachmentObjects
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.
-