Class JmsResponse

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

@Deprecated public class JmsResponse extends JmsResponse
Deprecated.
Use JmsResponse instead. This class extends the new location and keeps the members plugins compiled against earlier SDKs link to: those taking the com.trafficparrot.sdk.messaging types, and the older ones taking the com.trafficparrot.sdk.jms types.
  • Field Details

    • properties

      public final List<JmsProperty> properties
      Deprecated.
      Hides the inherited properties with its old element type. The descriptor is the same erased java.util.List, so no compiled plugin needs this; source does: without it, List<jms.JmsProperty> p = response.properties stops compiling. Same list object as the parent's.
  • Constructor Details

    • JmsResponse

      public JmsResponse(Destination destination, String jmsResponseTransformerClassName, com.github.tomakehurst.wiremock.extension.Parameters jmsResponseTransformerParameters, String text, String bodyFileName, MessageBodyType bodyType, String jmsMessageType, List<JmsProperty> properties, Long fixedDelayInMilliseconds, Optional<DestinationLookup> destinationLookup, Optional<javax.jms.Message> responseMessage)
      Deprecated.
      Creates a response with every field a mapping file can set, as the constructor of JmsResponse with these parameters does.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      jmsResponseTransformerParameters - the mapping's parameters for its transformer; may be null
      text - the body; null when bodyFileName is set
      bodyFileName - a file under __files to read the body from; null when text is set
      bodyType - how the text is turned into the message body; null for TEXT
      jmsMessageType - the class name kept as JmsResponse.jmsMessageType; null for the one that suits the body type
      properties - the JMS properties to set on the message; null for none
      fixedDelayInMilliseconds - the delay before sending, in milliseconds; null for none
      destinationLookup - where the response is sent; empty for the default
      responseMessage - a javax.jms message to send as it is; empty to build one
    • JmsResponse

      public JmsResponse(Destination destination, String jmsResponseTransformerClassName, String text, MessageBodyType bodyType, String jmsMessageType, List<JmsProperty> properties, Long fixedDelayInMilliseconds)
      Deprecated.
      Creates a response with an inline body, JMS properties, a delay and a JMS message type.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      text - the body
      bodyType - how the text is turned into the message body; null for TEXT
      jmsMessageType - the class name kept as JmsResponse.jmsMessageType; null for the one that suits the body type
      properties - the JMS properties to set on the message; null for none
      fixedDelayInMilliseconds - the delay before sending, in milliseconds; null for none
    • JmsResponse

      public JmsResponse(Destination destination, String jmsResponseTransformerClassName, String text, MessageBodyType bodyType, List<JmsProperty> properties, long fixedDelayInMilliseconds)
      Deprecated.
      Creates a response with an inline body, JMS properties and a delay.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      text - the body
      bodyType - how the text is turned into the message body; null for TEXT
      properties - the JMS properties to set on the message; null for none
      fixedDelayInMilliseconds - the delay before sending, in milliseconds; 0 for none
    • JmsResponse

      public JmsResponse(Destination destination, String jmsResponseTransformerClassName, String text, MessageBodyType bodyType)
      Deprecated.
      Creates a response with an inline body of a given type, no JMS properties and no delay.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      text - the body
      bodyType - how the text is turned into the message body; null for TEXT
    • JmsResponse

      public JmsResponse(Destination destination, String jmsResponseTransformerClassName, String text)
      Deprecated.
      Creates a text response with no JMS properties and no delay.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      text - the body
    • JmsResponse

      public JmsResponse(Destination destination, String text)
      Deprecated.
      Creates a text response that uses no transformer.
      Parameters:
      destination - the queue or topic to send the response to
      text - the body
    • JmsResponse

      public JmsResponse(Destination destination, String jmsResponseTransformerClassName, Object object) throws com.fasterxml.jackson.core.JsonProcessingException
      Deprecated.
      Creates a response whose body is a Java object.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      object - the object to send
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if the object cannot be written as JSON
    • JmsResponse

      public JmsResponse(Destination destination, Object object) throws com.fasterxml.jackson.core.JsonProcessingException
      Deprecated.
      Creates a response that uses no transformer and whose body is a Java object.
      Parameters:
      destination - the queue or topic to send the response to
      object - the object to send
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if the object cannot be written as JSON
    • JmsResponse

      public JmsResponse(Destination destination, String jmsResponseTransformerClassName, com.github.tomakehurst.wiremock.extension.Parameters jmsResponseTransformerParameters, String text, MessageBodyType bodyType, String jmsMessageType, List<JmsProperty> properties, Long fixedDelayInMilliseconds, Optional<?> destinationLookup, Optional<javax.jms.Message> responseMessage)
      Deprecated.
      Creates a response with an inline body and every other field, from the com.trafficparrot.sdk.jms types.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      jmsResponseTransformerParameters - the mapping's parameters for its transformer; may be null
      text - the body
      bodyType - how the text is turned into the message body; null for TEXT
      jmsMessageType - the class name kept as JmsResponse.jmsMessageType; null for the one that suits the body type
      properties - the JMS properties to set on the message; null for none
      fixedDelayInMilliseconds - the delay before sending, in milliseconds; null for none
      destinationLookup - where the response is sent, as a destination lookup of either package; empty for the default
      responseMessage - a javax.jms message to send as it is; empty to build one
    • JmsResponse

      public JmsResponse(Destination destination, String jmsResponseTransformerClassName, String text, MessageBodyType bodyType, String jmsMessageType, List<JmsProperty> properties, Long fixedDelayInMilliseconds)
      Deprecated.
      Creates a response with an inline body, JMS properties, a delay and a JMS message type, from the com.trafficparrot.sdk.jms types.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      text - the body
      bodyType - how the text is turned into the message body; null for TEXT
      jmsMessageType - the class name kept as JmsResponse.jmsMessageType; null for the one that suits the body type
      properties - the JMS properties to set on the message; null for none
      fixedDelayInMilliseconds - the delay before sending, in milliseconds; null for none
    • JmsResponse

      public JmsResponse(Destination destination, String jmsResponseTransformerClassName, String text, MessageBodyType bodyType, List<JmsProperty> properties, long fixedDelayInMilliseconds)
      Deprecated.
      Creates a response with an inline body, JMS properties and a delay, from the com.trafficparrot.sdk.jms types.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      text - the body
      bodyType - how the text is turned into the message body; null for TEXT
      properties - the JMS properties to set on the message; null for none
      fixedDelayInMilliseconds - the delay before sending, in milliseconds; 0 for none
    • JmsResponse

      public JmsResponse(Destination destination, String jmsResponseTransformerClassName, String text, MessageBodyType bodyType)
      Deprecated.
      Creates a response with an inline body of a given type, from the com.trafficparrot.sdk.jms types.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      text - the body
      bodyType - how the text is turned into the message body; null for TEXT
    • JmsResponse

      public JmsResponse(Destination destination, String jmsResponseTransformerClassName, String text)
      Deprecated.
      Creates a text response, from the com.trafficparrot.sdk.jms destination type.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      text - the body
    • JmsResponse

      public JmsResponse(Destination destination, String text)
      Deprecated.
      Creates a text response that uses no transformer, from the com.trafficparrot.sdk.jms destination type.
      Parameters:
      destination - the queue or topic to send the response to
      text - the body
    • JmsResponse

      public JmsResponse(Destination destination, String jmsResponseTransformerClassName, Object object) throws com.fasterxml.jackson.core.JsonProcessingException
      Deprecated.
      Creates a response whose body is a Java object, from the com.trafficparrot.sdk.jms destination type.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      object - the object to send
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if the object cannot be written as JSON
    • JmsResponse

      public JmsResponse(Destination destination, Object object) throws com.fasterxml.jackson.core.JsonProcessingException
      Deprecated.
      Creates a response that uses no transformer and whose body is a Java object, from the com.trafficparrot.sdk.jms destination type.
      Parameters:
      destination - the queue or topic to send the response to
      object - the object to send
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - if the object cannot be written as JSON
  • Method Details

    • base64BytesResponse

      public static JmsResponse base64BytesResponse(Destination destination, byte[] bytes)
      Deprecated.
      A response that uses no transformer and whose body is these bytes, held as Base64.
      Parameters:
      destination - the queue or topic to send the response to
      bytes - the body
      Returns:
      the response
    • base64BytesResponse

      public static JmsResponse base64BytesResponse(Destination destination, String jmsResponseTransformerClassName, byte[] bytes)
      Deprecated.
      A response whose body is these bytes, held as Base64.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      bytes - the body
      Returns:
      the response
    • printableCharactersBytesResponse

      public static JmsResponse printableCharactersBytesResponse(Destination destination, byte[] bytes)
      Deprecated.
      A response that uses no transformer and whose body is these bytes, held in the printable-characters encoding.
      Parameters:
      destination - the queue or topic to send the response to
      bytes - the body
      Returns:
      the response
    • printableCharactersBytesResponse

      public static JmsResponse printableCharactersBytesResponse(Destination destination, String jmsResponseTransformerClassName, byte[] bytes)
      Deprecated.
      A response whose body is these bytes, held in the printable-characters encoding.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      bytes - the body
      Returns:
      the response
    • base64BytesResponse

      public static JmsResponse base64BytesResponse(Destination destination, byte[] bytes)
      Deprecated.
      A response that uses no transformer and whose body is these bytes, held as Base64, from the com.trafficparrot.sdk.jms destination type.
      Parameters:
      destination - the queue or topic to send the response to
      bytes - the body
      Returns:
      the response
    • base64BytesResponse

      public static JmsResponse base64BytesResponse(Destination destination, String jmsResponseTransformerClassName, byte[] bytes)
      Deprecated.
      A response whose body is these bytes, held as Base64, from the com.trafficparrot.sdk.jms destination type.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      bytes - the body
      Returns:
      the response
    • printableCharactersBytesResponse

      public static JmsResponse printableCharactersBytesResponse(Destination destination, byte[] bytes)
      Deprecated.
      A response that uses no transformer and whose body is these bytes, held in the printable-characters encoding, from the com.trafficparrot.sdk.jms destination type.
      Parameters:
      destination - the queue or topic to send the response to
      bytes - the body
      Returns:
      the response
    • printableCharactersBytesResponse

      public static JmsResponse printableCharactersBytesResponse(Destination destination, String jmsResponseTransformerClassName, byte[] bytes)
      Deprecated.
      A response whose body is these bytes, held in the printable-characters encoding, from the com.trafficparrot.sdk.jms destination type.
      Parameters:
      destination - the queue or topic to send the response to
      jmsResponseTransformerClassName - the transformer's class name, or NO_TRANSFORMER
      bytes - the body
      Returns:
      the response
    • withJakartaResponseMessage

      public static JmsResponse withJakartaResponseMessage(Destination destination, jakarta.jms.Message jakartaMessage, long fixedDelayMilliseconds, Optional<DestinationLookup> destinationLookup)
      Deprecated.
      A response that sends a jakarta.jms message the transformer has built itself.
      Parameters:
      destination - the queue or topic to send the response to
      jakartaMessage - the message to send
      fixedDelayMilliseconds - the delay before sending, in milliseconds; 0 for none
      destinationLookup - where the response is sent; empty for the default
      Returns:
      the response, which uses no transformer
    • withResolvedText

      public JmsResponse withResolvedText(String resolvedText)
      Deprecated.
      Description copied from class: JmsResponse
      Returns a copy with resolvedText set (the content read from JmsResponse.bodyFileName at load time). Every persisted field is preserved so a subsequent save re-writes bodyFileName with null text, keeping the sidecar reference intact.
      Overrides:
      withResolvedText in class JmsResponse
      Parameters:
      resolvedText - the content of the JmsResponse.bodyFileName file
      Returns:
      the copy
    • compareTo

      public int compareTo(JmsResponse other)
      Deprecated.
      The compareTo plugins compiled when this class was Comparable<JmsResponse>.
      Parameters:
      other - the response to compare this one with
      Returns:
      a negative number, zero or a positive number as this response's destination, then its text, sorts before, with or after the other's