Interface Message
public interface Message
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttachmentHeader(String headerName, String headerValue, AttachmentWrapper attachment) Add this value to the existing values for this headerName of the attachment.voidaddAttachmentHeader(String headerName, String headerValue, org.apache.camel.attachment.Attachment attachment) Deprecated.voidaddAttachmentObject(String id, AttachmentWrapper content) Adds an attachment to the message using the idvoidaddAttachmentObject(String id, org.apache.camel.attachment.Attachment content) Deprecated.voidremoves all SOAP headers of the current messagegetAttachmentHeader(String headerName, AttachmentWrapper attachment) Get all the values for this header name for the attachment.getAttachmentHeader(String headerName, org.apache.camel.attachment.Attachment attachment) Deprecated.Deprecated.longReturns the combined size of all message attachmentsReturns all attachments of the messagegetBody()<T> TlongReturns the size of the message body.<T> TReturn value of a message headergetProperty(String name) Returns the value of a propertyreturns the SOAP headers of the current message.voidremoveAttachmentHeader(String headerName, AttachmentWrapper attachment) Remove all headers with this name.voidremoveAttachmentHeader(String headerName, org.apache.camel.attachment.Attachment attachment) Deprecated.voidsetAttachmentHeader(String headerName, String headerValue, AttachmentWrapper attachment) Set the value for this headerName to the attachment.voidsetAttachmentHeader(String headerName, String headerValue, org.apache.camel.attachment.Attachment attachment) Deprecated.voidsetAttachmentObjects(Map<String, org.apache.camel.attachment.Attachment> attachmentObjects) Deprecated.voidsetAttachments(Map<String, DataHandler> attachments) voidsetAttachmentWrapperObjects(Map<String, AttachmentWrapper> attachmentObjects) Set all the attachments associated with this messagevoidvoidAdd new HeadervoidsetHeaders(Map<String, Object> exchangeHeaders) Replace the existing message headersvoidsetProperties(Map<String, Object> exchangeProperties) Replace the existing exchange propertiesvoidsetProperty(String name, Object value) Add new PropertyvoidsetSoapHeaders(List<SoapHeader> headers) sets the SOAP headers in a message that will be sent
-
Method Details
-
getBody
- Type Parameters:
T-- Returns:
- the exchangeBody with specific type
-
getBody
Object getBody()- Returns:
- the exchangeBodyx
-
setBody
- Parameters:
exchangeBody-
-
getAttachments
Map<String,DataHandler> getAttachments() -
setAttachments
- Parameters:
attachments-
-
getHeaders
- Returns:
- the exchangeHeaders
-
getHeader
Return value of a message header- Parameters:
headerType- The object type in which the header value is to be returnedheaderName- Name of the header to be returned- Returns:
- the header with specific type
-
setHeaders
Replace the existing message headers- Parameters:
exchangeHeaders-
-
setHeader
Add new Header- Parameters:
name- Name of the header to be addedvalue- Value of the header to be added
-
getProperties
- Returns:
- the exchangeProperties exchange properties to replace the existing exchange properties
-
setProperties
Replace the existing exchange properties- Parameters:
exchangeProperties- the exchange Properties to set
-
setProperty
Add new Property- Parameters:
name- and value the exchangeProperties to set
-
getProperty
Returns the value of a property- Parameters:
name-- Returns:
- value the exchangeProperty
-
getBodySize
long getBodySize()Returns the size of the message body. Supported body types: - String - byte[] - InputStream - cached streams - XML Sources (classes derived from Source) - XML Documents (classes derived from Document) - types convertible to InputStream- Returns:
- Body size in bytes or -1 for unsupported types
-
getAttachmentsSize
long getAttachmentsSize()Returns the combined size of all message attachments- Returns:
- Attachments size in bytes or 0 if there are no attachments
-
addAttachmentHeader
Add this value to the existing values for this headerName of the attachment.- Parameters:
headerName- the name of this headerheaderValue- the value of this headerattachment- the attachment for which the header is to be added
-
setAttachmentHeader
Set the value for this headerName to the attachment. Replaces all existing header values with this new value.- Parameters:
headerName- the name of this headerheaderValue- the value for this headerattachment- the attachment on which header has to be set
-
getAttachmentHeader
Get all the values for this header name for the attachment. Returns null if no headers for this header name are available.- Parameters:
headerName- the name of this headerattachment- the attachment of this header- Returns:
- a String having list of all header values
-
removeAttachmentHeader
Remove all headers with this name.- Parameters:
headerName- the name of this headerattachment- the attachment for which to remove header
-
getAttachmentWrapperObjects
Map<String,AttachmentWrapper> getAttachmentWrapperObjects()Returns all attachments of the message- Returns:
- the attachments in a map
-
setAttachmentWrapperObjects
Set all the attachments associated with this message- Parameters:
attachments- the attachments
-
addAttachmentObject
Adds an attachment to the message using the id- Parameters:
id- the id to store the attachment undercontent- the attachment
-
addAttachmentHeader
@Deprecated void addAttachmentHeader(String headerName, String headerValue, org.apache.camel.attachment.Attachment attachment) Deprecated.Add this value to the existing values for this headerName of the attachment.- Parameters:
headerName- the name of this headerheaderValue- the value of this headerattachment- the attachment for which the header is to be added
-
setAttachmentHeader
@Deprecated void setAttachmentHeader(String headerName, String headerValue, org.apache.camel.attachment.Attachment attachment) Deprecated.Set the value for this headerName to the attachment. Replaces all existing header values with this new value.- Parameters:
headerName- the name of this headerheaderValue- the value for this headerattachment- the attachment on which header has to be set
-
getAttachmentHeader
@Deprecated String getAttachmentHeader(String headerName, org.apache.camel.attachment.Attachment attachment) Deprecated.Get all the values for this header name for the attachment. Returns null if no headers for this header name are available.- Parameters:
headerName- the name of this headerattachment- the attachment of this header- Returns:
- a String having list of all header values
-
removeAttachmentHeader
@Deprecated void removeAttachmentHeader(String headerName, org.apache.camel.attachment.Attachment attachment) Deprecated.Remove all headers with this name.- Parameters:
headerName- the name of this headerattachment- the attachment for which to remove header
-
getAttachmentObjects
Deprecated.Returns all attachments of the message- Returns:
- the attachments in a map
-
setAttachmentObjects
@Deprecated void setAttachmentObjects(Map<String, org.apache.camel.attachment.Attachment> attachmentObjects) Deprecated.Set all the attachments associated with this message- Parameters:
attachments- the attachments
-
addAttachmentObject
Deprecated.Adds an attachment to the message using the id- Parameters:
id- the id to store the attachment undercontent- the attachment
-
getSoapHeaders
List<SoapHeader> getSoapHeaders()returns the SOAP headers of the current message.- Returns:
- the SOAP headers in a list
-
setSoapHeaders
sets the SOAP headers in a message that will be sent- Parameters:
headers- the SOAP headers
-
clearSoapHeaders
void clearSoapHeaders()removes all SOAP headers of the current message
-