Class JmsResponse

java.lang.Object
com.trafficparrot.sdk.messaging.JmsResponse
All Implemented Interfaces:
Comparable<JmsResponse>
Direct Known Subclasses:
JmsResponse

public class JmsResponse extends Object implements Comparable<JmsResponse>
  • Field Details

    • NO_TRANSFORMER

      public static final String NO_TRANSFORMER
      See Also:
    • destination

      public final Destination destination
    • jmsResponseTransformerClassName

      public final String jmsResponseTransformerClassName
    • jmsResponseTransformerParameters

      public final com.github.tomakehurst.wiremock.extension.Parameters jmsResponseTransformerParameters
    • text

      public final String text
    • bodyFileName

      public final String bodyFileName
    • bodyType

      public final MessageBodyType bodyType
    • jmsMessageType

      public final String jmsMessageType
    • properties

      public final List<JmsProperty> properties
    • destinationLookup

      public final Optional<DestinationLookup> destinationLookup
    • fixedDelayMilliseconds

      public final long fixedDelayMilliseconds
    • resolvedText

      public final transient String resolvedText
      Content resolved from bodyFileName at load time. Held here rather than in text so the persisted model keeps bodyFileName set and text null (non-destructive). transient so the filesystem mapper never writes it to disk; set only via withResolvedText(String) and read via effectiveText(). The web-UI mapper re-includes it (via a mix-in) so the editor can display the content.
    • responseMessage

      @Deprecated public final transient Optional<javax.jms.Message> responseMessage
      Deprecated.
      Use jakartaResponseMessage instead. This field is kept for backward compatibility with old javax.jms customer plugins.
    • jakartaResponseMessage

      public final transient Optional<jakarta.jms.Message> jakartaResponseMessage
      A JmsResponseTransformer can return a jakarta.jms.Message object instead of just transforming the mapping values. The framework reads this field first; if empty, falls back to responseMessage for old plugins.
  • Constructor Details

  • Method Details

    • base64BytesResponse

      public static JmsResponse base64BytesResponse(Destination destination, byte[] bytes)
    • base64BytesResponse

      public static JmsResponse base64BytesResponse(Destination destination, String jmsResponseTransformerClassName, byte[] bytes)
    • printableCharactersBytesResponse

      public static JmsResponse printableCharactersBytesResponse(Destination destination, byte[] bytes)
    • printableCharactersBytesResponse

      public static JmsResponse printableCharactersBytesResponse(Destination destination, String jmsResponseTransformerClassName, byte[] bytes)
    • withJakartaResponseMessage

      public static JmsResponse withJakartaResponseMessage(Destination destination, jakarta.jms.Message jakartaMessage, long fixedDelayMilliseconds, Optional<DestinationLookup> destinationLookup)
    • withResolvedText

      public JmsResponse withResolvedText(String resolvedText)
      Returns a copy with resolvedText set (the content read from bodyFileName at load time). Every persisted field is preserved so a subsequent save re-writes bodyFileName with null text, keeping the sidecar reference intact.
    • effectiveText

      public String effectiveText()
      The response body content to send: the file-resolved resolvedText when set, otherwise the inline text.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(JmsResponse other)
      Specified by:
      compareTo in interface Comparable<JmsResponse>
    • hasTransformer

      public boolean hasTransformer()
    • validate

      public void validate() throws IOException
      Throws:
      IOException