Class ClientInvocationBuilder
java.lang.Object
org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder
- All Implemented Interfaces:
Invocation.Builder,SyncInvoker
- Version:
- $Revision: 1 $
- Author:
- Bill Burke, Alessio Soldano
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClientInvocationBuilder(ResteasyClient client, URI uri, ClientConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionAdd the accepted response media types.Add the accepted response media types.acceptEncoding(String... encodings) Add acceptable encodings.acceptLanguage(String... locales) Add acceptable languages.acceptLanguage(Locale... locales) Add acceptable languages.async()Access the asynchronous uniform request invocation interface to asynchronously invoke the built request.Build a request invocation using an arbitrary request method name.Build a request invocation using an arbitrary request method name and request entity.Build a DELETE request invocation.buildGet()Build a GET request invocation.Build a POST request invocation.Build a PUT request invocation.cacheControl(CacheControl cacheControl) Set the cache control data of the message.Add a cookie to be set.Add a cookie to be set.protected ClientInvocationcreateClientInvocation(ClientInvocation invocation) protected ClientInvocationcreateClientInvocation(ResteasyClient client, URI uri, ClientRequestHeaders headers, ClientConfiguration parent) delete()Invoke HTTP DELETE method for the current request synchronously.<T> Tdelete(GenericType<T> responseType) Invoke HTTP DELETE method for the current request synchronously.<T> TInvoke HTTP DELETE method for the current request synchronously.get()Invoke HTTP GET method for the current request synchronously.<T> Tget(GenericType<T> responseType) Invoke HTTP GET method for the current request synchronously.<T> TInvoke HTTP GET method for the current request synchronously.exposes the client invocation for easier integration with other librariesgetURI()head()Invoke HTTP HEAD method for the current request synchronously.Add an arbitrary header.headers(MultivaluedMap<String, Object> headers) Replaces all existing headers with the newly supplied headers.booleanInvoke an arbitrary method for the current request synchronously.Invoke an arbitrary method for the current request synchronously.<T> Tmethod(String name, Entity<?> entity, GenericType<T> responseType) Invoke an arbitrary method for the current request synchronously.<T> TInvoke an arbitrary method for the current request synchronously.<T> Tmethod(String name, GenericType<T> responseType) Invoke an arbitrary method for the current request synchronously.<T> TInvoke an arbitrary method for the current request synchronously.options()Invoke HTTP OPTIONS method for the current request synchronously.<T> Toptions(GenericType<T> responseType) Invoke HTTP OPTIONS method for the current request synchronously.<T> TInvoke HTTP OPTIONS method for the current request synchronously.<T> Tpatch(Entity<?> entity, GenericType<T> responseType) <T> TInvoke HTTP POST method for the current request synchronously.<T> Tpost(Entity<?> entity, GenericType<T> responseType) Invoke HTTP POST method for the current request synchronously.<T> TInvoke HTTP POST method for the current request synchronously.Set a new property in the context of a request represented by this invocation builder.Invoke HTTP PUT method for the current request synchronously.<T> Tput(Entity<?> entity, GenericType<T> responseType) Invoke HTTP PUT method for the current request synchronously.<T> TInvoke HTTP PUT method for the current request synchronously.rx()Access the default reactive invoker based onCompletionStage.<T extends RxInvoker>
TAccess a reactive invoker based on aRxInvokersubclass provider.voidsetChunked(boolean chunked) voidsetClientInvocation(ClientInvocation invocation) voidtrace()Invoke HTTP TRACE method for the current request synchronously.<T> Ttrace(GenericType<T> responseType) Invoke HTTP TRACE method for the current request synchronously.<T> TInvoke HTTP TRACE method for the current request synchronously.
-
Field Details
-
invocation
-
-
Constructor Details
-
ClientInvocationBuilder
-
-
Method Details
-
createClientInvocation
protected ClientInvocation createClientInvocation(ResteasyClient client, URI uri, ClientRequestHeaders headers, ClientConfiguration parent) -
createClientInvocation
-
getHeaders
-
setClientInvocation
-
getClientInvocation
exposes the client invocation for easier integration with other libraries- Returns:
- the underlying client invocation
-
accept
Description copied from interface:Invocation.BuilderAdd the accepted response media types.- Specified by:
acceptin interfaceInvocation.Builder- Parameters:
mediaTypes- accepted response media types.- Returns:
- the updated builder.
-
accept
Description copied from interface:Invocation.BuilderAdd the accepted response media types.- Specified by:
acceptin interfaceInvocation.Builder- Parameters:
mediaTypes- accepted response media types.- Returns:
- the updated builder.
-
acceptLanguage
Description copied from interface:Invocation.BuilderAdd acceptable languages.- Specified by:
acceptLanguagein interfaceInvocation.Builder- Parameters:
locales- an array of the acceptable languages.- Returns:
- the updated builder.
-
acceptLanguage
Description copied from interface:Invocation.BuilderAdd acceptable languages.- Specified by:
acceptLanguagein interfaceInvocation.Builder- Parameters:
locales- an array of the acceptable languages.- Returns:
- the updated builder.
-
acceptEncoding
Description copied from interface:Invocation.BuilderAdd acceptable encodings.- Specified by:
acceptEncodingin interfaceInvocation.Builder- Parameters:
encodings- an array of the acceptable encodings.- Returns:
- the updated builder.
-
cookie
Description copied from interface:Invocation.BuilderAdd a cookie to be set.- Specified by:
cookiein interfaceInvocation.Builder- Parameters:
cookie- to be set.- Returns:
- the updated builder.
-
cookie
Description copied from interface:Invocation.BuilderAdd a cookie to be set.- Specified by:
cookiein interfaceInvocation.Builder- Parameters:
name- the name of the cookie.value- the value of the cookie.- Returns:
- the updated builder.
-
cacheControl
Description copied from interface:Invocation.BuilderSet the cache control data of the message.- Specified by:
cacheControlin interfaceInvocation.Builder- Parameters:
cacheControl- the cache control directives, ifnullany existing cache control directives will be removed.- Returns:
- the updated builder.
-
header
Description copied from interface:Invocation.BuilderAdd an arbitrary header.- Specified by:
headerin interfaceInvocation.Builder- Parameters:
name- the name of the headervalue- the value of the header, the header will be serialized using aRuntimeDelegate.HeaderDelegateif one is available viaRuntimeDelegate.createHeaderDelegate(java.lang.Class)for the class ofvalueor using itstoStringmethod if a header delegate is not available. Ifvalueisnullthen all current headers of the same name will be removed.- Returns:
- the updated builder.
-
headers
Description copied from interface:Invocation.BuilderReplaces all existing headers with the newly supplied headers.- Specified by:
headersin interfaceInvocation.Builder- Parameters:
headers- new headers to be set, ifnullall existing headers will be removed.- Returns:
- the updated builder.
-
build
Description copied from interface:Invocation.BuilderBuild a request invocation using an arbitrary request method name.- Specified by:
buildin interfaceInvocation.Builder- Parameters:
method- request method name.- Returns:
- invocation encapsulating the built request.
-
build
Description copied from interface:Invocation.BuilderBuild a request invocation using an arbitrary request method name and request entity.- Specified by:
buildin interfaceInvocation.Builder- Parameters:
method- request method name.entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.- Returns:
- invocation encapsulating the built request.
-
buildGet
Description copied from interface:Invocation.BuilderBuild a GET request invocation.- Specified by:
buildGetin interfaceInvocation.Builder- Returns:
- invocation encapsulating the built GET request.
-
buildDelete
Description copied from interface:Invocation.BuilderBuild a DELETE request invocation.- Specified by:
buildDeletein interfaceInvocation.Builder- Returns:
- invocation encapsulating the built DELETE request.
-
buildPost
Description copied from interface:Invocation.BuilderBuild a POST request invocation.- Specified by:
buildPostin interfaceInvocation.Builder- Parameters:
entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.- Returns:
- invocation encapsulating the built POST request.
-
buildPut
Description copied from interface:Invocation.BuilderBuild a PUT request invocation.- Specified by:
buildPutin interfaceInvocation.Builder- Parameters:
entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.- Returns:
- invocation encapsulating the built PUT request.
-
async
Description copied from interface:Invocation.BuilderAccess the asynchronous uniform request invocation interface to asynchronously invoke the built request.- Specified by:
asyncin interfaceInvocation.Builder- Returns:
- asynchronous uniform request invocation interface.
-
get
Description copied from interface:SyncInvokerInvoke HTTP GET method for the current request synchronously.- Specified by:
getin interfaceSyncInvoker- Returns:
- invocation response.
-
get
Description copied from interface:SyncInvokerInvoke HTTP GET method for the current request synchronously.- Specified by:
getin interfaceSyncInvoker- Type Parameters:
T- response entity type.- Parameters:
responseType- Java type the response entity will be converted to.- Returns:
- invocation response.
-
get
Description copied from interface:SyncInvokerInvoke HTTP GET method for the current request synchronously.- Specified by:
getin interfaceSyncInvoker- Type Parameters:
T- generic response entity type.- Parameters:
responseType- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response.
-
put
Description copied from interface:SyncInvokerInvoke HTTP PUT method for the current request synchronously.- Specified by:
putin interfaceSyncInvoker- Parameters:
entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.- Returns:
- invocation response.
-
put
Description copied from interface:SyncInvokerInvoke HTTP PUT method for the current request synchronously.- Specified by:
putin interfaceSyncInvoker- Type Parameters:
T- response entity type.- Parameters:
entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.responseType- Java type the response entity will be converted to.- Returns:
- invocation response.
-
put
Description copied from interface:SyncInvokerInvoke HTTP PUT method for the current request synchronously.- Specified by:
putin interfaceSyncInvoker- Type Parameters:
T- generic response entity type.- Parameters:
entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.responseType- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response.
-
post
Description copied from interface:SyncInvokerInvoke HTTP POST method for the current request synchronously.- Specified by:
postin interfaceSyncInvoker- Parameters:
entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.- Returns:
- invocation response.
-
post
Description copied from interface:SyncInvokerInvoke HTTP POST method for the current request synchronously.- Specified by:
postin interfaceSyncInvoker- Type Parameters:
T- response entity type.- Parameters:
entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.responseType- Java type the response entity will be converted to.- Returns:
- invocation response.
-
post
Description copied from interface:SyncInvokerInvoke HTTP POST method for the current request synchronously.- Specified by:
postin interfaceSyncInvoker- Type Parameters:
T- generic response entity type.- Parameters:
entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.responseType- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response.
-
delete
Description copied from interface:SyncInvokerInvoke HTTP DELETE method for the current request synchronously.- Specified by:
deletein interfaceSyncInvoker- Returns:
- invocation response.
-
delete
Description copied from interface:SyncInvokerInvoke HTTP DELETE method for the current request synchronously.- Specified by:
deletein interfaceSyncInvoker- Type Parameters:
T- response entity type.- Parameters:
responseType- Java type the response entity will be converted to.- Returns:
- invocation response.
-
delete
Description copied from interface:SyncInvokerInvoke HTTP DELETE method for the current request synchronously.- Specified by:
deletein interfaceSyncInvoker- Type Parameters:
T- generic response entity type.- Parameters:
responseType- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response.
-
head
Description copied from interface:SyncInvokerInvoke HTTP HEAD method for the current request synchronously.- Specified by:
headin interfaceSyncInvoker- Returns:
- invocation response.
-
options
Description copied from interface:SyncInvokerInvoke HTTP OPTIONS method for the current request synchronously.- Specified by:
optionsin interfaceSyncInvoker- Returns:
- invocation response.
-
options
Description copied from interface:SyncInvokerInvoke HTTP OPTIONS method for the current request synchronously.- Specified by:
optionsin interfaceSyncInvoker- Type Parameters:
T- response entity type.- Parameters:
responseType- Java type the response entity will be converted to.- Returns:
- invocation response.
-
options
Description copied from interface:SyncInvokerInvoke HTTP OPTIONS method for the current request synchronously.- Specified by:
optionsin interfaceSyncInvoker- Type Parameters:
T- generic response entity type.- Parameters:
responseType- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response.
-
trace
Description copied from interface:SyncInvokerInvoke HTTP TRACE method for the current request synchronously.- Specified by:
tracein interfaceSyncInvoker- Returns:
- invocation response.
-
trace
Description copied from interface:SyncInvokerInvoke HTTP TRACE method for the current request synchronously.- Specified by:
tracein interfaceSyncInvoker- Type Parameters:
T- response entity type.- Parameters:
responseType- Java type the response entity will be converted to.- Returns:
- invocation response.
-
trace
Description copied from interface:SyncInvokerInvoke HTTP TRACE method for the current request synchronously.- Specified by:
tracein interfaceSyncInvoker- Type Parameters:
T- generic response entity type.- Parameters:
responseType- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response.
-
method
Description copied from interface:SyncInvokerInvoke an arbitrary method for the current request synchronously.- Specified by:
methodin interfaceSyncInvoker- Parameters:
name- method name.- Returns:
- invocation response.
-
method
Description copied from interface:SyncInvokerInvoke an arbitrary method for the current request synchronously.- Specified by:
methodin interfaceSyncInvoker- Type Parameters:
T- response entity type.- Parameters:
name- method name.responseType- Java type the response entity will be converted to.- Returns:
- invocation response.
-
method
Description copied from interface:SyncInvokerInvoke an arbitrary method for the current request synchronously.- Specified by:
methodin interfaceSyncInvoker- Type Parameters:
T- generic response entity type.- Parameters:
name- method name.responseType- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response.
-
method
Description copied from interface:SyncInvokerInvoke an arbitrary method for the current request synchronously.- Specified by:
methodin interfaceSyncInvoker- Parameters:
name- method name.entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.- Returns:
- invocation response.
-
method
Description copied from interface:SyncInvokerInvoke an arbitrary method for the current request synchronously.- Specified by:
methodin interfaceSyncInvoker- Type Parameters:
T- response entity type.- Parameters:
name- method name.entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.responseType- Java type the response entity will be converted to.- Returns:
- invocation response.
-
method
Description copied from interface:SyncInvokerInvoke an arbitrary method for the current request synchronously.- Specified by:
methodin interfaceSyncInvoker- Type Parameters:
T- generic response entity type.- Parameters:
name- method name.entity- request entity, including it's fullVariantinformation. Any variant-related HTTP headers previously set (namelyContent-Type,Content-LanguageandContent-Encoding) will be overwritten using the entity variant information.responseType- representation of a generic Java type the response entity will be converted to.- Returns:
- invocation response.
-
property
Description copied from interface:Invocation.BuilderSet a new property in the context of a request represented by this invocation builder.The property is available for a later retrieval via
ClientRequestContext.getProperty(String)orInterceptorContext.getProperty(String). If a property with a given name is already set in the request context, the existing value of the property will be updated. Setting anullvalue into a property effectively removes the property from the request property bag.- Specified by:
propertyin interfaceInvocation.Builder- Parameters:
name- property name.value- (new) property value.nullvalue removes the property with the given name.- Returns:
- the updated builder.
- See Also:
-
isChunked
public boolean isChunked() -
setChunked
public void setChunked(boolean chunked) -
rx
Description copied from interface:Invocation.BuilderAccess the default reactive invoker based onCompletionStage.- Specified by:
rxin interfaceInvocation.Builder- Returns:
- default reactive invoker instance.
- See Also:
-
rx
Description copied from interface:Invocation.BuilderAccess a reactive invoker based on aRxInvokersubclass provider. Note that correspondingRxInvokerProvidermust be registered in the client runtime.This method is an extension point for JAX-RS implementations to support other types representing asynchronous computations.
- Specified by:
rxin interfaceInvocation.Builder- Type Parameters:
T- generic invoker type.- Parameters:
clazz-RxInvokersubclass.- Returns:
- reactive invoker instance.
- See Also:
-
patch
-
patch
-
patch
-
getURI
-
getTarget
-
setTarget
-