Package co.elastic.clients.base
Interface Endpoint<RequestT,ResponseT,ErrorT>
- Type Parameters:
RequestT- the endpoint's requestResponseT- the endpoint's response. UseVoidwhen there's no response body.ErrorT- the endpoint's error type. UseVoidwhen error responses have no body.
- All Known Implementing Classes:
BooleanEndpoint,SimpleEndpoint
public interface Endpoint<RequestT,ResponseT,ErrorT>
And endpoint links request and responses to protocol encoding. It also defines the error response
when the server cannot perform the request.
-
Method Summary
Modifier and Type Method Description JsonpDeserializer<ErrorT>errorParser(int statusCode)The entity parser for the error response body.booleanhasRequestBody()default java.util.Map<java.lang.String,java.lang.String>headers(RequestT request)Build the headers for a requestbooleanisError(int statusCode)java.lang.Stringmethod(RequestT request)The endpoint's http methoddefault java.util.Map<java.lang.String,java.lang.String>queryParameters(RequestT request)Build the query parameters for a requestjava.lang.StringrequestUrl(RequestT request)Build the URL path for a requestJsonpDeserializer<ResponseT>responseParser()The entity parser for the response body.
-
Method Details
-
method
The endpoint's http method -
requestUrl
Build the URL path for a request -
queryParameters
Build the query parameters for a request -
headers
Build the headers for a request -
hasRequestBody
boolean hasRequestBody() -
responseParser
The entity parser for the response body. Can benullto indicate that there's no response body. -
isError
boolean isError(int statusCode) -
errorParser
The entity parser for the error response body. Can benullto indicate that there's no error body.
-