Package com.mirth.connect.userutil
Class ImmutableConnectorMessage
java.lang.Object
com.mirth.connect.userutil.ImmutableConnectorMessage
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
ConstructorsConstructorDescriptionImmutableConnectorMessage(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, Map<String, Integer> destinationIdMap) Instantiates a new ImmutableConnectorMessage object. -
Method Summary
Modifier and TypeMethodDescriptionReturns the ID of the channel associated with this connector message.Returns the channel map.Returns the Name of the channel associated with this connector message.Returns the connector map.Returns the name of the connector associated with this connector message.getContent(ContentType contentType) Deprecated.The getContent(contentType) method has been deprecated and will soon be removed.Returns a Map of destination connector names linked to their corresponding connector metadata ID.Deprecated.This method is deprecated and will soon be removed.Retrieves encoded content associated with this connector message.Retrieves encoded content associated with this connector message.getMessageContent(ContentType contentType) Retrieves content associated with this connector message.longReturns the sequential ID of the overall Message associated with this connector message.intReturns the metadata ID of this connector message.Returns the postprocessing error string associated with this connector message, if it exists.Retrieves processed raw content associated with this connector message.Retrieves processed raw content associated with this connector message.Retrieves processed response content associated with this connector message.Retrieves processed response content associated with this connector message.Returns the processing error string associated with this connector message, if it exists.getRaw()Retrieves raw content associated with this connector message.Retrieves raw content associated with this connector message.Returns the date/time that this connector message was created by the channel.Retrieves response content associated with this connector message.Retrieves response content associated with this connector message.Returns the date/time immediately after this connector message's response is received.Returns the response error string associated with this connector message, if it exists.Returns the response map.Retrieves transformed response content associated with this connector message.Retrieves transformed response content associated with this connector message.intReturns the number of times this message has been attempted to be dispatched by the connector.Returns the date/time immediately before this connector message's most recent send attempt.Returns the ID of the server associated with this connector message.Returns the source map.Returns the status (e.g.Retrieves transformed content associated with this connector message.Retrieves transformed content associated with this connector message.toString()
-
Constructor Details
-
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, Map<String, Integer> destinationIdMap) 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.destinationIdMap- A map containing all applicable destination names in the channel and their corresponding connector metadata ids.
-
-
Method Details
-
getMetaDataId
public int getMetaDataId()Returns the metadata ID of this connector message. Note that the source connector has a metadata ID of 0.- Returns:
- The metadata ID of this connector message.
-
getChannelId
Returns the ID of the channel associated with this connector message.- Returns:
- The ID of the channel associated with this connector message.
-
getChannelName
Returns the Name of the channel associated with this connector message.- Returns:
- The Name of the channel associated with this connector message.
-
getConnectorName
Returns the name of the connector associated with this connector message.- Returns:
- The name of the connector associated with this connector message.
-
getServerId
Returns the ID of the server associated with this connector message.- Returns:
- The ID of the server associated with this connector message.
-
getReceivedDate
Returns the date/time that this connector message was created by the channel.- 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.- Returns:
- The number of times this message has been attempted to be dispatched by the connector.
-
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.- Returns:
- The date/time immediately before this connector message's most recent send attempt.
-
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.- Returns:
- The date/time immediately after this connector message's response is received.
-
getStatus
Returns the status (e.g. SENT) of this connector message.- Returns:
- The status (e.g. SENT) of this connector message.
-
getMessageContent
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.
-
getContent
Deprecated.The getContent(contentType) method has been deprecated and will soon be removed. Please use getMessageContent(contentType) instead.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
Retrieves raw content associated with this connector message.- Returns:
- The raw content, as an ImmutableMessageContent object.
-
getRawData
Retrieves raw content associated with this connector message.- Returns:
- The raw content, as a string.
-
getProcessedRaw
Retrieves processed raw content associated with this connector message.- Returns:
- The processed raw content, as an ImmutableMessageContent object.
-
getProcessedRawData
Retrieves processed raw content associated with this connector message.- Returns:
- The processed raw content, as a string.
-
getTransformed
Retrieves transformed content associated with this connector message.- Returns:
- The transformed content, as an ImmutableMessageContent object.
-
getTransformedData
Retrieves transformed content associated with this connector message.- Returns:
- The transformed content, as a string.
-
getEncoded
Retrieves encoded content associated with this connector message.- Returns:
- The encoded content, as an ImmutableMessageContent object.
-
getEncodedData
Retrieves encoded content associated with this connector message.- Returns:
- The encoded content, as a string.
-
getResponse
Retrieves response content associated with this connector message.- Returns:
- The response content, as an ImmutableMessageContent object.
-
getResponseData
Retrieves response content associated with this connector message.- Returns:
- The response content, as a string.
-
getResponseTransformed
Retrieves transformed response content associated with this connector message.- Returns:
- The transformed response content, as an ImmutableMessageContent object.
-
getResponseTransformedData
Retrieves transformed response content associated with this connector message.- Returns:
- The transformed response content, as a string.
-
getProcessedResponse
Retrieves processed response content associated with this connector message.- Returns:
- The processed response content, as an ImmutableMessageContent object.
-
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.- Returns:
- The sequential ID of the overall Message associated with this connector message.
-
getSourceMap
Returns the source map. This map is unmodifiable and only data retrieval will be allowed.- Returns:
- The source map.
-
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.- Returns:
- The connector map.
-
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.- Returns:
- The channel map.
-
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.- Returns:
- The response map.
-
getPostProcessorError
Returns the postprocessing error string associated with this connector message, if it exists.- Returns:
- The postprocessing error string associated with this connector message, if it exists.
-
getProcessingError
Returns the processing error string associated with this connector message, if it exists.- Returns:
- The processing error string associated with this connector message, if it exists.
-
getResponseError
Returns the response error string associated with this connector message, if it exists.- Returns:
- The response error string associated with this connector message, if it exists.
-
getDestinationNameMap
Deprecated.This method is deprecated and will soon be removed. Please usegetDestinationIdMap()instead.Returns a Map of destination connector names linked to their corresponding "d#" response map keys (where "#" is the destination connector metadata ID).- Returns:
- A Map of destination connector names linked to their corresponding "d#" response map keys.
-
getDestinationIdMap
Returns a Map of destination connector names linked to their corresponding connector metadata ID.- Returns:
- A Map of destination connector names linked to their corresponding connector metadata ID.
-
toString
-