Class IbmMqResponse

java.lang.Object
com.trafficparrot.sdk.ibmmq.IbmMqResponse
All Implemented Interfaces:
Comparable<IbmMqResponse>

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

    • NO_TRANSFORMER

      public static final String NO_TRANSFORMER
      See Also:
    • destination

      public final Destination destination
    • ibmMqResponseTransformerClassName

      public final String ibmMqResponseTransformerClassName
    • format

      public final IbmMqMessageFormat format
    • text

      public final String text
    • bodyFileName

      public final String bodyFileName
    • fixedDelayMilliseconds

      public final long fixedDelayMilliseconds
    • characterSet

      public final IbmMqCharacterSet characterSet
    • destinationLookup

      public final Optional<DestinationLookup> destinationLookup
    • replyToQueueManagerName

      public final String replyToQueueManagerName
    • replyToQueueName

      public final String replyToQueueName
    • 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

      public final transient Optional<com.ibm.mq.MQMessage> responseMessage
      A IbmMqResponseTransformer can return an MQMessage object instead of just transforming the mapping values.
  • Constructor Details

  • Method Details

    • withResponseMessage

      public static IbmMqResponse withResponseMessage(Destination destination, com.ibm.mq.MQMessage responseMessage, long fixedDelayMilliseconds, Optional<DestinationLookup> destinationLookup)
      Static: builds a new response that sends responseMessage as it is, as the (Destination, MQMessage, long, Optional) constructor does, taking the destination lookup as DestinationLookup rather than the deprecated IBM MQ enum. Optional.of(USE_MAPPING_RESPONSE_DESTINATION) sends it to destination, ignoring the reply-to queue name the request carries; Optional.empty() or the default constant send it to that reply-to queue when the request names one, else to destination.
    • createMessage

      public com.ibm.mq.MQMessage createMessage(byte[] correlationId, String replyToQueueManagerNameHeader, String replyToQueueNameHeader) throws IOException
      Throws:
      IOException
    • writeMessage

      public static void writeMessage(com.ibm.mq.MQMessage mqMessage, IbmMqMessageFormat format, String text) throws IOException
      Throws:
      IOException
    • writeMessage

      public static void writeMessage(com.ibm.mq.MQMessage mqMessage, IbmMqMessageFormat format, String text, int characterSet) throws IOException
      Throws:
      IOException
    • withResolvedText

      public IbmMqResponse 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.
    • validate

      public void validate() throws IOException
      Throws:
      IOException
    • useDefaultDestinationLookup

      public boolean useDefaultDestinationLookup()
    • forceMappingDestinationLookup

      public boolean forceMappingDestinationLookup()
    • hasTransformer

      public boolean hasTransformer()
    • toString

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

      public int compareTo(IbmMqResponse other)
      Specified by:
      compareTo in interface Comparable<IbmMqResponse>