Top Description Inners Fields Constructors Methods
reactor.netty.http.server

pack-priv final Class HttpTrafficHandler

extends ChannelDuplexHandler
implements Runnable, ChannelFutureListener
Class Inheritance
All Implemented Interfaces
io.netty.channel.ChannelFutureListener, io.netty.util.concurrent.GenericFutureListener, java.util.EventListener, java.lang.Runnable
Imports
java.net.SocketAddress, java.time.Duration, .ZonedDateTime, java.util.Optional, .Queue, java.util.function.BiFunction, .BiPredicate, io.netty.channel.ChannelDuplexHandler, .ChannelFuture, .ChannelFutureListener, .ChannelHandlerContext, .ChannelPromise, io.netty.handler.codec.DecoderResult, .DecoderResultProvider, io.netty.handler.codec.http.HttpHeaderNames, .HttpObject, .HttpRequest, .HttpResponse, .HttpResponseStatus, .HttpStatusClass, .HttpVersion, .LastHttpContent, io.netty.handler.codec.http.cookie.ServerCookieDecoder, .ServerCookieEncoder, io.netty.handler.ssl.SslHandler, io.netty.util.ReferenceCountUtil, reactor.core.Exceptions, reactor.core.publisher.Mono, reactor.netty.Connection, .ConnectionObserver, .ReactorNetty, reactor.netty.http.logging.HttpMessageArgProviderFactory, .HttpMessageLogFactory, reactor.util.annotation.Nullable, reactor.util.concurrent.Queues

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final BiPredicate<HttpServerRequest, HttpServerResponse>
pack-priv final ServerCookieDecoder
pack-priv final ServerCookieEncoder
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 final Duration
pack-priv SocketAddress
pack-priv final Duration
pack-priv Boolean

Constructor Summary

AccessConstructor and Description
pack-priv
HttpTrafficHandler(BiPredicate<HttpServerRequest, HttpServerResponse> compress, ServerCookieDecoder decoder, ServerCookieEncoder encoder, 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, Duration readTimeout, Duration requestTimeout)

Method Summary

Modifier and TypeMethod and Description
public void
public void
pack-priv final void
pack-priv void
public void
handlerAdded(ChannelHandlerContext ctx)

Overrides io.netty.channel.ChannelHandlerAdapter.handlerAdded.

Implements io.netty.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 io.netty.channel.ChannelHandlerAdapter.handlerRemoved.

Implements io.netty.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
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(ChannelFuture
the source Future which called this callback
future
)

Implements io.netty.util.concurrent.GenericFutureListener.operationComplete.

Invoked when the operation associated with the Future has been completed.
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
pack-priv void
pack-priv void
pack-priv boolean
public void
write(ChannelHandlerContext
the ChannelHandlerContext for which the write operation is made
ctx
,
Object
the message to write
msg
,
ChannelPromise
the ChannelPromise to notify once the operation completes
promise
)

Overrides io.netty.channel.ChannelDuplexHandler.write.

Implements io.netty.channel.ChannelOutboundHandler.write.

Calls ChannelHandlerContext#write(Object, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline.
Inherited from io.netty.channel.ChannelDuplexHandler:
bindcloseconnectderegisterdisconnectflushread

Field Detail

compressback to summary
pack-priv final BiPredicate<HttpServerRequest, HttpServerResponse> compress
cookieDecoderback to summary
pack-priv final ServerCookieDecoder cookieDecoder
cookieEncoderback to summary
pack-priv final ServerCookieEncoder cookieEncoder
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
readTimeoutback to summary
pack-priv final Duration readTimeout
remoteAddressback to summary
pack-priv SocketAddress remoteAddress
requestTimeoutback to summary
pack-priv final Duration requestTimeout
secureback to summary
pack-priv Boolean secure

Constructor Detail

HttpTrafficHandlerback to summary
pack-priv HttpTrafficHandler(BiPredicate<HttpServerRequest, HttpServerResponse> compress, ServerCookieDecoder decoder, ServerCookieEncoder encoder, 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, Duration readTimeout, Duration requestTimeout)

Method Detail

channelActiveback to summary
public void channelActive(ChannelHandlerContext ctx)

Overrides io.netty.channel.ChannelInboundHandlerAdapter.channelActive.

Implements io.netty.channel.ChannelInboundHandler.channelActive.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelActive.

Calls ChannelHandlerContext#fireChannelActive() to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

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

Overrides io.netty.channel.ChannelInboundHandlerAdapter.channelRead.

Implements io.netty.channel.ChannelInboundHandler.channelRead.

Doc from io.netty.channel.ChannelInboundHandlerAdapter.channelRead.

Calls ChannelHandlerContext#fireChannelRead(Object) to forward to the next ChannelInboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

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 io.netty.channel.ChannelHandlerAdapter.handlerAdded.

Implements io.netty.channel.ChannelHandler.handlerAdded.

Doc from io.netty.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 io.netty.channel.ChannelHandlerAdapter.handlerRemoved.

Implements io.netty.channel.ChannelHandler.handlerRemoved.

Doc from io.netty.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)
isNoContentback to summary
pack-priv static boolean isNoContent(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(ChannelFuture future)

Implements io.netty.util.concurrent.GenericFutureListener.operationComplete.

Doc from io.netty.util.concurrent.GenericFutureListener.operationComplete.

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

Parameters
future:ChannelFuture

the source Future which called this callback

Annotations
@Override
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)
sendDecodingFailuresback to summary
pack-priv void sendDecodingFailures(Throwable t, Object msg, ZonedDateTime timestamp, ConnectionInfo connectionInfo)
shouldKeepAliveback to summary
pack-priv boolean shouldKeepAlive()
writeback to summary
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)

Overrides io.netty.channel.ChannelDuplexHandler.write.

Implements io.netty.channel.ChannelOutboundHandler.write.

Doc from io.netty.channel.ChannelDuplexHandler.write.

Calls ChannelHandlerContext#write(Object, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline. Sub-classes may override this method to change behavior.

Parameters
ctx:ChannelHandlerContext

Doc from io.netty.channel.ChannelOutboundHandler.write.

the ChannelHandlerContext for which the write operation is made

msg:Object

Doc from io.netty.channel.ChannelOutboundHandler.write.

the message to write

promise:ChannelPromise

Doc from io.netty.channel.ChannelOutboundHandler.write.

the ChannelPromise to notify once the operation completes

Annotations
@Override
@SuppressWarnings:FutureReturnValueIgnored
reactor.netty.http.server back to summary

pack-priv final Class HttpTrafficHandler.HttpRequestHolder

extends Object
Class Inheritance
  • java.lang.Object
  • reactor.netty.http.server.HttpTrafficHandler.HttpRequestHolder

Field Summary

Modifier and TypeField and Description
pack-priv final HttpRequest
pack-priv final ZonedDateTime

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

requestback to summary
pack-priv final HttpRequest request
timestampback to summary
pack-priv final ZonedDateTime timestamp

Constructor Detail

HttpRequestHolderback to summary
pack-priv HttpRequestHolder(HttpRequest request)