Class ExchangeHandler
- java.lang.Object
-
- org.swisspush.gateleen.player.player.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 Summary
Constructors Constructor Description ExchangeHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanafter(Exchange exchange, com.google.common.collect.FluentIterable<Exchange> partialOutputLog)Called after the exchange has been replayed.Exchangebefore(Exchange exchange)Called before un exchange is replayed.booleanresetTailOutputLog()By default, the tail output log is reset before each input exchange.
-
-
-
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 toresetTailOutputLog().- 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
-
-