Package org.opensearch.client.transport
Interface GenericEndpoint<RequestT,ResponseT>
-
- All Superinterfaces:
Endpoint<RequestT,ResponseT,ResponseT>
public interface GenericEndpoint<RequestT,ResponseT> extends Endpoint<RequestT,ResponseT,ResponseT>
An endpoint with a raw, unparsed response body. The endpoind does not distinguish between errornous and successful response and always return the raw response body.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default JsonpDeserializer<ResponseT>errorDeserializer(int statusCode)The error is never deserialized explicitly, represented as the instance ofGenericEndpointinstead.default booleanisError(int statusCode)Is this status code to be considered as an error?ResponseTresponseDeserializer(java.lang.String uri, java.lang.String method, java.lang.String protocol, int status, java.lang.String reason, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> headers, java.lang.String contentType, java.io.InputStream body)Constructs theGenericEndpointinstance-
Methods inherited from interface org.opensearch.client.transport.Endpoint
exceptionConverter, hasRequestBody, headers, method, queryParameters, requestUrl
-
-
-
-
Method Detail
-
isError
default boolean isError(int statusCode)
Description copied from interface:EndpointIs this status code to be considered as an error?
-
errorDeserializer
default JsonpDeserializer<ResponseT> errorDeserializer(int statusCode)
The error is never deserialized explicitly, represented as the instance ofGenericEndpointinstead.- Specified by:
errorDeserializerin interfaceEndpoint<RequestT,ResponseT,ResponseT>
-
responseDeserializer
ResponseT responseDeserializer(java.lang.String uri, java.lang.String method, java.lang.String protocol, int status, java.lang.String reason, java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> headers, @Nullable java.lang.String contentType, @Nullable java.io.InputStream body)
Constructs theGenericEndpointinstance- Parameters:
uri- request URImethod- HTTP methodprotocol- HTTP protocol versionstatus- status codereason- reason phraseheaders- response headersbody- optional body- Returns:
- the
GenericEndpointinstance
-
-