public class Http2StreamFrameToContainerRequestDecoder extends AbstractContainerRequestDecoder<Http2StreamFrame,Http2HeadersFrame,Http2DataFrame>
ChannelHandler.Sharable
Constructor and Description |
---|
Http2StreamFrameToContainerRequestDecoder(URI baseUri)
Deprecated.
Please use the
Http2StreamFrameToContainerRequestDecoder(URI, Configuration)
constructor instead. |
Http2StreamFrameToContainerRequestDecoder(URI baseUri,
Configuration configuration)
Creates a new
Http2StreamFrameToContainerRequestDecoder . |
Http2StreamFrameToContainerRequestDecoder(URI baseUri,
Supplier<? extends Configuration> configurationSupplier)
Creates a new
Http2StreamFrameToContainerRequestDecoder . |
Modifier and Type | Method and Description |
---|---|
protected String |
getMethod(Http2HeadersFrame http2HeadersFrame)
Extracts and returns the name of the request method from the
supplied message, which is guaranteed to be a "headers" message.
|
protected String |
getRequestUriString(Http2HeadersFrame http2HeadersFrame)
Extracts and returns a
String representing a request URI
from the supplied message, which is guaranteed to be a
"headers" message. |
protected void |
installMessage(ChannelHandlerContext channelHandlerContext,
Http2HeadersFrame message,
ContainerRequest containerRequest)
Overrides the
AbstractContainerRequestDecoder.installMessage(ChannelHandlerContext,
Object, ContainerRequest) method to
additionally install incoming headers into the
supplied ContainerRequest . |
protected boolean |
isLast(Http2StreamFrame http2StreamFrame)
Returns
true if the supplied Http2StreamFrame is the
last of a stream of messages. |
acceptInboundMessage, channelReadComplete, createPropertiesDelegate, createSecurityContext, createTerminableByteBufInputStream, decode, getContent, isData, isHeaders
channelRead
channelActive, channelInactive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handlerAdded, handlerRemoved
@Deprecated public Http2StreamFrameToContainerRequestDecoder(URI baseUri)
Http2StreamFrameToContainerRequestDecoder(URI, Configuration)
constructor instead.Http2StreamFrameToContainerRequestDecoder
.baseUri
- a URI
that will serve as the base URI
in a new
ContainerRequest
; may be null
in which case the
return value of URI.create("/")
will
be used insteadHttp2StreamFrameToContainerRequestDecoder(URI, Configuration)
public Http2StreamFrameToContainerRequestDecoder(URI baseUri, Configuration configuration)
Http2StreamFrameToContainerRequestDecoder
.baseUri
- a URI
that will serve as the base URI
in a new
ContainerRequest
; may be null
in which case the
return value of URI.create("/")
will
be used insteadconfiguration
- a Configuration
describing how the
container is configured; may be null
public Http2StreamFrameToContainerRequestDecoder(URI baseUri, Supplier<? extends Configuration> configurationSupplier)
Http2StreamFrameToContainerRequestDecoder
.baseUri
- a URI
that will serve as the base URI
in a new
ContainerRequest
; may be null
in which case the
return value of URI.create("/")
will
be used insteadconfigurationSupplier
- a Supplier
of Configuration
instances describing how the container is
configured; may be null
protected final String getRequestUriString(Http2HeadersFrame http2HeadersFrame)
String
representing a request URI
from the supplied message, which is guaranteed to be a
"headers" message.
This implementation calls http2HeadersFrame.headers().path().toString()
and returns the
result.
getRequestUriString
in class AbstractContainerRequestDecoder<Http2StreamFrame,Http2HeadersFrame,Http2DataFrame>
http2HeadersFrame
- the message to interrogate; will not be
null
String
representing a request URI from the
supplied message, or null
protected final String getMethod(Http2HeadersFrame http2HeadersFrame)
This implementation calls http2HeadersFrame.headers().method().toString()
and returns the
result.
getMethod
in class AbstractContainerRequestDecoder<Http2StreamFrame,Http2HeadersFrame,Http2DataFrame>
http2HeadersFrame
- the message to interrogate; will not be
null
String
representing the request method from the
supplied message, or null
protected void installMessage(ChannelHandlerContext channelHandlerContext, Http2HeadersFrame message, ContainerRequest containerRequest)
AbstractContainerRequestDecoder.installMessage(ChannelHandlerContext,
Object, ContainerRequest)
method to
additionally install incoming headers into the
supplied ContainerRequest
.installMessage
in class AbstractContainerRequestDecoder<Http2StreamFrame,Http2HeadersFrame,Http2DataFrame>
channelHandlerContext
- the ChannelHandlerContext
in
effect; will not be null
; supplied for convenience;
overrides may (and often do) ignore this parametermessage
- the message to install; will not be null
containerRequest
- the just-constructed ContainerRequest
into which to install the supplied message
; will not be null
Http2HeadersFrame.headers()
,
InboundMessageContext.header(String,
Object)
protected final boolean isLast(Http2StreamFrame http2StreamFrame)
true
if the supplied Http2StreamFrame
is the
last of a stream of messages.
This implementation returns true
if either:
http2StreamFrame
is an instance of Http2HeadersFrame
and its Http2HeadersFrame.isEndStream()
method returns true
,
orhttp2StreamFrame
is an instance of Http2DataFrame
and its Http2DataFrame.isEndStream()
method returns true
isLast
in class AbstractContainerRequestDecoder<Http2StreamFrame,Http2HeadersFrame,Http2DataFrame>
http2StreamFrame
- the message to interrogate; will not be
null
true
if no further messages in the stream are
forthcoming; false
otherwiseCopyright © 2019–2020, microBean™. All rights reserved.