Package io.fluxcapacitor.javaclient.web
Class WebResponseCompressingInterceptor
java.lang.Object
io.fluxcapacitor.javaclient.web.WebResponseCompressingInterceptor
- All Implemented Interfaces:
DispatchInterceptor
-
Field Summary
Fields inherited from interface io.fluxcapacitor.javaclient.publishing.DispatchInterceptor
noOp -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected SerializedMessagecompress(SerializedMessage serializedMessage) interceptDispatch(Message message, MessageType messageType) Intercepts the publication of a message.modifySerializedMessage(SerializedMessage response, Message message, MessageType type) Enables modification of theSerializedMessagebefore it is published.protected booleanshouldCompress(SerializedMessage response) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.fluxcapacitor.javaclient.publishing.DispatchInterceptor
andThen
-
Constructor Details
-
WebResponseCompressingInterceptor
public WebResponseCompressingInterceptor() -
WebResponseCompressingInterceptor
public WebResponseCompressingInterceptor(int minimumLength)
-
-
Method Details
-
modifySerializedMessage
public SerializedMessage modifySerializedMessage(SerializedMessage response, Message message, MessageType type) Description copied from interface:DispatchInterceptorEnables modification of theSerializedMessagebefore it is published.This method is typically invoked by message gateways right before publication of a message (so after
DispatchInterceptor.interceptDispatch(io.fluxcapacitor.javaclient.common.Message, io.fluxcapacitor.common.MessageType)is invoked).Although message publication is stopped when
nullis returned or an exception is thrown, it is preferable to useDispatchInterceptor.interceptDispatch(io.fluxcapacitor.javaclient.common.Message, io.fluxcapacitor.common.MessageType)for that.- Specified by:
modifySerializedMessagein interfaceDispatchInterceptor
-
acceptCompression
protected boolean acceptCompression() -
shouldCompress
-
compress
-
interceptDispatch
Description copied from interface:DispatchInterceptorIntercepts the publication of a message. Implementers can use this to modify the contents of a message or block the publication altogether.Return
nullor throw an exception to prevent publication of the message.- Specified by:
interceptDispatchin interfaceDispatchInterceptor
-