public class CloudStoreRestClient extends Object
An instance of this class is used to send data to, query data from or execute logic on the server.
If a series of multiple requests is to be sent to the server, it is recommended to keep an instance of this class (because it caches resources) and invoke multiple requests with it.
This class is thread-safe.
Constructor and Description |
---|
CloudStoreRestClient(String url,
javax.ws.rs.client.ClientBuilder clientBuilder)
Create a new client.
|
CloudStoreRestClient(URL url,
javax.ws.rs.client.ClientBuilder clientBuilder)
Create a new client.
|
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.client.Invocation.Builder |
assignCredentials(javax.ws.rs.client.Invocation.Builder builder) |
<R> R |
execute(Request<R> request) |
String |
getBaseUrl()
Get the server's base-URL.
|
javax.ws.rs.client.Client |
getClientOrFail()
|
CredentialsProvider |
getCredentialsProvider() |
protected RuntimeException |
handleAndRethrowException(Throwable x) |
void |
setCredentialsProvider(CredentialsProvider credentialsProvider) |
public CloudStoreRestClient(URL url, javax.ws.rs.client.ClientBuilder clientBuilder)
url
- any URL to the server. Must not be null
.
May be the base-URL, any repository's remote-root-URL or any URL within a remote-root-URL.
The base-URL is automatically determined by cutting sub-paths, step by step.public CloudStoreRestClient(String url, javax.ws.rs.client.ClientBuilder clientBuilder)
url
- any URL to the server. Must not be null
.
May be the base-URL, any repository's remote-root-URL or any URL within a remote-root-URL.
The base-URL is automatically determined by cutting sub-paths, step by step.public String getBaseUrl()
This base-URL is the base of the CloudStoreREST
application. Hence all URLs
beneath this base-URL are processed by the CloudStoreREST
application.
In other words: All repository-names are located directly beneath this base-URL. The special services, too, are located directly beneath this base-URL.
For example, if the server's base-URL is "https://host.domain:8443/", then the test-service is available via "https://host.domain:8443/_test" and the repository with the alias "myrepo" is "https://host.domain:8443/myrepo".
public javax.ws.rs.client.Invocation.Builder assignCredentials(javax.ws.rs.client.Invocation.Builder builder)
public javax.ws.rs.client.Client getClientOrFail()
Client
. Never null
.IllegalStateException
- if there is no Client
bound to the current thread.acquireClient()
protected RuntimeException handleAndRethrowException(Throwable x)
public CredentialsProvider getCredentialsProvider()
public void setCredentialsProvider(CredentialsProvider credentialsProvider)
Copyright © 2013–2019. All rights reserved.