Class SimpleEndpoint<RequestT,ResponseT>
java.lang.Object
org.opensearch.client.transport.endpoints.SimpleEndpoint<RequestT,ResponseT>
- All Implemented Interfaces:
Endpoint<RequestT,,ResponseT, ErrorResponse> JsonEndpoint<RequestT,ResponseT, ErrorResponse>
- Direct Known Subclasses:
BooleanEndpoint
public class SimpleEndpoint<RequestT,ResponseT>
extends Object
implements JsonEndpoint<RequestT,ResponseT,ErrorResponse>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionemptyMap()Returns a function that always returns an empty String to String map.errorDeserializer(int statusCode) The entity parser for the error response body.booleanGet the HTTP headers for a request.booleanisError(int statusCode) Is this status code to be considered as an error?Get the endpoint's HTTP method for a request.static RuntimeExceptionnoPathTemplateFound(String what) static voidpathEncode(String src, StringBuilder dest) queryParameters(RequestT request) Get the query parameters for a request.requestUrl(RequestT request) Get the URL path for a request.The entity parser for the response body.<NewResponseT>
SimpleEndpoint<RequestT, NewResponseT> withResponseDeserializer(JsonpDeserializer<NewResponseT> newResponseParser) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensearch.client.transport.Endpoint
exceptionConverter
-
Constructor Details
-
SimpleEndpoint
-
-
Method Details
-
emptyMap
Returns a function that always returns an empty String to String map. Useful to avoid creating lots of duplicate lambdas in endpoints that don't have headers or parameters. -
method
Description copied from interface:EndpointGet the endpoint's HTTP method for a request.- Specified by:
methodin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
requestUrl
Description copied from interface:EndpointGet the URL path for a request.- Specified by:
requestUrlin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
queryParameters
Description copied from interface:EndpointGet the query parameters for a request.- Specified by:
queryParametersin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
headers
Description copied from interface:EndpointGet the HTTP headers for a request.- Specified by:
headersin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
hasRequestBody
public boolean hasRequestBody()- Specified by:
hasRequestBodyin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
responseDeserializer
Description copied from interface:JsonEndpointThe entity parser for the response body.- Specified by:
responseDeserializerin interfaceJsonEndpoint<RequestT,ResponseT, ErrorResponse>
-
isError
public boolean isError(int statusCode) Description copied from interface:EndpointIs this status code to be considered as an error?- Specified by:
isErrorin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
errorDeserializer
Description copied from interface:EndpointThe entity parser for the error response body. Can benullto indicate that there's no error body.- Specified by:
errorDeserializerin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
withResponseDeserializer
public <NewResponseT> SimpleEndpoint<RequestT,NewResponseT> withResponseDeserializer(JsonpDeserializer<NewResponseT> newResponseParser) -
noPathTemplateFound
-
pathEncode
-