public class RestClient extends Object implements AutoCloseableAsync
RestServerEndpoint
.Modifier and Type | Field and Description |
---|---|
static String |
VERSION_PLACEHOLDER |
Constructor and Description |
---|
RestClient(Configuration configuration,
Executor executor) |
RestClient(Configuration configuration,
Executor executor,
String host,
int port) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Void> |
closeAsync()
Trigger the closing of the resource and return the corresponding close future.
|
static RestClient |
forUrl(Configuration configuration,
Executor executor,
URL rootUrl)
Creates a new RestClient for the provided root URL.
|
<M extends MessageHeaders<EmptyRequestBody,P,EmptyMessageParameters>,P extends ResponseBody> |
sendRequest(String targetAddress,
int targetPort,
M messageHeaders) |
<M extends MessageHeaders<R,P,U>,U extends MessageParameters,R extends RequestBody,P extends ResponseBody> |
sendRequest(String targetAddress,
int targetPort,
M messageHeaders,
U messageParameters,
R request) |
<M extends MessageHeaders<R,P,U>,U extends MessageParameters,R extends RequestBody,P extends ResponseBody> |
sendRequest(String targetAddress,
int targetPort,
M messageHeaders,
U messageParameters,
R request,
Collection<FileUpload> fileUploads) |
<M extends MessageHeaders<R,P,U>,U extends MessageParameters,R extends RequestBody,P extends ResponseBody> |
sendRequest(String targetAddress,
int targetPort,
M messageHeaders,
U messageParameters,
R request,
Collection<FileUpload> fileUploads,
RestAPIVersion<? extends RestAPIVersion<?>> apiVersion) |
void |
shutdown(Time timeout) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public static final String VERSION_PLACEHOLDER
public RestClient(Configuration configuration, Executor executor) throws ConfigurationException
ConfigurationException
public RestClient(Configuration configuration, Executor executor, String host, int port) throws ConfigurationException
ConfigurationException
public static RestClient forUrl(Configuration configuration, Executor executor, URL rootUrl) throws ConfigurationException
ConfigurationException
public CompletableFuture<Void> closeAsync()
AutoCloseableAsync
closeAsync
in interface AutoCloseableAsync
public void shutdown(Time timeout)
public <M extends MessageHeaders<EmptyRequestBody,P,EmptyMessageParameters>,P extends ResponseBody> CompletableFuture<P> sendRequest(String targetAddress, int targetPort, M messageHeaders) throws IOException
IOException
public <M extends MessageHeaders<R,P,U>,U extends MessageParameters,R extends RequestBody,P extends ResponseBody> CompletableFuture<P> sendRequest(String targetAddress, int targetPort, M messageHeaders, U messageParameters, R request) throws IOException
IOException
public <M extends MessageHeaders<R,P,U>,U extends MessageParameters,R extends RequestBody,P extends ResponseBody> CompletableFuture<P> sendRequest(String targetAddress, int targetPort, M messageHeaders, U messageParameters, R request, Collection<FileUpload> fileUploads) throws IOException
IOException
public <M extends MessageHeaders<R,P,U>,U extends MessageParameters,R extends RequestBody,P extends ResponseBody> CompletableFuture<P> sendRequest(String targetAddress, int targetPort, M messageHeaders, U messageParameters, R request, Collection<FileUpload> fileUploads, RestAPIVersion<? extends RestAPIVersion<?>> apiVersion) throws IOException
IOException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.