public final class HttpObjectToContainerRequestDecoder extends AbstractContainerRequestDecoder<HttpObject,HttpRequest,HttpContent>
ChannelHandler.Sharable
Constructor and Description |
---|
HttpObjectToContainerRequestDecoder(URI baseUri)
Deprecated.
Please use the
HttpObjectToContainerRequestDecoder(URI, Supplier)
constructor instead. |
HttpObjectToContainerRequestDecoder(URI baseUri,
Configuration configuration)
Creates a new
HttpObjectToContainerRequestDecoder . |
HttpObjectToContainerRequestDecoder(URI baseUri,
Supplier<? extends Configuration> configurationSupplier)
Creates a new
HttpObjectToContainerRequestDecoder . |
Modifier and Type | Method and Description |
---|---|
protected String |
getMethod(HttpRequest httpRequest)
Extracts and returns the name of the request method from the
supplied message, which is guaranteed to be a "headers" message.
|
protected String |
getRequestUriString(HttpRequest httpRequest)
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,
HttpRequest message,
ContainerRequest containerRequest)
Overrides the
AbstractContainerRequestDecoder.installMessage(ChannelHandlerContext,
Object, ContainerRequest) method to
additionally install incoming headers into the
supplied ContainerRequest . |
protected boolean |
isLast(HttpObject httpObject)
Returns
true if the supplied HttpObject 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 HttpObjectToContainerRequestDecoder(URI baseUri)
HttpObjectToContainerRequestDecoder(URI, Supplier)
constructor instead.HttpObjectToContainerRequestDecoder
.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 insteadHttpObjectToContainerRequestDecoder(URI, Configuration)
public HttpObjectToContainerRequestDecoder(URI baseUri, Configuration configuration)
HttpObjectToContainerRequestDecoder
.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 HttpObjectToContainerRequestDecoder(URI baseUri, Supplier<? extends Configuration> configurationSupplier)
HttpObjectToContainerRequestDecoder
.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(HttpRequest httpRequest)
String
representing a request URI
from the supplied message, which is guaranteed to be a
"headers" message.
This implementation calls httpRequest.uri()
and returns the result.
getRequestUriString
in class AbstractContainerRequestDecoder<HttpObject,HttpRequest,HttpContent>
httpRequest
- the message to interrogate; will not be null
String
representing a request URI from the
supplied message, or null
protected final String getMethod(HttpRequest httpRequest)
This implementation calls httpRequest.method().name()
and returns the result.
getMethod
in class AbstractContainerRequestDecoder<HttpObject,HttpRequest,HttpContent>
httpRequest
- the message to interrogate; will not be null
String
representing the request method from the
supplied message, or null
protected void installMessage(ChannelHandlerContext channelHandlerContext, HttpRequest message, ContainerRequest containerRequest)
AbstractContainerRequestDecoder.installMessage(ChannelHandlerContext,
Object, ContainerRequest)
method to
additionally install incoming headers into the
supplied ContainerRequest
.installMessage
in class AbstractContainerRequestDecoder<HttpObject,HttpRequest,HttpContent>
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
HttpMessage.headers()
,
InboundMessageContext.header(String,
Object)
protected final boolean isLast(HttpObject httpObject)
true
if the supplied HttpObject
is the
last of a stream of messages.
This implementation returns true
if either:
httpObject
is an instance of LastHttpContent
,
orhttpObject
is an instance of HttpRequest
and
its content length equals 0L
isLast
in class AbstractContainerRequestDecoder<HttpObject,HttpRequest,HttpContent>
httpObject
- 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.