Class BaseResourceMessage

java.lang.Object
ca.uhn.fhir.rest.server.messaging.BaseResourceMessage
All Implemented Interfaces:
ca.uhn.fhir.model.api.IModelJson, IResourceMessage
Direct Known Subclasses:
BaseResourceModifiedMessage

public abstract class BaseResourceMessage extends Object implements IResourceMessage, ca.uhn.fhir.model.api.IModelJson
  • Field Details

  • Constructor Details

  • Method Details

    • getAttribute

      public Optional<String> getAttribute(String theKey)
      Returns an attribute stored in this message.

      Attributes are just a spot for user data of any kind to be added to the message for pasing along the subscription processing pipeline (typically by interceptors). Values will be carried from the beginning to the end.

      Note that messages are designed to be passed into queueing systems and serialized as JSON. As a result, only strings are currently allowed as values.

    • setAttribute

      public void setAttribute(String theKey, String theValue)
      Sets an attribute stored in this message.

      Attributes are just a spot for user data of any kind to be added to the message for passing along the subscription processing pipeline (typically by interceptors). Values will be carried from the beginning to the end.

      Note that messages are designed to be passed into queueing systems and serialized as JSON. As a result, only strings are currently allowed as values.

      Parameters:
      theKey - The key (must not be null or blank)
      theValue - The value (must not be null)
    • copyAdditionalPropertiesFrom

      Copies any attributes from the given message into this messsage.
      See Also:
    • getOperationType

      Returns the BaseResourceMessage.OperationTypeEnum that is occurring to the Resource of the message
      Returns:
      the operation type.
    • setOperationType

      Sets the BaseResourceMessage.OperationTypeEnum occuring to the resource of the message.
      Parameters:
      theOperationType - The operation type to set.
    • getTransactionId

      @Nullable public String getTransactionId()
      Retrieve the transaction ID related to this message.
      Returns:
      the transaction ID, or null.
    • setTransactionId

      public void setTransactionId(String theTransactionId)
      Adds a transaction ID to this message. This ID can be used for many purposes. For example, performing tracing across asynchronous hooks, tying data together, or downstream logging purposes. One current internal implementation uses this field to tie back MDM processing results (which are asynchronous) to the original transaction log that caused the MDM processing to occur.
      Parameters:
      theTransactionId - An ID representing a transaction of relevance to this message.
    • getMediaType

      public String getMediaType()
    • setMediaType

      public void setMediaType(String theMediaType)
    • getMessageKeyOrNull

      @Nullable public String getMessageKeyOrNull()
    • setMessageKey

      public void setMessageKey(String theMessageKey)