public static class JerseyInvocation.Builder
extends java.lang.Object
implements javax.ws.rs.client.Invocation.Builder
client invocation builder
.Modifier and Type | Field and Description |
---|---|
private ClientRequest |
requestContext |
Modifier | Constructor and Description |
---|---|
protected |
Builder(java.net.URI uri,
ClientConfig configuration)
Create new Jersey-specific client invocation builder.
|
Modifier and Type | Method and Description |
---|---|
JerseyInvocation.Builder |
accept(javax.ws.rs.core.MediaType... mediaTypes) |
JerseyInvocation.Builder |
accept(java.lang.String... mediaTypes) |
javax.ws.rs.client.Invocation.Builder |
acceptEncoding(java.lang.String... encodings) |
JerseyInvocation.Builder |
acceptLanguage(java.util.Locale... locales) |
JerseyInvocation.Builder |
acceptLanguage(java.lang.String... locales) |
javax.ws.rs.client.AsyncInvoker |
async() |
JerseyInvocation |
build(java.lang.String method) |
JerseyInvocation |
build(java.lang.String method,
javax.ws.rs.client.Entity<?> entity) |
JerseyInvocation |
buildDelete() |
JerseyInvocation |
buildGet() |
JerseyInvocation |
buildPost(javax.ws.rs.client.Entity<?> entity) |
JerseyInvocation |
buildPut(javax.ws.rs.client.Entity<?> entity) |
JerseyInvocation.Builder |
cacheControl(javax.ws.rs.core.CacheControl cacheControl) |
JerseyInvocation.Builder |
cookie(javax.ws.rs.core.Cookie cookie) |
JerseyInvocation.Builder |
cookie(java.lang.String name,
java.lang.String value) |
private <T extends javax.ws.rs.client.RxInvoker> |
createRxInvoker(java.lang.Class<? extends javax.ws.rs.client.RxInvoker> clazz,
java.util.concurrent.ExecutorService executorService)
Create
RxInvoker from provided RxInvoker subclass. |
javax.ws.rs.core.Response |
delete() |
<T> T |
delete(java.lang.Class<T> responseType) |
<T> T |
delete(javax.ws.rs.core.GenericType<T> responseType) |
javax.ws.rs.core.Response |
get() |
<T> T |
get(java.lang.Class<T> responseType) |
<T> T |
get(javax.ws.rs.core.GenericType<T> responseType) |
javax.ws.rs.core.Response |
head() |
JerseyInvocation.Builder |
header(java.lang.String name,
java.lang.Object value) |
JerseyInvocation.Builder |
headers(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> headers) |
javax.ws.rs.core.Response |
method(java.lang.String name) |
<T> T |
method(java.lang.String name,
java.lang.Class<T> responseType) |
javax.ws.rs.core.Response |
method(java.lang.String name,
javax.ws.rs.client.Entity<?> entity) |
<T> T |
method(java.lang.String name,
javax.ws.rs.client.Entity<?> entity,
java.lang.Class<T> responseType) |
<T> T |
method(java.lang.String name,
javax.ws.rs.client.Entity<?> entity,
javax.ws.rs.core.GenericType<T> responseType) |
<T> T |
method(java.lang.String name,
javax.ws.rs.core.GenericType<T> responseType) |
javax.ws.rs.core.Response |
options() |
<T> T |
options(java.lang.Class<T> responseType) |
<T> T |
options(javax.ws.rs.core.GenericType<T> responseType) |
javax.ws.rs.core.Response |
post(javax.ws.rs.client.Entity<?> entity) |
<T> T |
post(javax.ws.rs.client.Entity<?> entity,
java.lang.Class<T> responseType) |
<T> T |
post(javax.ws.rs.client.Entity<?> entity,
javax.ws.rs.core.GenericType<T> responseType) |
JerseyInvocation.Builder |
property(java.lang.String name,
java.lang.Object value) |
javax.ws.rs.core.Response |
put(javax.ws.rs.client.Entity<?> entity) |
<T> T |
put(javax.ws.rs.client.Entity<?> entity,
java.lang.Class<T> responseType) |
<T> T |
put(javax.ws.rs.client.Entity<?> entity,
javax.ws.rs.core.GenericType<T> responseType) |
(package private) ClientRequest |
request()
Returns a reference to the mutable request context to be invoked.
|
javax.ws.rs.client.CompletionStageRxInvoker |
rx() |
<T extends javax.ws.rs.client.RxInvoker> |
rx(java.lang.Class<T> clazz) |
private <T extends javax.ws.rs.client.RxInvoker> |
rx(java.lang.Class<T> clazz,
java.util.concurrent.ExecutorService executorService) |
private void |
storeEntity(javax.ws.rs.client.Entity<?> entity) |
javax.ws.rs.core.Response |
trace() |
<T> T |
trace(java.lang.Class<T> responseType) |
<T> T |
trace(javax.ws.rs.core.GenericType<T> responseType) |
private final ClientRequest requestContext
protected Builder(java.net.URI uri, ClientConfig configuration)
uri
- invoked request URI.configuration
- Jersey client configuration.ClientRequest request()
private void storeEntity(javax.ws.rs.client.Entity<?> entity)
public JerseyInvocation build(java.lang.String method)
build
in interface javax.ws.rs.client.Invocation.Builder
public JerseyInvocation build(java.lang.String method, javax.ws.rs.client.Entity<?> entity)
build
in interface javax.ws.rs.client.Invocation.Builder
public JerseyInvocation buildGet()
buildGet
in interface javax.ws.rs.client.Invocation.Builder
public JerseyInvocation buildDelete()
buildDelete
in interface javax.ws.rs.client.Invocation.Builder
public JerseyInvocation buildPost(javax.ws.rs.client.Entity<?> entity)
buildPost
in interface javax.ws.rs.client.Invocation.Builder
public JerseyInvocation buildPut(javax.ws.rs.client.Entity<?> entity)
buildPut
in interface javax.ws.rs.client.Invocation.Builder
public javax.ws.rs.client.AsyncInvoker async()
async
in interface javax.ws.rs.client.Invocation.Builder
public JerseyInvocation.Builder accept(java.lang.String... mediaTypes)
accept
in interface javax.ws.rs.client.Invocation.Builder
public JerseyInvocation.Builder accept(javax.ws.rs.core.MediaType... mediaTypes)
accept
in interface javax.ws.rs.client.Invocation.Builder
public javax.ws.rs.client.Invocation.Builder acceptEncoding(java.lang.String... encodings)
acceptEncoding
in interface javax.ws.rs.client.Invocation.Builder
public JerseyInvocation.Builder acceptLanguage(java.util.Locale... locales)
acceptLanguage
in interface javax.ws.rs.client.Invocation.Builder
public JerseyInvocation.Builder acceptLanguage(java.lang.String... locales)
acceptLanguage
in interface javax.ws.rs.client.Invocation.Builder
public JerseyInvocation.Builder cookie(javax.ws.rs.core.Cookie cookie)
cookie
in interface javax.ws.rs.client.Invocation.Builder
public JerseyInvocation.Builder cookie(java.lang.String name, java.lang.String value)
cookie
in interface javax.ws.rs.client.Invocation.Builder
public JerseyInvocation.Builder cacheControl(javax.ws.rs.core.CacheControl cacheControl)
cacheControl
in interface javax.ws.rs.client.Invocation.Builder
public JerseyInvocation.Builder header(java.lang.String name, java.lang.Object value)
header
in interface javax.ws.rs.client.Invocation.Builder
public JerseyInvocation.Builder headers(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> headers)
headers
in interface javax.ws.rs.client.Invocation.Builder
public javax.ws.rs.core.Response get() throws javax.ws.rs.ProcessingException
get
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
public <T> T get(java.lang.Class<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
get
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public <T> T get(javax.ws.rs.core.GenericType<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
get
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public javax.ws.rs.core.Response put(javax.ws.rs.client.Entity<?> entity) throws javax.ws.rs.ProcessingException
put
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
public <T> T put(javax.ws.rs.client.Entity<?> entity, java.lang.Class<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
put
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public <T> T put(javax.ws.rs.client.Entity<?> entity, javax.ws.rs.core.GenericType<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
put
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public javax.ws.rs.core.Response post(javax.ws.rs.client.Entity<?> entity) throws javax.ws.rs.ProcessingException
post
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
public <T> T post(javax.ws.rs.client.Entity<?> entity, java.lang.Class<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
post
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public <T> T post(javax.ws.rs.client.Entity<?> entity, javax.ws.rs.core.GenericType<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
post
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public javax.ws.rs.core.Response delete() throws javax.ws.rs.ProcessingException
delete
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
public <T> T delete(java.lang.Class<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
delete
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public <T> T delete(javax.ws.rs.core.GenericType<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
delete
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public javax.ws.rs.core.Response head() throws javax.ws.rs.ProcessingException
head
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
public javax.ws.rs.core.Response options() throws javax.ws.rs.ProcessingException
options
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
public <T> T options(java.lang.Class<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
options
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public <T> T options(javax.ws.rs.core.GenericType<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
options
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public javax.ws.rs.core.Response trace() throws javax.ws.rs.ProcessingException
trace
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
public <T> T trace(java.lang.Class<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
trace
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public <T> T trace(javax.ws.rs.core.GenericType<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
trace
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public javax.ws.rs.core.Response method(java.lang.String name) throws javax.ws.rs.ProcessingException
method
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
public <T> T method(java.lang.String name, java.lang.Class<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
method
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public <T> T method(java.lang.String name, javax.ws.rs.core.GenericType<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
method
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public javax.ws.rs.core.Response method(java.lang.String name, javax.ws.rs.client.Entity<?> entity) throws javax.ws.rs.ProcessingException
method
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
public <T> T method(java.lang.String name, javax.ws.rs.client.Entity<?> entity, java.lang.Class<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
method
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public <T> T method(java.lang.String name, javax.ws.rs.client.Entity<?> entity, javax.ws.rs.core.GenericType<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
method
in interface javax.ws.rs.client.SyncInvoker
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public JerseyInvocation.Builder property(java.lang.String name, java.lang.Object value)
property
in interface javax.ws.rs.client.Invocation.Builder
public javax.ws.rs.client.CompletionStageRxInvoker rx()
rx
in interface javax.ws.rs.client.Invocation.Builder
public <T extends javax.ws.rs.client.RxInvoker> T rx(java.lang.Class<T> clazz)
rx
in interface javax.ws.rs.client.Invocation.Builder
private <T extends javax.ws.rs.client.RxInvoker> T rx(java.lang.Class<T> clazz, java.util.concurrent.ExecutorService executorService)
private <T extends javax.ws.rs.client.RxInvoker> T createRxInvoker(java.lang.Class<? extends javax.ws.rs.client.RxInvoker> clazz, java.util.concurrent.ExecutorService executorService)
RxInvoker
from provided RxInvoker
subclass.
The method does a lookup for RxInvokerProvider
, which provides given RxInvoker
subclass
and if found, calls RxInvokerProvider.getRxInvoker(SyncInvoker, ExecutorService)
T
- RxInvoker
subclass to be returned.clazz
- RxInvoker
subclass to be created.executorService
- to be passed to the factory method invocation.RxInvoker
subclass.java.lang.IllegalStateException
- when provider for given class is not registered.