Package ch.rswk.meta.client
Class RestClient
java.lang.Object
ch.rswk.meta.client.RestClient
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRestClient
(org.eclipse.jetty.client.HttpClient client, String engine, @Nullable String password, String user) -
Method Summary
Modifier and TypeMethodDescriptionprivate org.eclipse.jetty.client.api.Response
downloadFile
(Supplier<org.eclipse.jetty.client.api.Request> requestSupplier, boolean requestToken, Path target) org.eclipse.jetty.client.api.Response
downloadFile
(Supplier<org.eclipse.jetty.client.api.Request> requestSupplier, Path target) private org.eclipse.jetty.client.api.Request
prepareRequest
(org.eclipse.jetty.client.api.Request request) private boolean
static org.eclipse.jetty.client.api.ContentResponse
renewToken
(org.eclipse.jetty.client.HttpClient client, @Nullable String password, String uri, String user) void
org.eclipse.jetty.client.api.ContentResponse
private org.eclipse.jetty.client.api.ContentResponse
com.google.common.util.concurrent.ListenableFuture
<org.eclipse.jetty.client.api.ContentResponse> com.google.common.util.concurrent.ListenableFuture
<org.eclipse.jetty.client.api.ContentResponse> sendAsync
(int maxLength, Supplier<org.eclipse.jetty.client.api.Request> requestSupplier, boolean requestToken)
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
client
private final org.eclipse.jetty.client.HttpClient client -
password
-
tokenResourceUri
-
user
-
activeToken
-
-
Constructor Details
-
RestClient
-
-
Method Details
-
send
public org.eclipse.jetty.client.api.ContentResponse send(Supplier<org.eclipse.jetty.client.api.Request> requestSupplier) throws InterruptedException, TimeoutException, ExecutionException -
send
private org.eclipse.jetty.client.api.ContentResponse send(Supplier<org.eclipse.jetty.client.api.Request> requestSupplier, boolean requestToken) throws InterruptedException, TimeoutException, ExecutionException -
downloadFile
public org.eclipse.jetty.client.api.Response downloadFile(Supplier<org.eclipse.jetty.client.api.Request> requestSupplier, Path target) throws InterruptedException, TimeoutException, ExecutionException -
downloadFile
private org.eclipse.jetty.client.api.Response downloadFile(Supplier<org.eclipse.jetty.client.api.Request> requestSupplier, boolean requestToken, Path target) throws InterruptedException, TimeoutException, ExecutionException -
sendAsync
public com.google.common.util.concurrent.ListenableFuture<org.eclipse.jetty.client.api.ContentResponse> sendAsync(int maxLength, Supplier<org.eclipse.jetty.client.api.Request> requestSupplier) throws InterruptedException - Throws:
InterruptedException
-
sendAsync
public com.google.common.util.concurrent.ListenableFuture<org.eclipse.jetty.client.api.ContentResponse> sendAsync(int maxLength, Supplier<org.eclipse.jetty.client.api.Request> requestSupplier, boolean requestToken) throws InterruptedException - Throws:
InterruptedException
-
prepareRequest
private org.eclipse.jetty.client.api.Request prepareRequest(org.eclipse.jetty.client.api.Request request) throws InterruptedException - Throws:
InterruptedException
-
renewToken
- Throws:
InterruptedException
-
resetToken
public void resetToken() -
renewToken
public static org.eclipse.jetty.client.api.ContentResponse renewToken(org.eclipse.jetty.client.HttpClient client, @Nullable String password, String uri, String user) throws Exception - Throws:
Exception
-