Package org.swisspush.gateleen.logging
Class LoggingWriteStream
- java.lang.Object
-
- org.swisspush.gateleen.logging.LoggingWriteStream
-
- All Implemented Interfaces:
io.vertx.core.streams.StreamBase,io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
public class LoggingWriteStream extends Object implements io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
Wraps a WriteStream and feeds trsnferred Buffers into a LoggingHandler - interpreted either as request or response body content
-
-
Constructor Summary
Constructors Constructor Description LoggingWriteStream(io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> wrappedWriteStream, LoggingHandler loggingHandler, boolean isRequest)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>drainHandler(io.vertx.core.Handler<Void> handler)voidend(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>exceptionHandler(io.vertx.core.Handler<Throwable> handler)io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>setWriteQueueMaxSize(int maxSize)io.vertx.core.Future<Void>write(io.vertx.core.buffer.Buffer data)voidwrite(io.vertx.core.buffer.Buffer data, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)booleanwriteQueueFull()
-
-
-
Constructor Detail
-
LoggingWriteStream
public LoggingWriteStream(io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> wrappedWriteStream, LoggingHandler loggingHandler, boolean isRequest)- Parameters:
wrappedWriteStream- the WriteStream to be wrapped. Transferred Buffers will be loggedloggingHandler- Log the transferred Buffers to this LoggingHandlerisRequest- true: feed the Buffers into LoggingHandler.appendRequestPayload() false: feed them into LoggingHandler.appendResponsePayload()
-
-
Method Detail
-
exceptionHandler
public io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> exceptionHandler(io.vertx.core.Handler<Throwable> handler)
- Specified by:
exceptionHandlerin interfaceio.vertx.core.streams.StreamBase- Specified by:
exceptionHandlerin interfaceio.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
-
write
public io.vertx.core.Future<Void> write(io.vertx.core.buffer.Buffer data)
- Specified by:
writein interfaceio.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
-
write
public void write(io.vertx.core.buffer.Buffer data, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)- Specified by:
writein interfaceio.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
-
end
public void end(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
- Specified by:
endin interfaceio.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
-
setWriteQueueMaxSize
public io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> setWriteQueueMaxSize(int maxSize)
- Specified by:
setWriteQueueMaxSizein interfaceio.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
-
writeQueueFull
public boolean writeQueueFull()
- Specified by:
writeQueueFullin interfaceio.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
-
drainHandler
public io.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer> drainHandler(io.vertx.core.Handler<Void> handler)
- Specified by:
drainHandlerin interfaceio.vertx.core.streams.WriteStream<io.vertx.core.buffer.Buffer>
-
-