Top Description Methods
org.apache.hc.client5.http.classic

public Interface ExecRuntime

Known Direct Implementers
org.apache.hc.client5.http.impl.classic.InternalExecRuntime
Annotations
@Internal
Imports
java.io.IOException, org.apache.hc.client5.http.HttpRoute, org.apache.hc.client5.http.protocol.HttpClientContext, org.apache.hc.core5.annotation.Internal, org.apache.hc.core5.concurrent.CancellableDependency, org.apache.hc.core5.http.ClassicHttpRequest, .ClassicHttpResponse, .HttpException, org.apache.hc.core5.util.TimeValue

Execution runtime that provides access to the underlying connection endpoint and helps manager its life cycle.

This interface is considered internal and generally ought not be used or accessed by custom request exec handlers.

Since
5.0

Method Summary

Modifier and TypeMethod and Description
public void
acquireEndpoint(String
unique operation ID or null.
id
,
HttpRoute
the connection route.
route
,
Object
the expected connection state. May be null if connection can be state-less or its state is irrelevant.
state
,
HttpClientContext
the execution context.
context
)

Acquires a connection endpoint.

public void
connectEndpoint(HttpClientContext
the execution context.
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).

public void
discardEndpoint()

Shuts down and discards the acquired endpoint.

public void
disconnectEndpoint()

Disconnects the local endpoint from the initial hop in the connection route.

public ClassicHttpResponse
execute(String
unique operation ID or null.
id
,
ClassicHttpRequest
the request message.
request
,
HttpClientContext
the execution context.
context
)

Executes HTTP request using the given context.

public ExecRuntime

Returns:

another runtime with the same configuration.
fork
(CancellableDependency cancellableAware)

Forks this runtime for parallel execution.

public boolean

Returns:

true if the connection is re-usable, false otherwise.
isConnectionReusable
()

Determines of the connection is considered re-usable.

public boolean

Returns:

true if an endpoint has been acquired, false otherwise.
isEndpointAcquired
()

Determines of a connection endpoint has been acquired.

public boolean

Returns:

true if the endpoint is connected, false otherwise.
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).

public boolean

Returns:

true if the request execution has been acquired, false otherwise.
isExecutionAborted
()

Determines of the request execution has been aborted.

public void
markConnectionNonReusable()

Marks the connection as non re-usable.

public void
markConnectionReusable(Object
the connection state representation or null if stateless.
state
,
TimeValue
the period of time this connection is valid for.
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.

public void
releaseEndpoint()

Releases the acquired endpoint potentially making it available for re-use.

public void
upgradeTls(HttpClientContext
the execution context.
context
)

Upgrades transport security of the active connection by using the TLS security protocol.

Method Detail

acquireEndpointback to summary
public void acquireEndpoint(String id, HttpRoute route, Object state, HttpClientContext context) throws IOException

Acquires a connection endpoint. Endpoints can leased from a pool or unconnected new endpoint can be created.

Parameters
id:String

unique operation ID or null.

route:HttpRoute

the connection route.

state:Object

the expected connection state. May be null if connection can be state-less or its state is irrelevant.

context:HttpClientContext

the execution context.

connectEndpointback to summary
public void connectEndpoint(HttpClientContext context) throws IOException

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).

Parameters
context:HttpClientContext

the execution context.

discardEndpointback to summary
public void discardEndpoint()

Shuts down and discards the acquired endpoint.

disconnectEndpointback to summary
public void disconnectEndpoint() throws IOException

Disconnects the local endpoint from the initial hop in the connection route.

executeback to summary
public ClassicHttpResponse execute(String id, ClassicHttpRequest request, HttpClientContext context) throws IOException, HttpException

Executes HTTP request using the given context.

Parameters
id:String

unique operation ID or null.

request:ClassicHttpRequest

the request message.

context:HttpClientContext

the execution context.

forkback to summary
public ExecRuntime fork(CancellableDependency cancellableAware)

Forks this runtime for parallel execution.

Returns:ExecRuntime

another runtime with the same configuration.

isConnectionReusableback to summary
public boolean isConnectionReusable()

Determines of the connection is considered re-usable.

Returns:boolean

true if the connection is re-usable, false otherwise.

isEndpointAcquiredback to summary
public boolean isEndpointAcquired()

Determines of a connection endpoint has been acquired.

Returns:boolean

true if an endpoint has been acquired, false otherwise.

isEndpointConnectedback to summary
public 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).

Returns:boolean

true if the endpoint is connected, false otherwise.

isExecutionAbortedback to summary
public boolean isExecutionAborted()

Determines of the request execution has been aborted.

Returns:boolean

true if the request execution has been acquired, false otherwise.

markConnectionNonReusableback to summary
public void markConnectionNonReusable()

Marks the connection as non re-usable.

markConnectionReusableback to summary
public void markConnectionReusable(Object state, 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.

Parameters
state:Object

the connection state representation or null if stateless.

validityTime:TimeValue

the period of time this connection is valid for.

releaseEndpointback to summary
public void releaseEndpoint()

Releases the acquired endpoint potentially making it available for re-use.

upgradeTlsback to summary
public void upgradeTls(HttpClientContext context) throws IOException

Upgrades transport security of the active connection by using the TLS security protocol.

Parameters
context:HttpClientContext

the execution context.