Class ExchangeHandler


  • public class ExchangeHandler
    extends Object
    Allows to intercept the exchanges before and after performing the request.
    Author:
    https://github.com/lbovet [Laurent Bovet]
    • Constructor Detail

      • ExchangeHandler

        public ExchangeHandler()
    • Method Detail

      • before

        public Exchange before​(Exchange exchange)
                        throws Exception
        Called before un exchange is replayed.
        Parameters:
        exchange - the exchange from input log about to be replayed.
        Returns:
        the exchange that will actually be replayed. Return the incoming exchange to play it unmodified. If null, this exchange will be skipped.
        Throws:
        Exception - Exception
      • after

        public boolean after​(Exchange exchange,
                             com.google.common.collect.FluentIterable<Exchange> partialOutputLog)
                      throws Exception
        Called after the exchange has been replayed.
        Parameters:
        exchange - the actual exchanged. Contains the original request and the actual response of the replay.
        partialOutputLog - a request log generated by the collector since the last request or according to resetTailOutputLog().
        Returns:
        true if the player should continue, false to make it stop now.
        Throws:
        Exception - Exception
      • resetTailOutputLog

        public boolean resetTailOutputLog()
        By default, the tail output log is reset before each input exchange. This can be overriden to control when it must be reset.
        Returns:
        true by default