Package org.apache.camel.attachment
Class DefaultAttachmentMessage
java.lang.Object
org.apache.camel.attachment.DefaultAttachmentMessage
- All Implemented Interfaces:
AttachmentMessage,org.apache.camel.Message
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttachment(String id, jakarta.activation.DataHandler content) Adds an attachment to the message using the idvoidaddAttachmentObject(String id, Attachment content) Adds an attachment to the message using the idorg.apache.camel.Messagecopy()voidcopyFrom(org.apache.camel.Message message) voidcopyFromWithNewBody(org.apache.camel.Message message, Object newBody) jakarta.activation.DataHandlergetAttachment(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 messagegetBody()<T> Torg.apache.camel.Exchange<T> T<T> T<T> T<T> TgetMandatoryBody(Class<T> type) longgetPayloadForTrait(org.apache.camel.trait.message.MessageTrait trait) booleanReturns whether this message has attachments.booleanbooleanbooleanhasTrait(org.apache.camel.trait.message.MessageTrait trait) voidRemoves the attachment specified by the idremoveHeader(String name) booleanremoveHeaders(String pattern) booleanremoveHeaders(String pattern, String... excludePatterns) voidreset()voidsetAttachmentObjects(Map<String, Attachment> attachments) Set all the attachments associated with this messagevoidsetAttachments(Map<String, jakarta.activation.DataHandler> attachments) Set all the attachments associated with this messagevoid<T> voidvoidvoidsetHeaders(Map<String, Object> headers) voidsetMessageId(String messageId) voidsetPayloadForTrait(org.apache.camel.trait.message.MessageTrait trait, Object object)
-
Constructor Details
-
DefaultAttachmentMessage
public DefaultAttachmentMessage(org.apache.camel.Message delegate)
-
-
Method Details
-
reset
public void reset()- Specified by:
resetin interfaceorg.apache.camel.Message
-
getMessageId
- Specified by:
getMessageIdin interfaceorg.apache.camel.Message
-
setMessageId
- Specified by:
setMessageIdin interfaceorg.apache.camel.Message
-
hasMessageId
public boolean hasMessageId()- Specified by:
hasMessageIdin interfaceorg.apache.camel.Message
-
getMessageTimestamp
public long getMessageTimestamp()- Specified by:
getMessageTimestampin interfaceorg.apache.camel.Message
-
getExchange
public org.apache.camel.Exchange getExchange()- Specified by:
getExchangein interfaceorg.apache.camel.Message
-
getHeader
- Specified by:
getHeaderin interfaceorg.apache.camel.Message
-
getHeader
- Specified by:
getHeaderin interfaceorg.apache.camel.Message
-
getHeader
- Specified by:
getHeaderin interfaceorg.apache.camel.Message
-
getHeader
- Specified by:
getHeaderin interfaceorg.apache.camel.Message
-
getHeader
- Specified by:
getHeaderin interfaceorg.apache.camel.Message
-
getHeader
- Specified by:
getHeaderin interfaceorg.apache.camel.Message
-
setHeader
- Specified by:
setHeaderin interfaceorg.apache.camel.Message
-
removeHeader
- Specified by:
removeHeaderin interfaceorg.apache.camel.Message
-
removeHeaders
- Specified by:
removeHeadersin interfaceorg.apache.camel.Message
-
removeHeaders
- Specified by:
removeHeadersin interfaceorg.apache.camel.Message
-
getHeaders
- Specified by:
getHeadersin interfaceorg.apache.camel.Message
-
setHeaders
- Specified by:
setHeadersin interfaceorg.apache.camel.Message
-
hasHeaders
public boolean hasHeaders()- Specified by:
hasHeadersin interfaceorg.apache.camel.Message
-
getBody
- Specified by:
getBodyin interfaceorg.apache.camel.Message
-
getMandatoryBody
- Specified by:
getMandatoryBodyin interfaceorg.apache.camel.Message- Throws:
org.apache.camel.InvalidPayloadException
-
getBody
- Specified by:
getBodyin interfaceorg.apache.camel.Message
-
getMandatoryBody
- Specified by:
getMandatoryBodyin interfaceorg.apache.camel.Message- Throws:
org.apache.camel.InvalidPayloadException
-
setBody
- Specified by:
setBodyin interfaceorg.apache.camel.Message
-
setBody
- Specified by:
setBodyin interfaceorg.apache.camel.Message
-
copy
public org.apache.camel.Message copy()- Specified by:
copyin interfaceorg.apache.camel.Message
-
copyFrom
public void copyFrom(org.apache.camel.Message message) - Specified by:
copyFromin interfaceorg.apache.camel.Message
-
copyFromWithNewBody
- Specified by:
copyFromWithNewBodyin interfaceorg.apache.camel.Message
-
getAttachment
Description copied from interface:AttachmentMessageReturns the attachment specified by the id- Specified by:
getAttachmentin interfaceAttachmentMessage- Parameters:
id- the id under which the attachment is stored- Returns:
- the data handler for this attachment or null
-
getAttachmentObject
Description copied from interface:AttachmentMessageReturns the attachment specified by the id- Specified by:
getAttachmentObjectin interfaceAttachmentMessage- Parameters:
id- the id under which the attachment is stored- Returns:
- the attachment or null
-
getAttachmentNames
Description copied from interface:AttachmentMessageReturns a set of attachment names of the message- Specified by:
getAttachmentNamesin interfaceAttachmentMessage- Returns:
- a set of attachment names
-
removeAttachment
Description copied from interface:AttachmentMessageRemoves the attachment specified by the id- Specified by:
removeAttachmentin interfaceAttachmentMessage- Parameters:
id- the id of the attachment to remove
-
addAttachment
Description copied from interface:AttachmentMessageAdds an attachment to the message using the id- Specified by:
addAttachmentin interfaceAttachmentMessage- Parameters:
id- the id to store the attachment undercontent- the data handler for the attachment
-
addAttachmentObject
Description copied from interface:AttachmentMessageAdds an attachment to the message using the id- Specified by:
addAttachmentObjectin interfaceAttachmentMessage- Parameters:
id- the id to store the attachment undercontent- the attachment
-
getAttachments
Description copied from interface:AttachmentMessageReturns all attachments of the message- Specified by:
getAttachmentsin interfaceAttachmentMessage- Returns:
- the attachments in a map or null
-
getAttachmentObjects
Description copied from interface:AttachmentMessageReturns all attachments of the message- Specified by:
getAttachmentObjectsin interfaceAttachmentMessage- Returns:
- the attachments in a map or null
-
setAttachments
Description copied from interface:AttachmentMessageSet all the attachments associated with this message- Specified by:
setAttachmentsin interfaceAttachmentMessage- Parameters:
attachments- the attachments
-
setAttachmentObjects
Description copied from interface:AttachmentMessageSet all the attachments associated with this message- Specified by:
setAttachmentObjectsin interfaceAttachmentMessage- Parameters:
attachments- the attachments
-
hasAttachments
public boolean hasAttachments()Description copied from interface:AttachmentMessageReturns whether this message has attachments.- Specified by:
hasAttachmentsin interfaceAttachmentMessage- Returns:
- true if this message has any attachments.
-
hasTrait
public boolean hasTrait(org.apache.camel.trait.message.MessageTrait trait) - Specified by:
hasTraitin interfaceorg.apache.camel.Message
-
getPayloadForTrait
- Specified by:
getPayloadForTraitin interfaceorg.apache.camel.Message
-
setPayloadForTrait
- Specified by:
setPayloadForTraitin interfaceorg.apache.camel.Message
-