@Internal
public interface ExecRuntime
This interface is considered internal and generally ought not be used or accessed by custom request exec handlers.
Modifier and Type | Method and Description |
---|---|
void |
acquireEndpoint(String id,
HttpRoute route,
Object state,
HttpClientContext context)
Acquires a connection endpoint.
|
void |
connectEndpoint(HttpClientContext context)
Connect the local endpoint to the initial hop (connection target in case
of a direct route or to the first proxy hop in case of a route via a proxy
or multiple proxies).
|
void |
discardEndpoint()
Shuts down and discards the acquired endpoint.
|
void |
disconnectEndpoint()
Disconnects the local endpoint from the initial hop in the connection route.
|
org.apache.hc.core5.http.ClassicHttpResponse |
execute(String id,
org.apache.hc.core5.http.ClassicHttpRequest request,
HttpClientContext context)
Executes HTTP request using the given context.
|
default org.apache.hc.core5.http.ClassicHttpResponse |
execute(String id,
org.apache.hc.core5.http.ClassicHttpRequest request,
org.apache.hc.core5.http.io.HttpResponseInformationCallback informationCallback,
HttpClientContext context)
Executes HTTP request using the given context.
|
ExecRuntime |
fork(org.apache.hc.core5.concurrent.CancellableDependency cancellableAware)
Forks this runtime for parallel execution.
|
default EndpointInfo |
getEndpointInfo()
Gets information about the underlying endpoint when connected or
null otherwise. |
boolean |
isConnectionReusable()
Determines of the connection is considered re-usable.
|
boolean |
isEndpointAcquired()
Determines of a connection endpoint has been acquired.
|
boolean |
isEndpointConnected()
Determines of there the endpoint is connected to the initial hop (connection
target in case of a direct route or to the first proxy hop in case of a route
via a proxy or multiple proxies).
|
boolean |
isExecutionAborted()
Determines of the request execution has been aborted.
|
void |
markConnectionNonReusable()
Marks the connection as non re-usable.
|
void |
markConnectionReusable(Object state,
org.apache.hc.core5.util.TimeValue validityTime)
Marks the connection as potentially re-usable for the given period of time
and also marks it as stateful if the state representation is given.
|
void |
releaseEndpoint()
Releases the acquired endpoint potentially making it available for re-use.
|
void |
upgradeTls(HttpClientContext context)
Upgrades transport security of the active connection by using the TLS security protocol.
|
boolean isExecutionAborted()
true
if the request execution has been acquired,
false
otherwise.boolean isEndpointAcquired()
true
if an endpoint has been acquired, false
otherwise.void acquireEndpoint(String id, HttpRoute route, Object state, HttpClientContext context) throws IOException
id
- unique operation ID or null
.route
- the connection route.state
- the expected connection state. May be null
if connection
can be state-less or its state is irrelevant.context
- the execution context.IOException
- if an I/O error occurs.void releaseEndpoint()
void discardEndpoint()
boolean isEndpointConnected()
true
if the endpoint is connected, false
otherwise.void disconnectEndpoint() throws IOException
IOException
- if an I/O error occurs.void connectEndpoint(HttpClientContext context) throws IOException
context
- the execution context.IOException
- if an I/O error occurs.void upgradeTls(HttpClientContext context) throws IOException
context
- the execution context.IOException
- if an I/O error occurs.default EndpointInfo getEndpointInfo()
null
otherwise.null
.org.apache.hc.core5.http.ClassicHttpResponse execute(String id, org.apache.hc.core5.http.ClassicHttpRequest request, HttpClientContext context) throws IOException, org.apache.hc.core5.http.HttpException
id
- unique operation ID or null
.request
- the request message.context
- the execution context.IOException
- if an I/O error occurs.org.apache.hc.core5.http.HttpException
- if a protocol error occurs.default org.apache.hc.core5.http.ClassicHttpResponse execute(String id, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.io.HttpResponseInformationCallback informationCallback, HttpClientContext context) throws IOException, org.apache.hc.core5.http.HttpException
id
- unique operation ID or null
.request
- the request message.informationCallback
- information (1xx) response handlercontext
- the execution context.IOException
- if an I/O error occurs.org.apache.hc.core5.http.HttpException
- if a protocol error occurs.boolean isConnectionReusable()
true
if the connection is re-usable, false
otherwise.void markConnectionReusable(Object state, org.apache.hc.core5.util.TimeValue validityTime)
state
- the connection state representation or null
if stateless.validityTime
- the period of time this connection is valid for.void markConnectionNonReusable()
ExecRuntime fork(org.apache.hc.core5.concurrent.CancellableDependency cancellableAware)
Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.