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
ExtendedMessage
for Java Attachment Support (with javax.activation).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addAttachment(String id, DataHandler content)
Adds an attachment to the message using the idvoid
addAttachmentObject(String id, Attachment content)
Adds an attachment to the message using the idDataHandler
getAttachment(String id)
Returns the attachment specified by the idSet<String>
getAttachmentNames()
Returns a set of attachment names of the messageAttachment
getAttachmentObject(String id)
Returns the attachment specified by the idMap<String,Attachment>
getAttachmentObjects()
Returns all attachments of the messageMap<String,DataHandler>
getAttachments()
Returns all attachments of the messageboolean
hasAttachments()
Returns whether this message has attachments.void
removeAttachment(String id)
Removes the attachment specified by the idvoid
setAttachmentObjects(Map<String,Attachment> attachments)
Set all the attachments associated with this messagevoid
setAttachments(Map<String,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, hasHeaders, hasMessageId, removeHeader, removeHeaders, removeHeaders, reset, setBody, setBody, setHeader, setHeaders, setMessageId
-
-
-
-
Method Detail
-
getAttachment
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, DataHandler content)
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
void addAttachmentObject(String id, Attachment content)
Adds an attachment to the message using the id- Parameters:
id
- the id to store the attachment undercontent
- the attachment
-
getAttachments
Map<String,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,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.
-
-