Interface Message


public interface Message
  • Method Details

    • getBody

      <T> T getBody(Class<T> type)
      Type Parameters:
      T -
      Returns:
      the exchangeBody with specific type
    • getBody

      Object getBody()
      Returns:
      the exchangeBodyx
    • setBody

      void setBody(Object exchangeBody)
      Parameters:
      exchangeBody -
    • getAttachments

      Map<String,DataHandler> getAttachments()
    • setAttachments

      void setAttachments(Map<String,DataHandler> attachments)
      Parameters:
      attachments -
    • getHeaders

      Map<String,Object> getHeaders()
      Returns:
      the exchangeHeaders
    • getHeader

      <T> T getHeader(String headerName, Class<T> headerType)
      Return value of a message header
      Parameters:
      headerType - The object type in which the header value is to be returned
      headerName - Name of the header to be returned
      Returns:
      the header with specific type
    • setHeaders

      void setHeaders(Map<String,Object> exchangeHeaders)
      Replace the existing message headers
      Parameters:
      exchangeHeaders -
    • setHeader

      void setHeader(String name, Object value)
      Add new Header
      Parameters:
      name - Name of the header to be added
      value - Value of the header to be added
    • getProperties

      Map<String,Object> getProperties()
      Returns:
      the exchangeProperties exchange properties to replace the existing exchange properties
    • setProperties

      void setProperties(Map<String,Object> exchangeProperties)
      Replace the existing exchange properties
      Parameters:
      exchangeProperties - the exchange Properties to set
    • setProperty

      void setProperty(String name, Object value)
      Add new Property
      Parameters:
      name - and value the exchangeProperties to set
    • getProperty

      Object getProperty(String name)
      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

      void addAttachmentHeader(String headerName, String headerValue, AttachmentWrapper attachment)
      Add this value to the existing values for this headerName of the attachment.
      Parameters:
      headerName - the name of this header
      headerValue - the value of this header
      attachment - the attachment for which the header is to be added
    • setAttachmentHeader

      void setAttachmentHeader(String headerName, String headerValue, AttachmentWrapper attachment)
      Set the value for this headerName to the attachment. Replaces all existing header values with this new value.
      Parameters:
      headerName - the name of this header
      headerValue - the value for this header
      attachment - the attachment on which header has to be set
    • getAttachmentHeader

      String getAttachmentHeader(String headerName, AttachmentWrapper attachment)
      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 header
      attachment - the attachment of this header
      Returns:
      a String having list of all header values
    • removeAttachmentHeader

      void removeAttachmentHeader(String headerName, AttachmentWrapper attachment)
      Remove all headers with this name.
      Parameters:
      headerName - the name of this header
      attachment - 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

      void setAttachmentWrapperObjects(Map<String,AttachmentWrapper> attachmentObjects)
      Set all the attachments associated with this message
      Parameters:
      attachments - the attachments
    • addAttachmentObject

      void addAttachmentObject(String id, AttachmentWrapper content)
      Adds an attachment to the message using the id
      Parameters:
      id - the id to store the attachment under
      content - 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 header
      headerValue - the value of this header
      attachment - 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 header
      headerValue - the value for this header
      attachment - 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 header
      attachment - 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 header
      attachment - the attachment for which to remove header
    • getAttachmentObjects

      @Deprecated Map<String,org.apache.camel.attachment.Attachment> 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 void addAttachmentObject(String id, org.apache.camel.attachment.Attachment content)
      Deprecated.
      Adds an attachment to the message using the id
      Parameters:
      id - the id to store the attachment under
      content - the attachment
    • getSoapHeaders

      List<SoapHeader> getSoapHeaders()
      returns the SOAP headers of the current message.
      Returns:
      the SOAP headers in a list
    • setSoapHeaders

      void setSoapHeaders(List<SoapHeader> headers)
      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