com.mirth.connect.userutil
Class ImmutableConnectorMessage

java.lang.Object
  extended by com.mirth.connect.userutil.ImmutableConnectorMessage

public class ImmutableConnectorMessage
extends java.lang.Object

This class represents a connector message and is used to retrieve details such as the message ID, metadata ID, status, and various content types.


Constructor Summary
ImmutableConnectorMessage(com.mirth.connect.donkey.model.message.ConnectorMessage connectorMessage)
          Instantiates a new ImmutableConnectorMessage object.
ImmutableConnectorMessage(com.mirth.connect.donkey.model.message.ConnectorMessage connectorMessage, boolean modifiableMaps)
          Instantiates a new ImmutableConnectorMessage object.
ImmutableConnectorMessage(com.mirth.connect.donkey.model.message.ConnectorMessage connectorMessage, boolean modifiableMaps, java.util.Map<java.lang.String,java.lang.String> destinationNameMap)
          Instantiates a new ImmutableConnectorMessage object.
 
Method Summary
 java.lang.String getChannelId()
          Returns the ID of the channel associated with this connector message.
 java.util.Map<java.lang.String,java.lang.Object> getChannelMap()
          Returns the channel map.
 java.util.Map<java.lang.String,java.lang.Object> getConnectorMap()
          Returns the connector map.
 java.lang.String getConnectorName()
          Returns the name of the connector associated with this connector message.
 ImmutableMessageContent getContent(ContentType contentType)
          Retrieves content associated with this connector message.
 java.util.Map<java.lang.String,java.lang.String> getDestinationNameMap()
          Returns a Map of destination connector names linked to their corresponding "d#" response map keys (where "#" is the destination connector metadata ID).
 ImmutableMessageContent getEncoded()
          Retrieves encoded content associated with this connector message.
 java.lang.String getEncodedData()
          Retrieves encoded content associated with this connector message.
 long getMessageId()
          Returns the sequential ID of the overall Message associated with this connector message.
 int getMetaDataId()
          Returns the metadata ID of this connector message.
 ImmutableMessageContent getProcessedRaw()
          Retrieves processed raw content associated with this connector message.
 java.lang.String getProcessedRawData()
          Retrieves processed raw content associated with this connector message.
 ImmutableMessageContent getProcessedResponse()
          Retrieves processed response content associated with this connector message.
 Response getProcessedResponseData()
          Retrieves processed response content associated with this connector message.
 java.lang.String getProcessingError()
          Returns the processing error string associated with this connector message, if it exists.
 ImmutableMessageContent getRaw()
          Retrieves raw content associated with this connector message.
 java.lang.String getRawData()
          Retrieves raw content associated with this connector message.
 java.util.Calendar getReceivedDate()
          Returns the date/time that this connector message was created by the channel.
 ImmutableMessageContent getResponse()
          Retrieves response content associated with this connector message.
 Response getResponseData()
          Retrieves response content associated with this connector message.
 java.util.Calendar getResponseDate()
          Returns the date/time immediately after this connector message's response is received.
 java.lang.String getResponseError()
          Returns the response error string associated with this connector message, if it exists.
 java.util.Map<java.lang.String,java.lang.Object> getResponseMap()
          Returns the response map.
 ImmutableMessageContent getResponseTransformed()
          Retrieves transformed response content associated with this connector message.
 java.lang.String getResponseTransformedData()
          Retrieves transformed response content associated with this connector message.
 int getSendAttempts()
          Returns the number of times this message has been attempted to be dispatched by the connector.
 java.util.Calendar getSendDate()
          Returns the date/time immediately before this connector message's most recent send attempt.
 ImmutableMessageContent getSent()
          Deprecated. This method is deprecated and will soon be removed. Please use map variables to retrieve post-replacement data instead. This method will always return null.
 java.lang.String getSentData()
          Deprecated. This method is deprecated and will soon be removed. Please use map variables to retrieve post-replacement data instead. This method will always return null.
 java.lang.String getServerId()
          Returns the ID of the server associated with this connector message.
 Status getStatus()
          Returns the status (e.g.
 ImmutableMessageContent getTransformed()
          Retrieves transformed content associated with this connector message.
 java.lang.String getTransformedData()
          Retrieves transformed content associated with this connector message.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImmutableConnectorMessage

public ImmutableConnectorMessage(com.mirth.connect.donkey.model.message.ConnectorMessage connectorMessage)
Instantiates a new ImmutableConnectorMessage object.

Parameters:
connectorMessage - The connector message that this object will reference for retrieving data.

ImmutableConnectorMessage

public ImmutableConnectorMessage(com.mirth.connect.donkey.model.message.ConnectorMessage connectorMessage,
                                 boolean modifiableMaps)
Instantiates a new ImmutableConnectorMessage object.

Parameters:
connectorMessage - The connector message that this object will reference for retrieving data.
modifiableMaps - If true, variable maps (e.g. connector/channel/response) will be modifiable, and values may be set in them as well as retrieved. Otherwise, data will only be able to be retrieved from the maps, and no updates will be allowed.

ImmutableConnectorMessage

public ImmutableConnectorMessage(com.mirth.connect.donkey.model.message.ConnectorMessage connectorMessage,
                                 boolean modifiableMaps,
                                 java.util.Map<java.lang.String,java.lang.String> destinationNameMap)
Instantiates a new ImmutableConnectorMessage object.

Parameters:
connectorMessage - The connector message that this object will reference for retrieving data.
modifiableMaps - If true, variable maps (e.g. connector/channel/response) will be modifiable, and values may be set in them as well as retrieved. Otherwise, data will only be able to be retrieved from the maps, and no updates will be allowed.
destinationNameMap - A map containing all applicable destination names in the channel and their corresponding "d#" response map keys. This is used so that the response map has the ability to get destination responses by name as well as by the proper "d#" key.
Method Detail

getMetaDataId

public int getMetaDataId()
Returns the metadata ID of this connector message. Note that the source connector has a metadata ID of 0.


getChannelId

public java.lang.String getChannelId()
Returns the ID of the channel associated with this connector message.


getConnectorName

public java.lang.String getConnectorName()
Returns the name of the connector associated with this connector message.


getServerId

public java.lang.String getServerId()
Returns the ID of the server associated with this connector message.


getReceivedDate

public java.util.Calendar getReceivedDate()
Returns the date/time that this connector message was created by the channel.


getSendAttempts

public int getSendAttempts()
Returns the number of times this message has been attempted to be dispatched by the connector.


getSendDate

public java.util.Calendar getSendDate()
Returns the date/time immediately before this connector message's most recent send attempt. Only valid for destination connectors in the response transformer or postprocessor. Returns null otherwise.


getResponseDate

public java.util.Calendar getResponseDate()
Returns the date/time immediately after this connector message's response is received. Only valid for destination connectors in the response transformer or postprocessor. Returns null otherwise.


getStatus

public Status getStatus()
Returns the status (e.g. SENT) of this connector message.


getContent

public ImmutableMessageContent getContent(ContentType contentType)
Retrieves content associated with this connector message.

Parameters:
contentType - The ContentType (e.g. RAW, ENCODED) of the content to retrieve.
Returns:
The content, as an ImmutableMessageContent object.

getRaw

public ImmutableMessageContent getRaw()
Retrieves raw content associated with this connector message.

Returns:
The raw content, as an ImmutableMessageContent object.

getRawData

public java.lang.String getRawData()
Retrieves raw content associated with this connector message.

Returns:
The raw content, as a string.

getProcessedRaw

public ImmutableMessageContent getProcessedRaw()
Retrieves processed raw content associated with this connector message.

Returns:
The processed raw content, as an ImmutableMessageContent object.

getProcessedRawData

public java.lang.String getProcessedRawData()
Retrieves processed raw content associated with this connector message.

Returns:
The processed raw content, as a string.

getTransformed

public ImmutableMessageContent getTransformed()
Retrieves transformed content associated with this connector message.

Returns:
The transformed content, as an ImmutableMessageContent object.

getTransformedData

public java.lang.String getTransformedData()
Retrieves transformed content associated with this connector message.

Returns:
The transformed content, as a string.

getEncoded

public ImmutableMessageContent getEncoded()
Retrieves encoded content associated with this connector message.

Returns:
The encoded content, as an ImmutableMessageContent object.

getEncodedData

public java.lang.String getEncodedData()
Retrieves encoded content associated with this connector message.

Returns:
The encoded content, as a string.

getSent

public ImmutableMessageContent getSent()
Deprecated. This method is deprecated and will soon be removed. Please use map variables to retrieve post-replacement data instead. This method will always return null.

Retrieves sent content associated with this connector message.

Returns:
The sent content, as an ImmutableMessageContent object.

getSentData

public java.lang.String getSentData()
Deprecated. This method is deprecated and will soon be removed. Please use map variables to retrieve post-replacement data instead. This method will always return null.

Retrieves sent content associated with this connector message.

Returns:
The sent content, as a string.

getResponse

public ImmutableMessageContent getResponse()
Retrieves response content associated with this connector message.

Returns:
The response content, as an ImmutableMessageContent object.

getResponseData

public Response getResponseData()
Retrieves response content associated with this connector message.

Returns:
The response content, as a string.

getResponseTransformed

public ImmutableMessageContent getResponseTransformed()
Retrieves transformed response content associated with this connector message.

Returns:
The transformed response content, as an ImmutableMessageContent object.

getResponseTransformedData

public java.lang.String getResponseTransformedData()
Retrieves transformed response content associated with this connector message.

Returns:
The transformed response content, as a string.

getProcessedResponse

public ImmutableMessageContent getProcessedResponse()
Retrieves processed response content associated with this connector message.

Returns:
The processed response content, as an ImmutableMessageContent object.

getProcessedResponseData

public Response getProcessedResponseData()
Retrieves processed response content associated with this connector message.

Returns:
The processed response content, as a string.

getMessageId

public long getMessageId()
Returns the sequential ID of the overall Message associated with this connector message.


getConnectorMap

public java.util.Map<java.lang.String,java.lang.Object> getConnectorMap()
Returns the connector map. If this connector message was instantiated with a 'true' value for modifiableMaps, then this map will allow both data retrieval and updates. Otherwise, the map will be unmodifiable and only data retrieval will be allowed.


getChannelMap

public java.util.Map<java.lang.String,java.lang.Object> getChannelMap()
Returns the channel map. If this connector message was instantiated with a 'true' value for modifiableMaps, then this map will allow both data retrieval and updates. Otherwise, the map will be unmodifiable and only data retrieval will be allowed.


getResponseMap

public java.util.Map<java.lang.String,java.lang.Object> getResponseMap()
Returns the response map. If this connector message was instantiated with a 'true' value for modifiableMaps, then this map will allow both data retrieval and updates. Otherwise, the map will be unmodifiable and only data retrieval will be allowed. In addition, if this connector message was instantiated with the destinationNameMap parameter, the map will check destination names as well as the proper "d#" keys when retrieving data.


getProcessingError

public java.lang.String getProcessingError()
Returns the processing error string associated with this connector message, if it exists.


getResponseError

public java.lang.String getResponseError()
Returns the response error string associated with this connector message, if it exists.


getDestinationNameMap

public java.util.Map<java.lang.String,java.lang.String> getDestinationNameMap()
Returns a Map of destination connector names linked to their corresponding "d#" response map keys (where "#" is the destination connector metadata ID).


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object