Package org.apache.gravitino.client
Interface RESTClient
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
HTTPClient
Interface for a basic HTTP Client for interfacing with the REST catalog.
Referred from core/src/main/java/org/apache/iceberg/rest/RESTClient.java
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T extends RESTResponse>
Tdelete
(String path, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a DELETE request on the specified path with given information and no query parameters.default <T extends RESTResponse>
Tdelete
(String path, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a DELETE request on the specified path with given information.default <T extends RESTResponse>
Tdelete
(String path, Map<String, String> queryParams, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a DELETE request on the specified path with given information.<T extends RESTResponse>
Tdelete
(String path, Map<String, String> queryParams, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a DELETE request on the specified path with given information.default <T extends RESTResponse>
Tget
(String path, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a GET request on the specified path with given information and no query parameters.default <T extends RESTResponse>
Tget
(String path, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a GET request on the specified path with given information and no query parameters.default <T extends RESTResponse>
Tget
(String path, Map<String, String> queryParams, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a GET request on the specified path with given information.<T extends RESTResponse>
Tget
(String path, Map<String, String> queryParams, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a GET request on the specified path with given information.default void
Perform a HEAD request on the specified path with the given headers and error handling.void
Perform a HEAD request on the specified path with the given headers and error handling.<T extends RESTResponse>
Tpatch
(String path, RESTRequest body, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a PATCH request on the specified path with given information.default <T extends RESTResponse>
Tpost
(String path, RESTRequest body, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a POST request on the specified path with given information.default <T extends RESTResponse>
Tpost
(String path, RESTRequest body, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler, Consumer<Map<String, String>> responseHeaders) Perform a POST request on the specified path with a given information.<T extends RESTResponse>
Tpost
(String path, RESTRequest body, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a POST request on the specified path with given information.default <T extends RESTResponse>
Tpost
(String path, RESTRequest body, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler, Consumer<Map<String, String>> responseHeaders) Perform a POST request on the specified path with a given information.default <T extends RESTResponse>
TpostForm
(String path, Map<String, String> formData, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a POST request with form data on the specified path with the given information.<T extends RESTResponse>
TpostForm
(String path, Map<String, String> formData, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a POST request with form data on the specified path with the given information.default <T extends RESTResponse>
Tput
(String path, RESTRequest body, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a PUT request on the specified path with given information.default <T extends RESTResponse>
Tput
(String path, RESTRequest body, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler, Consumer<Map<String, String>> responseHeaders) Perform a PUT request on the specified path with given information.<T extends RESTResponse>
Tput
(String path, RESTRequest body, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a PUT request on the specified path with given information.default <T extends RESTResponse>
Tput
(String path, RESTRequest body, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler, Consumer<Map<String, String>> responseHeaders) Perform a PUT request on the specified path with a request body, response type, headers, and error handling.
-
Method Details
-
head
default void head(String path, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a HEAD request on the specified path with the given headers and error handling.- Parameters:
path
- The path to be requested.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.
-
head
Perform a HEAD request on the specified path with the given headers and error handling.- Parameters:
path
- The path to be requested.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.
-
delete
default <T extends RESTResponse> T delete(String path, Map<String, String> queryParams, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a DELETE request on the specified path with given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.queryParams
- The query parameters to be included in the request.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the DELETE request.
-
delete
default <T extends RESTResponse> T delete(String path, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a DELETE request on the specified path with given information and no query parameters.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the DELETE request.
-
delete
default <T extends RESTResponse> T delete(String path, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a DELETE request on the specified path with given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the DELETE request.
-
delete
<T extends RESTResponse> T delete(String path, Map<String, String> queryParams, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a DELETE request on the specified path with given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.queryParams
- The query parameters to be included in the request (ignored).responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the DELETE request.
-
get
default <T extends RESTResponse> T get(String path, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a GET request on the specified path with given information and no query parameters.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the GET request.
-
get
default <T extends RESTResponse> T get(String path, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a GET request on the specified path with given information and no query parameters.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the GET request.
-
get
default <T extends RESTResponse> T get(String path, Map<String, String> queryParams, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a GET request on the specified path with given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.queryParams
- The query parameters to be included in the request.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the GET request.
-
get
<T extends RESTResponse> T get(String path, Map<String, String> queryParams, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a GET request on the specified path with given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.queryParams
- The query parameters to be included in the request.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the GET request.
-
post
default <T extends RESTResponse> T post(String path, RESTRequest body, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a POST request on the specified path with given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.body
- The request body to be included in the POST request.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the POST request.
-
post
default <T extends RESTResponse> T post(String path, RESTRequest body, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler, Consumer<Map<String, String>> responseHeaders) Perform a POST request on the specified path with a given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.body
- The request body to be included in the POST request.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.responseHeaders
- The consumer for handling response headers (unsupported in this method).- Returns:
- The response of the POST request.
-
post
default <T extends RESTResponse> T post(String path, RESTRequest body, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler, Consumer<Map<String, String>> responseHeaders) Perform a POST request on the specified path with a given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.body
- The request body to be included in the POST request.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.responseHeaders
- The consumer for handling response headers (unsupported in this method).- Returns:
- The response of the POST request.
- Throws:
UnsupportedOperationException
- If trying to handle response headers (unsupported).
-
post
<T extends RESTResponse> T post(String path, RESTRequest body, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a POST request on the specified path with given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.body
- The request body to be included in the POST request.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the POST request.
-
put
default <T extends RESTResponse> T put(String path, RESTRequest body, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a PUT request on the specified path with given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.body
- The request body to be included in the PUT request.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the PUT request.
-
put
default <T extends RESTResponse> T put(String path, RESTRequest body, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler, Consumer<Map<String, String>> responseHeaders) Perform a PUT request on the specified path with given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.body
- The request body to be included in the PUT request.responseType
- The class representing the type of the response.headers
- The supplier for providing headers to be included in the request.errorHandler
- The consumer for handling error responses.responseHeaders
- The consumer for handling response headers.- Returns:
- The response of the PUT request.
-
put
default <T extends RESTResponse> T put(String path, RESTRequest body, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler, Consumer<Map<String, String>> responseHeaders) Perform a PUT request on the specified path with a request body, response type, headers, and error handling.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.body
- The request body to be included in the PUT request.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.responseHeaders
- This parameter is not supported and should be set to null.- Returns:
- The response of the PUT request.
- Throws:
UnsupportedOperationException
- ifresponseHeaders
is not null, as returning response headers is not supported.
-
put
<T extends RESTResponse> T put(String path, RESTRequest body, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a PUT request on the specified path with given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.body
- The request body to be included in the PUT request.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the PUT request.
-
patch
<T extends RESTResponse> T patch(String path, RESTRequest body, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a PATCH request on the specified path with given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.body
- The request body to be included in the PATCH request.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the PATCH request.
-
postForm
default <T extends RESTResponse> T postForm(String path, Map<String, String> formData, Class<T> responseType, Supplier<Map<String, String>> headers, Consumer<ErrorResponse> errorHandler) Perform a POST request with form data on the specified path with the given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.formData
- The form data to be included in the POST request body.responseType
- The class representing the type of the response.headers
- The supplier for providing headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the POST request.
-
postForm
<T extends RESTResponse> T postForm(String path, Map<String, String> formData, Class<T> responseType, Map<String, String> headers, Consumer<ErrorResponse> errorHandler) Perform a POST request with form data on the specified path with the given information.- Type Parameters:
T
- The type of the response.- Parameters:
path
- The path to be requested.formData
- The form data to be included in the POST request body.responseType
- The class representing the type of the response.headers
- The headers to be included in the request.errorHandler
- The consumer for handling error responses.- Returns:
- The response of the POST request.
-