Class AbstractTigerRouteCallback

java.lang.Object
de.gematik.test.tiger.proxy.handler.AbstractTigerRouteCallback
All Implemented Interfaces:
ExpectationCallback
Direct Known Subclasses:
AbstractRouteProxyCallback, ForwardAllCallback

public abstract class AbstractTigerRouteCallback extends Object implements ExpectationCallback
Abstract super type handling the parsing logic for messages. It is the essential hook which allows the TigerProxy to gather the messages going through the MockServer. The actual implementations of this class deal with the routing of the messages.
  • Field Details

  • Constructor Details

  • Method Details

    • applyModifications

      public void applyModifications(HttpRequest request)
    • parseMessageAndApplyModifications

      public void parseMessageAndApplyModifications(HttpRequest request)
    • applyModifications

      public void applyModifications(HttpRequest request, HttpResponse response)
    • parseMessageAndApplyModifications

      public void parseMessageAndApplyModifications(HttpRequest request, HttpResponse response)
    • handle

      public final HttpRequest handle(HttpRequest req)
      Description copied from interface: ExpectationCallback
      Called for every request when expectation condition has been satisfied. The request that satisfied the expectation condition is passed as the parameter and the return value is the request that will be proxied.
      Specified by:
      handle in interface ExpectationCallback
      Parameters:
      req - the request that satisfied the expectation condition
      Returns:
      the request that will be proxied
    • propagateExceptionMessageSafe

      public void propagateExceptionMessageSafe(Exception exception)
    • handleRequest

      protected abstract HttpRequest handleRequest(HttpRequest req)
    • handle

      public final HttpResponse handle(HttpRequest req, HttpResponse resp, HttpRequest originalRequest)
      Description copied from interface: ExpectationCallback
      Called for every response received from a proxied request, the return value is the returned by MockServer.
      Specified by:
      handle in interface ExpectationCallback
      Parameters:
      req - the request that was proxied
      resp - the response the MockServer will return
      originalRequest - the original request
      Returns:
      the request that will be proxied
    • rewriteConcreteLocation

      protected String rewriteConcreteLocation(String originalLocation)
    • parseMessage

      public void parseMessage(HttpRequest mockServerRequest)
    • executeHttpRequestParsing

      public CompletableFuture<RbelElement> executeHttpRequestParsing(HttpRequest mockServerRequest)
    • extractProtocolAndHostForRequest

      protected abstract String extractProtocolAndHostForRequest(HttpRequest request)
    • doOutgoingResponseLogging

      public void doOutgoingResponseLogging(HttpResponse resp)
    • doIncomingRequestLogging

      public void doIncomingRequestLogging(HttpRequest req)
    • printTrafficTarget

      protected abstract String printTrafficTarget(HttpRequest req)
    • matches

      public boolean matches(HttpRequest request)
      Specified by:
      matches in interface ExpectationCallback
    • handleException

      public Action handleException(Throwable exception, HttpRequest request)
      Specified by:
      handleException in interface ExpectationCallback
    • getTigerProxy

      public TigerProxy getTigerProxy()
    • getTigerRoute

      public TigerProxyRoute getTigerRoute()
    • getPreviousMessageUuid

      public AtomicReference<String> getPreviousMessageUuid()
    • setPreviousMessageUuid

      public void setPreviousMessageUuid(AtomicReference<String> previousMessageUuid)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object