Class ExchangeHandler


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

      Constructors 
      Constructor Description
      ExchangeHandler()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean after​(Exchange exchange, com.google.common.collect.FluentIterable<Exchange> partialOutputLog)
      Called after the exchange has been replayed.
      Exchange before​(Exchange exchange)
      Called before un exchange is replayed.
      boolean resetTailOutputLog()
      By default, the tail output log is reset before each input exchange.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExchangeHandler

        public ExchangeHandler()
    • Method Detail

      • before

        public Exchange before​(Exchange exchange)
                        throws java.lang.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:
        java.lang.Exception - Exception
      • after

        public boolean after​(Exchange exchange,
                             com.google.common.collect.FluentIterable<Exchange> partialOutputLog)
                      throws java.lang.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:
        java.lang.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