Top Description Fields Constructors Methods
reactor.netty5.http.server

pack-priv final Class HttpTrafficHandler

extends ChannelHandlerAdapter
implements Runnable, FutureContextListener<Channel, Void>
Class Inheritance
All Implemented Interfaces
io.netty5.util.concurrent.FutureContextListener, java.lang.Runnable
Imports
java.net.SocketAddress, java.time.Duration, java.util.Optional, .Queue, java.util.function.BiFunction, .BiPredicate, io.netty5.channel.Channel, .ChannelFutureListeners, .ChannelHandlerAdapter, .ChannelHandlerContext, io.netty5.handler.codec.DecoderResult, .DecoderResultProvider, io.netty5.handler.codec.http.HttpHeaderNames, .HttpObject, .HttpRequest, .HttpResponse, .HttpResponseStatus, .HttpStatusClass, .HttpVersion, .LastHttpContent, io.netty5.handler.ssl.SslHandler, io.netty5.util.Resource, io.netty5.util.concurrent.Future, .FutureContextListener, reactor.core.Exceptions, reactor.core.publisher.Mono, reactor.netty5.Connection, .ConnectionObserver, reactor.netty5.http.logging.HttpMessageArgProviderFactory, .HttpMessageLogFactory, reactor.util.annotation.Nullable, reactor.util.concurrent.Queues

Replace io.netty5.handler.codec.http.HttpServerKeepAliveHandler with extra handler management.

Field Summary

Modifier and TypeField and Description
pack-priv final BiPredicate<HttpServerRequest, HttpServerResponse>
pack-priv ChannelHandlerContext
pack-priv final HttpServerFormDecoderProvider
pack-priv final BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo>
pack-priv static final HttpVersion
pack-priv final HttpMessageLogFactory
pack-priv final Duration
pack-priv final ConnectionObserver
pack-priv final BiFunction<? super Mono<Void>, ? super Connection, ? extends Mono<Void>>
pack-priv final int
pack-priv static final String
pack-priv boolean
pack-priv boolean
pack-priv int
pack-priv boolean
pack-priv Queue<Object>
pack-priv SocketAddress
pack-priv Boolean

Constructor Summary

AccessConstructor and Description
pack-priv
HttpTrafficHandler(BiPredicate<HttpServerRequest, HttpServerResponse> compress, HttpServerFormDecoderProvider formDecoderProvider, BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo> forwardedHeaderHandler, HttpMessageLogFactory httpMessageLogFactory, Duration idleTimeout, ConnectionObserver listener, BiFunction<? super Mono<Void>, ? super Connection, ? extends Mono<Void>> mapHandle, int maxKeepAliveRequests)

Method Summary

Modifier and TypeMethod and Description
public void
public void
channelRead(ChannelHandlerContext ctx, Object msg)

Overrides default io.netty5.channel.ChannelHandler.channelRead.

Invoked when the current Channel has read a message from the peer.
public void
pack-priv final void
pack-priv void
public void
handlerAdded(ChannelHandlerContext ctx)

Overrides default io.netty5.channel.ChannelHandler.handlerAdded.

Gets called after the ChannelHandler was added to the actual context and it's ready to handle events.
public void
handlerRemoved(ChannelHandlerContext ctx)

Overrides default io.netty5.channel.ChannelHandler.handlerRemoved.

Gets called after the ChannelHandler was removed from the actual context and it doesn't handle events anymore.
pack-priv static boolean
pack-priv static boolean
pack-priv static boolean
pack-priv static boolean

Returns:

true if the response has a self defined message length.
isSelfDefinedMessageLength
(HttpResponse
The HttpResponse to check
response
)

Keep-alive only works if the client can detect when the message has ended without relying on the connection being closed.

public void
operationComplete(Channel channel, Future<? extends Void>
the source Future which called this callback
future
)

Implements io.netty5.util.concurrent.FutureContextListener.operationComplete.

Invoked when the operation associated with the Future has been completed.
pack-priv Future<Void>
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
pack-priv void
pack-priv boolean
public Future<Void>
write(ChannelHandlerContext
the ChannelHandlerContext for which the write operation is made
ctx
,
Object
the message to write
msg
)

Overrides default io.netty5.channel.ChannelHandler.write.

Called once a write operation is made.

Field Detail

compressback to summary
pack-priv final BiPredicate<HttpServerRequest, HttpServerResponse> compress
ctxback to summary
pack-priv ChannelHandlerContext ctx
formDecoderProviderback to summary
pack-priv final HttpServerFormDecoderProvider formDecoderProvider
forwardedHeaderHandlerback to summary
pack-priv final BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo> forwardedHeaderHandler
H2back to summary
pack-priv static final HttpVersion H2
httpMessageLogFactoryback to summary
pack-priv final HttpMessageLogFactory httpMessageLogFactory
idleTimeoutback to summary
pack-priv final Duration idleTimeout
listenerback to summary
pack-priv final ConnectionObserver listener
mapHandleback to summary
pack-priv final BiFunction<? super Mono<Void>, ? super Connection, ? extends Mono<Void>> mapHandle
maxKeepAliveRequestsback to summary
pack-priv final int maxKeepAliveRequests
MULTIPART_PREFIXback to summary
pack-priv static final String MULTIPART_PREFIX
nonInformationalResponseback to summary
pack-priv boolean nonInformationalResponse
overflowback to summary
pack-priv boolean overflow
pendingResponsesback to summary
pack-priv int pendingResponses
persistentConnectionback to summary
pack-priv boolean persistentConnection
pipelinedback to summary
pack-priv Queue<Object> pipelined
remoteAddressback to summary
pack-priv SocketAddress remoteAddress
secureback to summary
pack-priv Boolean secure

Constructor Detail

HttpTrafficHandlerback to summary
pack-priv HttpTrafficHandler(BiPredicate<HttpServerRequest, HttpServerResponse> compress, HttpServerFormDecoderProvider formDecoderProvider, BiFunction<ConnectionInfo, HttpRequest, ConnectionInfo> forwardedHeaderHandler, HttpMessageLogFactory httpMessageLogFactory, Duration idleTimeout, ConnectionObserver listener, BiFunction<? super Mono<Void>, ? super Connection, ? extends Mono<Void>> mapHandle, int maxKeepAliveRequests)

Method Detail

channelActiveback to summary
public void channelActive(ChannelHandlerContext ctx)

Overrides default io.netty5.channel.ChannelHandler.channelActive.

Doc from io.netty5.channel.ChannelHandler.channelActive.

The Channel of the ChannelHandlerContext is now active

Annotations
@Override
channelReadback to summary
public void channelRead(ChannelHandlerContext ctx, Object msg)

Overrides default io.netty5.channel.ChannelHandler.channelRead.

Doc from io.netty5.channel.ChannelHandler.channelRead.

Invoked when the current Channel has read a message from the peer.

Annotations
@Override
channelRegisteredback to summary
public void channelRegistered(ChannelHandlerContext ctx)

Overrides default io.netty5.channel.ChannelHandler.channelRegistered.

Doc from io.netty5.channel.ChannelHandler.channelRegistered.

The Channel of the ChannelHandlerContext was registered with its EventLoop

Annotations
@Override
discardback to summary
pack-priv final void discard()
doPipelineback to summary
pack-priv void doPipeline(ChannelHandlerContext ctx, Object msg)
handlerAddedback to summary
public void handlerAdded(ChannelHandlerContext ctx) throws Exception

Overrides default io.netty5.channel.ChannelHandler.handlerAdded.

Doc from io.netty5.channel.ChannelHandler.handlerAdded.

Gets called after the ChannelHandler was added to the actual context and it's ready to handle events.

Annotations
@Override
handlerRemovedback to summary
public void handlerRemoved(ChannelHandlerContext ctx)

Overrides default io.netty5.channel.ChannelHandler.handlerRemoved.

Doc from io.netty5.channel.ChannelHandler.handlerRemoved.

Gets called after the ChannelHandler was removed from the actual context and it doesn't handle events anymore.

Annotations
@Override
isInformationalback to summary
pack-priv static boolean isInformational(HttpResponse response)
isMultipartback to summary
pack-priv static boolean isMultipart(HttpResponse response)
isNotModifiedback to summary
pack-priv static boolean isNotModified(HttpResponse response)
isSelfDefinedMessageLengthback to summary
pack-priv static boolean isSelfDefinedMessageLength(HttpResponse response)

Keep-alive only works if the client can detect when the message has ended without relying on the connection being closed.

Parameters
response:HttpResponse

The HttpResponse to check

Returns:boolean

true if the response has a self defined message length.

operationCompleteback to summary
public void operationComplete(Channel channel, Future<? extends Void> future)

Implements io.netty5.util.concurrent.FutureContextListener.operationComplete.

Doc from io.netty5.util.concurrent.FutureContextListener.operationComplete.

Invoked when the operation associated with the Future has been completed.

Parameters
future:Future<? extends Void>

the source Future which called this callback

Annotations
@Override
responseAlreadySentback to summary
pack-priv Future<Void> responseAlreadySent(Object msg)
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
sendDecodingFailuresback to summary
pack-priv void sendDecodingFailures(Throwable t, Object msg)
shouldKeepAliveback to summary
pack-priv boolean shouldKeepAlive()
writeback to summary
public Future<Void> write(ChannelHandlerContext ctx, Object msg)

Overrides default io.netty5.channel.ChannelHandler.write.

Doc from io.netty5.channel.ChannelHandler.write.

Called once a write operation is made. The write operation will write the messages through the ChannelPipeline. Those are then ready to be flushed to the actual Channel once Channel#flush() is called.

Parameters
ctx:ChannelHandlerContext

the ChannelHandlerContext for which the write operation is made

msg:Object

the message to write

Returns:Future<Void>

the Future which will be notified once the operation completes.

Annotations
@Override