Package com.trafficparrot.sdk.jms
Class JmsResponseTransformer
java.lang.Object
com.trafficparrot.sdk.messaging.JmsResponseTransformer
com.trafficparrot.sdk.jms.JmsResponseTransformer
- All Implemented Interfaces:
com.trafficparrot.sdk.internal.RenderableInUI
- Direct Known Subclasses:
TextJmsResponseTransformer
Deprecated.
-
Field Summary
Fields inherited from class com.trafficparrot.sdk.messaging.JmsResponseTransformer
logger -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Creates the transformer with a logger named after this class.JmsResponseTransformer(org.slf4j.Logger logger) Deprecated.Creates the transformer with a logger of the extension's choice. -
Method Summary
Modifier and TypeMethodDescriptionprotected JmsResponsedoTransform(Destination requestDestination, javax.jms.Message requestMessage, JmsResponse response) Deprecated.OverridedoTransform(Destination, javax.jms.Message, JmsResponse, Parameters)instead.protected JmsResponsedoTransform(Destination requestDestination, javax.jms.Message requestMessage, JmsResponse response, com.github.tomakehurst.wiremock.extension.Parameters parameters) Deprecated.The transformation, for an extension that works withjavax.jmsmessages.protected final JmsResponsedoTransform(Destination requestDestination, javax.jms.Message requestMessage, JmsResponse response, com.github.tomakehurst.wiremock.extension.Parameters parameters) Deprecated.javax.jms extensions override this method.protected JmsResponsedoTransformJakarta(Destination requestDestination, jakarta.jms.Message requestMessage, JmsResponse response, com.github.tomakehurst.wiremock.extension.Parameters parameters) Deprecated.The transformation, for an extension that works withjakarta.jmsmessages.protected final JmsResponsedoTransformJakarta(Destination requestDestination, jakarta.jms.Message requestMessage, JmsResponse response, com.github.tomakehurst.wiremock.extension.Parameters parameters) Deprecated.jakarta.jms extensions override this method.booleanDeprecated.Whether Traffic Parrot callsdoTransformJakartarather thandoTransform.final JmsResponsetransform(Destination requestDestination, javax.jms.Message requestMessage, JmsResponse response, com.github.tomakehurst.wiremock.extension.Parameters parameters) Deprecated.The entry point for plugins compiled against thecom.trafficparrot.sdk.jmstypes.final JmsResponsetransform(Destination requestDestination, javax.jms.Message requestMessage, JmsResponse response, com.github.tomakehurst.wiremock.extension.Parameters parameters) Deprecated.Called by Traffic Parrot for an extension that works withjavax.jmsmessages, asJmsResponseTransformer.transform(com.trafficparrot.sdk.messaging.Destination, javax.jms.Message, com.trafficparrot.sdk.messaging.JmsResponse, com.github.tomakehurst.wiremock.extension.Parameters)describes.final JmsResponsetransformJakarta(Destination requestDestination, jakarta.jms.Message requestMessage, JmsResponse response, com.github.tomakehurst.wiremock.extension.Parameters parameters) Deprecated.Called by Traffic Parrot for an extension that works withjakarta.jmsmessages, asJmsResponseTransformer.transformJakarta(com.trafficparrot.sdk.messaging.Destination, jakarta.jms.Message, com.trafficparrot.sdk.messaging.JmsResponse, com.github.tomakehurst.wiremock.extension.Parameters)describes.Methods inherited from class com.trafficparrot.sdk.messaging.JmsResponseTransformer
getDisplayName, transform, transformJakarta
-
Constructor Details
-
JmsResponseTransformer
public JmsResponseTransformer()Deprecated.Creates the transformer with a logger named after this class. -
JmsResponseTransformer
public JmsResponseTransformer(org.slf4j.Logger logger) Deprecated.Creates the transformer with a logger of the extension's choice.- Parameters:
logger- the logger to use
-
-
Method Details
-
transformJakarta
public final JmsResponse transformJakarta(Destination requestDestination, jakarta.jms.Message requestMessage, JmsResponse response, com.github.tomakehurst.wiremock.extension.Parameters parameters) Deprecated.Called by Traffic Parrot for an extension that works withjakarta.jmsmessages, asJmsResponseTransformer.transformJakarta(com.trafficparrot.sdk.messaging.Destination, jakarta.jms.Message, com.trafficparrot.sdk.messaging.JmsResponse, com.github.tomakehurst.wiremock.extension.Parameters)describes.- Parameters:
requestDestination- the queue or topic the request message arrived onrequestMessage- the request messageresponse- the mapping's response, as writtenparameters- Traffic Parrot's runtime properties- Returns:
- what the transformation returned, or the error reply
-
transform
public final JmsResponse transform(Destination requestDestination, javax.jms.Message requestMessage, JmsResponse response, com.github.tomakehurst.wiremock.extension.Parameters parameters) Deprecated.Called by Traffic Parrot for an extension that works withjavax.jmsmessages, asJmsResponseTransformer.transform(com.trafficparrot.sdk.messaging.Destination, javax.jms.Message, com.trafficparrot.sdk.messaging.JmsResponse, com.github.tomakehurst.wiremock.extension.Parameters)describes.- Parameters:
requestDestination- the queue or topic the request message arrived onrequestMessage- the request messageresponse- the mapping's response, as writtenparameters- Traffic Parrot's runtime properties- Returns:
- what the transformation returned, or the error reply
-
transform
public final JmsResponse transform(Destination requestDestination, javax.jms.Message requestMessage, JmsResponse response, com.github.tomakehurst.wiremock.extension.Parameters parameters) Deprecated.The entry point for plugins compiled against thecom.trafficparrot.sdk.jmstypes.- Parameters:
requestDestination- the queue or topic the request message arrived onrequestMessage- the request messageresponse- the mapping's response, as writtenparameters- Traffic Parrot's runtime properties- Returns:
- what the transformation returned, or the error reply
-
doTransform
protected final JmsResponse doTransform(Destination requestDestination, javax.jms.Message requestMessage, JmsResponse response, com.github.tomakehurst.wiremock.extension.Parameters parameters) throws Exception Deprecated.Description copied from class:JmsResponseTransformerjavax.jms extensions override this method.- Overrides:
doTransformin classJmsResponseTransformer- Parameters:
requestDestination- the queue or topic the request message arrived onrequestMessage- the request message, as ajavax.jmsview of the message Traffic Parrot receivedresponse- the mapping's response, as written. ItsJmsResponse.jmsResponseTransformerParametersare the mapping's own parameters for this transformerparameters- Traffic Parrot's runtime properties:(Properties) parameters.get("properties")for the virtual service and"sharedProperties"for the installation root, each withdataDirectory,databaseConnectionsFileandscenarioDirectory- Returns:
- the response to render and send. Its
jmsResponseTransformerClassNamemust beJmsResponse.NO_TRANSFORMER, as the two-argumentJmsResponseconstructors andJmsResponseBuilderset it - Throws:
Exception- if the response cannot be transformed; the reply is then a text message that names this class and the exception's message, sent asJmsResponseTransformer.transformJakarta(com.trafficparrot.sdk.messaging.Destination, jakarta.jms.Message, com.trafficparrot.sdk.messaging.JmsResponse, com.github.tomakehurst.wiremock.extension.Parameters)describes, and the exception is loggedIllegalStateException- if the extension overrides neither this method norJmsResponseTransformer.doTransformJakarta(com.trafficparrot.sdk.messaging.Destination, jakarta.jms.Message, com.trafficparrot.sdk.messaging.JmsResponse, com.github.tomakehurst.wiremock.extension.Parameters)
-
doTransformJakarta
protected final JmsResponse doTransformJakarta(Destination requestDestination, jakarta.jms.Message requestMessage, JmsResponse response, com.github.tomakehurst.wiremock.extension.Parameters parameters) throws Exception Deprecated.Description copied from class:JmsResponseTransformerjakarta.jms extensions override this method.- Overrides:
doTransformJakartain classJmsResponseTransformer- Parameters:
requestDestination- the queue or topic the request message arrived onrequestMessage- the request message, as Traffic Parrot received itresponse- the mapping's response, as written. ItsJmsResponse.jmsResponseTransformerParametersare the mapping's own parameters for this transformerparameters- Traffic Parrot's runtime properties:(Properties) parameters.get("properties")for the virtual service and"sharedProperties"for the installation root, each withdataDirectory,databaseConnectionsFileandscenarioDirectory- Returns:
- the response to render and send. Its
jmsResponseTransformerClassNamemust beJmsResponse.NO_TRANSFORMER, as the two-argumentJmsResponseconstructors,JmsResponse.withJakartaResponseMessage(com.trafficparrot.sdk.messaging.Destination, jakarta.jms.Message, long, java.util.Optional<com.trafficparrot.sdk.messaging.DestinationLookup>)andJmsResponseBuilderset it - Throws:
Exception- if the response cannot be transformed; the reply is then a text message that names this class and the exception's message, sent asJmsResponseTransformer.transformJakarta(com.trafficparrot.sdk.messaging.Destination, jakarta.jms.Message, com.trafficparrot.sdk.messaging.JmsResponse, com.github.tomakehurst.wiremock.extension.Parameters)describes, and the exception is loggedIllegalStateException- if the extension does not override this method
-
doTransform
@Deprecated protected JmsResponse doTransform(Destination requestDestination, javax.jms.Message requestMessage, JmsResponse response) throws Exception Deprecated.OverridedoTransform(Destination, javax.jms.Message, JmsResponse, Parameters)instead.For backwards compatibility, allow old extensions to override only the method withoutParameters.- Parameters:
requestDestination- the queue or topic the request message arrived onrequestMessage- the request messageresponse- the mapping's response, as written- Returns:
- the response to render and send, which must name no transformer
- Throws:
Exception- if the response cannot be transformedIllegalStateException- if the extension overrides nodoTransformmethod
-
doTransform
protected JmsResponse doTransform(Destination requestDestination, javax.jms.Message requestMessage, JmsResponse response, com.github.tomakehurst.wiremock.extension.Parameters parameters) throws Exception Deprecated.The transformation, for an extension that works withjavax.jmsmessages. Unless overridden it calls the form withoutParameters.- Parameters:
requestDestination- the queue or topic the request message arrived onrequestMessage- the request messageresponse- the mapping's response, as writtenparameters- Traffic Parrot's runtime properties, asJmsResponseTransformer.doTransform(com.trafficparrot.sdk.messaging.Destination, javax.jms.Message, com.trafficparrot.sdk.messaging.JmsResponse, com.github.tomakehurst.wiremock.extension.Parameters)describes- Returns:
- the response to render and send, which must name no transformer
- Throws:
Exception- if the response cannot be transformed; the reply is then an error message
-
doTransformJakarta
protected JmsResponse doTransformJakarta(Destination requestDestination, jakarta.jms.Message requestMessage, JmsResponse response, com.github.tomakehurst.wiremock.extension.Parameters parameters) throws Exception Deprecated.The transformation, for an extension that works withjakarta.jmsmessages.- Parameters:
requestDestination- the queue or topic the request message arrived onrequestMessage- the request messageresponse- the mapping's response, as writtenparameters- Traffic Parrot's runtime properties, asJmsResponseTransformer.doTransformJakarta(com.trafficparrot.sdk.messaging.Destination, jakarta.jms.Message, com.trafficparrot.sdk.messaging.JmsResponse, com.github.tomakehurst.wiremock.extension.Parameters)describes- Returns:
- the response to render and send, which must name no transformer
- Throws:
Exception- if the response cannot be transformed; the reply is then an error messageIllegalStateException- if the extension does not override this method
-
isJakartaPlugin
public boolean isJakartaPlugin()Deprecated.Whether Traffic Parrot callsdoTransformJakartarather thandoTransform.- Overrides:
isJakartaPluginin classJmsResponseTransformer- Returns:
- true if the extension's own class declares
doTransformJakarta; one it inherits does not count
-
JmsResponseTransformerinstead. This class extends the new location and bridges its hooks to the ones below, which keep the descriptors plugins compiled against earlier SDKs override.