Class RawMessage

java.lang.Object
com.mirth.connect.server.userutil.RawMessage

public class RawMessage extends Object
This class represents a raw message as it is received by a channel, and is used to retrieve details such as the raw data or source map.
  • Constructor Details

    • RawMessage

      public RawMessage(String rawData)
      Instantiates a RawMessage object to dispatch to a channel.
      Parameters:
      rawData - The textual data to dispatch to the channel.
    • RawMessage

      public RawMessage(String rawData, Collection<Number> destinationMetaDataIds)
      Instantiates a RawMessage object to dispatch to a channel.
      Parameters:
      rawData - The textual data to dispatch to the channel.
      destinationMetaDataIds - A collection of integers (metadata IDs) representing which destinations to dispatch the message to. JavaScript arrays can be used.
    • RawMessage

      public RawMessage(String rawData, Collection<Number> destinationMetaDataIds, Map<String,Object> sourceMap)
      Instantiates a RawMessage object to dispatch to a channel.
      Parameters:
      rawData - The textual data to dispatch to the channel.
      destinationMetaDataIds - A collection of integers (metadata IDs) representing which destinations to dispatch the message to. JavaScript arrays can be used.
      sourceMap - Any values placed in this map will be populated in the source map at the beginning of the message's lifecycle.
    • RawMessage

      public RawMessage(byte[] rawBytes)
      Instantiates a RawMessage object to dispatch to a channel.
      Parameters:
      rawBytes - The binary data (byte array) to dispatch to the channel.
    • RawMessage

      public RawMessage(byte[] rawBytes, Collection<Number> destinationMetaDataIds)
      Instantiates a RawMessage object to dispatch to a channel.
      Parameters:
      rawBytes - The binary data (byte array) to dispatch to the channel.
      destinationMetaDataIds - A collection of integers (metadata IDs) representing which destinations to dispatch the message to. JavaScript arrays can be used.
    • RawMessage

      public RawMessage(byte[] rawBytes, Collection<Number> destinationMetaDataIds, Map<String,Object> sourceMap)
      Instantiates a RawMessage object to dispatch to a channel.
      Parameters:
      rawBytes - The binary data (byte array) to dispatch to the channel.
      destinationMetaDataIds - A collection of integers (metadata IDs) representing which destinations to dispatch the message to. JavaScript arrays can be used.
      sourceMap - Any values placed in this map will be populated in the source map at the beginning of the message's lifecycle.
  • Method Details

    • getRawData

      public String getRawData()
      Returns the textual data to be dispatched to a channel.
      Returns:
      The textual data to be dispatched to a channel.
    • getRawBytes

      public byte[] getRawBytes()
      Returns the binary data (byte array) to be dispatched to a channel.
      Returns:
      The binary data (byte array) to be dispatched to a channel.
    • getDestinationMetaDataIds

      public Collection<Integer> getDestinationMetaDataIds()
      Returns the collection of integers (metadata IDs) representing which destinations to dispatch the message to.
      Returns:
      The collection of integers (metadata IDs) representing which destinations to dispatch the message to.
    • setDestinationMetaDataIds

      public void setDestinationMetaDataIds(Collection<Number> destinationMetaDataIds)
      Sets which destinations to dispatch the message to.
      Parameters:
      destinationMetaDataIds - A list of integers (metadata IDs) representing which destinations to dispatch the message to.
    • getChannelMap

      @Deprecated public Map<String,Object> getChannelMap()
      Deprecated.
      This method is deprecated and will soon be removed. Please use getSourceMap() instead.
      Returns the channel map to be used at the beginning of the channel dispatch.
      Returns:
      The channel map to be used at the beginning of the channel dispatch.
    • setChannelMap

      @Deprecated public void setChannelMap(Map<String,Object> channelMap)
      Deprecated.
      This method is deprecated and will soon be removed. Please use setSourceMap(sourceMap) instead.
      Sets the channel map to be used at the beginning of the channel dispatch.
      Parameters:
      channelMap - Any values placed in this map will be populated in the channel map at the beginning of the message's lifecycle.
    • getSourceMap

      public Map<String,Object> getSourceMap()
      Returns the source map to be used at the beginning of the channel dispatch.
      Returns:
      The source map to be used at the beginning of the channel dispatch.
    • setSourceMap

      public void setSourceMap(Map<String,Object> sourceMap)
      Sets the source map to be used at the beginning of the channel dispatch.
      Parameters:
      sourceMap - Any values placed in this map will be populated in the source map at the beginning of the message's lifecycle.
    • isBinary

      public Boolean isBinary()
      Returns a Boolean representing whether this object contains textual or binary data.
      Returns:
      A Boolean representing whether this object contains textual or binary data.
    • clearMessage

      public void clearMessage()
      Removes references to any data (textual or binary) currently stored by the raw message.