Class ApacheHttpClient5Transport
java.lang.Object
org.opensearch.client.transport.httpclient5.ApacheHttpClient5Transport
- All Implemented Interfaces:
Closeable,AutoCloseable,OpenSearchTransport,Transport
Apache HttpClient 5 based client transport.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA gzip compressing entity that also implementsgetContent().static classAn entity that lets the caller specify the return value ofisChunked().static classListener that allows to be notified whenever a failure happens. -
Constructor Summary
ConstructorsConstructorDescriptionApacheHttpClient5Transport(org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient client, org.apache.hc.core5.http.Header[] defaultHeaders, List<Node> nodes, JsonpMapper mapper, TransportOptions options, String pathPrefix, ApacheHttpClient5Transport.FailureListener failureListener, NodeSelector nodeSelector, boolean strictDeprecationMode, boolean compressionEnabled, boolean chunkedEnabled) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getNodes()Returns a map of all nodes managed by this transport and their current state.options()Default options used by this transport if none are provided inTransport.performRequest(Object, Endpoint, TransportOptions)orTransport.performRequestAsync(Object, Endpoint, TransportOptions);<RequestT,ResponseT, ErrorT>
ResponseTperformRequest(RequestT request, Endpoint<RequestT, ResponseT, ErrorT> endpoint, TransportOptions options) <RequestT,ResponseT, ErrorT>
CompletableFuture<ResponseT> performRequestAsync(RequestT request, Endpoint<RequestT, ResponseT, ErrorT> endpoint, TransportOptions options)
-
Constructor Details
-
ApacheHttpClient5Transport
public ApacheHttpClient5Transport(org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient client, org.apache.hc.core5.http.Header[] defaultHeaders, List<Node> nodes, JsonpMapper mapper, @Nullable TransportOptions options, String pathPrefix, ApacheHttpClient5Transport.FailureListener failureListener, NodeSelector nodeSelector, boolean strictDeprecationMode, boolean compressionEnabled, boolean chunkedEnabled)
-
-
Method Details
-
performRequest
public <RequestT,ResponseT, ResponseT performRequestErrorT> (RequestT request, Endpoint<RequestT, ResponseT, throws IOExceptionErrorT> endpoint, TransportOptions options) - Specified by:
performRequestin interfaceTransport- Throws:
IOException
-
performRequestAsync
public <RequestT,ResponseT, CompletableFuture<ResponseT> performRequestAsyncErrorT> (RequestT request, Endpoint<RequestT, ResponseT, ErrorT> endpoint, TransportOptions options) - Specified by:
performRequestAsyncin interfaceTransport
-
jsonpMapper
- Specified by:
jsonpMapperin interfaceTransport
-
options
Description copied from interface:TransportDefault options used by this transport if none are provided inTransport.performRequest(Object, Endpoint, TransportOptions)orTransport.performRequestAsync(Object, Endpoint, TransportOptions); -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getNodes
Returns a map of all nodes managed by this transport and their current state.Each node is mapped to either
NodeState.Activeif it is available for requests, orNodeState.Unavailableif it is currently denylisted due to previous failures. Nodes that are eligible for retry are considered active.- Returns:
- an unmodifiable map of nodes to their current state
-