public class DefaultClientRequestContext extends NonWrappingRequestContext implements ClientRequestContext
ClientRequestContext
implementation.HTTP_HEADERS
Constructor and Description |
---|
DefaultClientRequestContext(EventLoop eventLoop,
MeterRegistry meterRegistry,
SessionProtocol sessionProtocol,
Endpoint endpoint,
HttpMethod method,
String path,
String query,
String fragment,
ClientOptions options,
Object request)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
ByteBufAllocator |
alloc()
Returns the
ByteBufAllocator for this RequestContext . |
protected Channel |
channel()
Returns the
Channel that is handling this request, or null if the connection is not
established yet. |
Endpoint |
endpoint()
|
EventLoop |
eventLoop()
|
String |
fragment()
Returns the fragment part of the URI of the current
Request , as defined in
the section 3.5 of RFC3986. |
RequestLog |
log()
Returns the
RequestLog that contains the information about the current Request . |
RequestLogBuilder |
logBuilder()
Returns the
RequestLogBuilder that collects the information about the current Request . |
long |
maxResponseLength()
Returns the maximum length of the received
Response . |
ClientOptions |
options()
Returns the
ClientOptions of the current Request . |
long |
responseTimeoutMillis()
|
void |
setMaxResponseLength(long maxResponseLength)
Sets the maximum length of the received
Response . |
void |
setResponseTimeout(Duration responseTimeout)
|
void |
setResponseTimeoutMillis(long responseTimeoutMillis)
|
void |
setWriteTimeout(Duration writeTimeout)
Sets the amount of time allowed until sending out the current
Request completely. |
void |
setWriteTimeoutMillis(long writeTimeoutMillis)
Sets the amount of time allowed until sending out the current
Request completely. |
String |
toString() |
long |
writeTimeoutMillis()
Returns the amount of time allowed until sending out the current
Request completely. |
attr, attrs, hasAttr, invokeOnChildCallbacks, invokeOnEnterCallbacks, invokeOnExitCallbacks, localAddress, meterRegistry, method, onChild, onEnter, onExit, path, query, remoteAddress, request, sessionProtocol, sslSession
contextAwareEventLoop, equals, hashCode, isTimedOut, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, onEnter, onExit, rejectPromise, resolvePromise, setTimedOut
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
attrs, contextAwareEventLoop, current, invokeOnChildCallbacks, invokeOnEnterCallbacks, invokeOnExitCallbacks, isTimedOut, localAddress, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, mapCurrent, meterRegistry, method, onChild, onEnter, onEnter, onExit, onExit, path, push, push, query, rejectPromise, remoteAddress, request, resolvePromise, sessionProtocol, sslSession
attr, hasAttr
public DefaultClientRequestContext(EventLoop eventLoop, MeterRegistry meterRegistry, SessionProtocol sessionProtocol, Endpoint endpoint, HttpMethod method, String path, @Nullable String query, @Nullable String fragment, ClientOptions options, Object request)
sessionProtocol
- the SessionProtocol
of the invocationrequest
- the request associated with this contextprotected Channel channel()
NonWrappingRequestContext
Channel
that is handling this request, or null
if the connection is not
established yet.channel
in class NonWrappingRequestContext
public EventLoop eventLoop()
RequestContext
eventLoop
in interface RequestContext
public ClientOptions options()
ClientRequestContext
ClientOptions
of the current Request
.options
in interface ClientRequestContext
public Endpoint endpoint()
ClientRequestContext
endpoint
in interface ClientRequestContext
@Nullable public String fragment()
ClientRequestContext
Request
, as defined in
the section 3.5 of RFC3986.fragment
in interface ClientRequestContext
public long writeTimeoutMillis()
ClientRequestContext
Request
completely.
This value is initially set from ClientOption.DEFAULT_WRITE_TIMEOUT_MILLIS
.writeTimeoutMillis
in interface ClientRequestContext
public void setWriteTimeoutMillis(long writeTimeoutMillis)
ClientRequestContext
Request
completely.
This value is initially set from ClientOption.DEFAULT_WRITE_TIMEOUT_MILLIS
.setWriteTimeoutMillis
in interface ClientRequestContext
public void setWriteTimeout(Duration writeTimeout)
ClientRequestContext
Request
completely.
This value is initially set from ClientOption.DEFAULT_WRITE_TIMEOUT_MILLIS
.setWriteTimeout
in interface ClientRequestContext
public long responseTimeoutMillis()
ClientRequestContext
Response
completely
since the transfer of the Response
started. This value is initially set from
ClientOption.DEFAULT_RESPONSE_TIMEOUT_MILLIS
.responseTimeoutMillis
in interface ClientRequestContext
public void setResponseTimeoutMillis(long responseTimeoutMillis)
ClientRequestContext
Response
completely
since the transfer of the Response
started. This value is initially set from
ClientOption.DEFAULT_RESPONSE_TIMEOUT_MILLIS
.setResponseTimeoutMillis
in interface ClientRequestContext
public void setResponseTimeout(Duration responseTimeout)
ClientRequestContext
Response
completely
since the transfer of the Response
started. This value is initially set from
ClientOption.DEFAULT_RESPONSE_TIMEOUT_MILLIS
.setResponseTimeout
in interface ClientRequestContext
public long maxResponseLength()
ClientRequestContext
Response
.
This value is initially set from ClientOption.DEFAULT_MAX_RESPONSE_LENGTH
.maxResponseLength
in interface ClientRequestContext
ContentTooLargeException
public void setMaxResponseLength(long maxResponseLength)
ClientRequestContext
Response
.
This value is initially set from ClientOption.DEFAULT_MAX_RESPONSE_LENGTH
.setMaxResponseLength
in interface ClientRequestContext
ContentTooLargeException
public RequestLog log()
RequestContext
RequestLog
that contains the information about the current Request
.log
in interface RequestContext
public RequestLogBuilder logBuilder()
RequestContext
RequestLogBuilder
that collects the information about the current Request
.logBuilder
in interface RequestContext
public ByteBufAllocator alloc()
RequestContext
ByteBufAllocator
for this RequestContext
. Any buffers created by this
ByteBufAllocator
must be
reference-counted. If you don't know
what this means, you should probably use byte[]
or ByteBuffer
directly instead
of calling this method.alloc
in interface RequestContext
© Copyright 2015–2017 LINE Corporation. All rights reserved.