public interface RestClient
| Modifier and Type | Interface and Description |
|---|---|
static interface |
RestClient.Invocation
Invocation operations
|
static interface |
RestClient.Invoker
Invoker to perform a client request in order to consume a response using a
RestClient.RequestDefinition. |
static interface |
RestClient.RequestDefinition
Request message definition and response invocation.
|
| Modifier and Type | Method and Description |
|---|---|
RestClient |
clearDefaultHeaders()
Removes all default headers
|
static RestClient |
create()
Create a new
RestClient instance using default ClassLoader and default implementation, if
available. |
static RestClient |
create(ClassLoader classLoader)
Create a new
RestClient instance using given classLoder and default implementation, if
available. |
static RestClient |
create(String fullyQualifiedClassName)
Create a new
RestClient instance using default ClassLoader and the implementation whith given
fully qualified class name. |
static RestClient |
create(String fullyQualifiedClassName,
ClassLoader classLoader)
Create a new
RestClient instance using given classLoder and the implementation whith given
fully qualified class name. |
RestClient |
defaultTarget(URI baseUri)
Set the default target request base URI, which will be used as target URI for every request configured using
request(), if not overridden using RestClient.RequestDefinition.target(URI). |
static RestClient |
forTarget(String baseUri)
Create a new
RestClient instance using default ClassLoader and default implementation, setting
given baseUri as default RestClient target, which will be used as base URI for every request
configured using request(), if not overridden using RestClient.RequestDefinition.target(URI). |
static RestClient |
forTarget(URI baseUri)
Create a new
RestClient instance using default ClassLoader and default implementation, setting
given baseUri as default RestClient target, which will be used as base URI for every request
configured using request(), if not overridden using RestClient.RequestDefinition.target(URI). |
Optional<URI> |
getDefaultTarget()
Get the default target request base URI, which will be used as target URI for every request configured using
request(), if not overridden using RestClient.RequestDefinition.target(URI). |
RestClient |
removeDefaultHeader(String name)
Removes the default header with given
name, if present |
RestClient.RequestDefinition |
request()
Create a new request definition, to be used to configure request and invoke response.
|
RestClient |
withDefaultHeader(String name,
String value)
Add a default request header which will be automatically added to every invocation request message, if an header
with the same name is not already present.
|
RestClient defaultTarget(URI baseUri)
request(), if not overridden using RestClient.RequestDefinition.target(URI).
URI template parameters are not supported for the base target URI.
baseUri - Default target request base URIOptional<URI> getDefaultTarget()
request(), if not overridden using RestClient.RequestDefinition.target(URI).RestClient withDefaultHeader(String name, String value)
name - Header name (not null)value - Header valueRestClient removeDefaultHeader(String name)
name, if presentname - Header name to remove (not null)RestClient clearDefaultHeaders()
RestClient.RequestDefinition request()
If a default target request URI is configured using defaultTarget(URI), this will be used as request
base URI. The target URI can be overridden using RestClient.RequestDefinition.target(URI).
static RestClient forTarget(String baseUri)
RestClient instance using default ClassLoader and default implementation, setting
given baseUri as default RestClient target, which will be used as base URI for every request
configured using request(), if not overridden using RestClient.RequestDefinition.target(URI).baseUri - The base target URI of the returned RestClientRestClient instancestatic RestClient forTarget(URI baseUri)
RestClient instance using default ClassLoader and default implementation, setting
given baseUri as default RestClient target, which will be used as base URI for every request
configured using request(), if not overridden using RestClient.RequestDefinition.target(URI).baseUri - The base target URI of the returned RestClientRestClient instancestatic RestClient create()
RestClient instance using default ClassLoader and default implementation, if
available. If more than one RestClient implementation is found using given ClassLoader, the one returned
by the RestClientFactory with the higher priority is returned.RestClient instanceRestClientCreationException - If a RestClient implementation is not available or a instance
creation error occurredstatic RestClient create(ClassLoader classLoader)
RestClient instance using given classLoder and default implementation, if
available. If more than one RestClient implementation is found using given ClassLoader, the one returned
by the RestClientFactory with the higher priority is returned.classLoader - The ClassLoader to useRestClient instanceRestClientCreationException - If a RestClient implementation is not available or a instance
creation error occurredstatic RestClient create(String fullyQualifiedClassName)
RestClient instance using default ClassLoader and the implementation whith given
fully qualified class name.fullyQualifiedClassName - The RestClient implementation fully qualified class name to obtainRestClient instanceRestClientCreationException - If the implementation which corresponds to given fully qualified class name
is not available or a instance creation error occurredstatic RestClient create(String fullyQualifiedClassName, ClassLoader classLoader)
RestClient instance using given classLoder and the implementation whith given
fully qualified class name.fullyQualifiedClassName - The RestClient implementation fully qualified class name to obtainclassLoader - The ClassLoader to useRestClient instanceRestClientCreationException - If the implementation which corresponds to given fully qualified class name
is not available or a instance creation error occurredCopyright © 2017 The Holon Platform. All rights reserved.