Interface Message


public interface Message
Provides methods to update the content of a Spark message. A Message is a set of data that can be sent through QueueService to an external service or to another Vault. It contains a list of message items that can be used as identifiers, and a small set of attributes that can be used as general purpose parameters.
  • Method Details

    • appendPath

      Message appendPath(String connection, String path)
      Appends a path to a specific connection's base URL for this Message.
      Parameters:
      connection - The connection name to append a path to. Must be a valid external connection on the specified queue.
      path - path to append to the connection's base URL
      Returns:
      Message object with new appended path
    • appendPathWithTokens

      Message appendPathWithTokens(String connection, String token)
      Appends a path to a specific connection's base URL using a valid Vault or custom token which will be resolved on send.
      Parameters:
      connection - The connection name to append a path to. Must be a valid external connection on the specified queue.
      token - The string value of a valid message token. Cannot exceed 100 characters.
      Returns:
      Message object with new appended path
    • setMessageItems

      Message setMessageItems(List<String> items)
      Sets a list of message items for this Message. These items are typically identifiers used for further querying.
      Parameters:
      items - A List of items to add to this Message. Each item String can not exceed 100 characters. The List can not exceed 500 items.
      Returns:
      Message object with updated List of items
    • getAttribute

      <T> T getAttribute(String name, MessageAttributeValueType<T> type)
      Retrieves an attribute set by setAttribute(String, Object).
      Type Parameters:
      T - type of data requested
      Parameters:
      name - the name of the given attribute
      type - type of value that is expected to be returned
      Returns:
      Returns the value associated with the key of "name"
    • setAttributeWithToken

      Message setAttributeWithToken(String name, String token)
      Sets an attribute with the name and value of a valid message token.

      Valid message tokens are:

      • ${Session.SessionId}: A valid Vault session token for the currently authenticated user.
      • ${Session.ConnectionUserSessionId}: A valid Vault session token for the Authorized Connection User on the Connection record.
      • ${Vault.__}: A valid Vault token
      • ${Custom.__}: A custom token defined in TokenRequest
      Parameters:
      name - The key to use for the name-value pair. Cannot exceed 40 characters.
      token - The string value of a valid message token. Cannot exceed 100 characters.
      Returns:
      Message object with updated session token
    • setAttribute

      Message setAttribute(String name, Object value)
      Sets an attribute with name and value. A maximum of 10 attributes can be set per Message.
      Parameters:
      name - The key to use for the name-value pair. Cannot exceed 40 characters.
      value - The value to set for the name-value pair. Type must be supported by JSON.
      Returns:
      Message object with updated attribute
    • getMessageItems

      List<String> getMessageItems()
      Retrieves an immutable List of String items set by setMessageItems(List).
      Returns:
      List of items in this Message