Class ClientInvocation
- java.lang.Object
 - 
- org.jboss.resteasy.client.jaxrs.internal.ClientInvocation
 
 
- 
- All Implemented Interfaces:
 javax.ws.rs.client.Invocation
- Direct Known Subclasses:
 MpClientInvocation
public class ClientInvocation extends Object implements javax.ws.rs.client.Invocation
- Version:
 - $Revision: 1 $
 - Author:
 - Bill Burke
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected javax.ws.rs.client.WebTargetactualTargetprotected booleanchunkedprotected ResteasyClientclientprotected ClientInvokerclientInvokerprotected ClientConfigurationconfigurationprotected DelegatingOutputStreamdelegatingOutputStreamprotected Objectentityprotected Annotation[]entityAnnotationsprotected Class<?>entityClassprotected TypeentityGenericTypeprotected OutputStreamentityStreamprotected ClientRequestHeadersheadersprotected Stringmethodprotected RESTEasyTracingLoggertracingLoggerprotected URIuri 
- 
Constructor Summary
Constructors Modifier Constructor Description protectedClientInvocation(ClientInvocation clientInvocation)ClientInvocation(ResteasyClient client, URI uri, ClientRequestHeaders headers, ClientConfiguration parent) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutorServiceasyncInvocationExecutor()static <T> TextractResult(javax.ws.rs.core.GenericType<T> responseType, javax.ws.rs.core.Response response, Annotation[] annotations)Extracts result from response throwing an appropriate exception if not a successful response.protected ClientResponsefilterRequest(ClientRequestContextImpl requestContext)protected ClientResponsefilterResponse(ClientRequestContextImpl requestContext, ClientResponse response)javax.ws.rs.client.WebTargetgetActualTarget()ResteasyClientgetClient()ClientConfigurationgetClientConfiguration()ClientInvokergetClientInvoker()javax.ws.rs.core.ConfigurationgetConfiguration()DelegatingOutputStreamgetDelegatingOutputStream()ObjectgetEntity()Annotation[]getEntityAnnotations()Class<?>getEntityClass()TypegetEntityGenericType()OutputStreamgetEntityStream()protected static <T> AsyncClientHttpEngine.ResultExtractor<T>getGenericTypeExtractor(javax.ws.rs.core.GenericType<T> responseType)ClientRequestHeadersgetHeaders()StringgetMethod()Map<String,Object>getMutableProperties()javax.ws.rs.client.ClientRequestFilter[]getRequestFilters()javax.ws.rs.client.ClientResponseFilter[]getResponseFilters()protected static <T> AsyncClientHttpEngine.ResultExtractor<T>getResponseTypeExtractor(Class<T> responseType)RESTEasyTracingLoggergetTracingLogger()URIgetUri()javax.ws.rs.ext.WriterInterceptor[]getWriterInterceptors()static <T> ThandleErrorStatus(javax.ws.rs.core.Response response)Throw an exception.ClientResponseinvoke()<T> Tinvoke(Class<T> responseType)<T> Tinvoke(javax.ws.rs.core.GenericType<T> responseType)booleanisChunked()javax.ws.rs.client.Invocationproperty(String name, Object value)Optional<org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.ReactiveInvocation>reactive()If the client's HTTP engine implementsReactiveClientHttpEnginethen you can access the latter'sPublishervia this method.voidsetActualTarget(javax.ws.rs.client.WebTarget target)voidsetChunked(boolean chunked)voidsetClientInvoker(ClientInvoker clientInvoker)voidsetDelegatingOutputStream(DelegatingOutputStream delegatingOutputStream)voidsetEntity(javax.ws.rs.client.Entity<?> entity)voidsetEntityAnnotations(Annotation[] entityAnnotations)voidsetEntityObject(Object ent)voidsetEntityStream(OutputStream entityStream)voidsetHeaders(ClientRequestHeaders headers)voidsetMethod(String method)voidsetUri(URI uri)Future<javax.ws.rs.core.Response>submit()<T> Future<T>submit(Class<T> responseType)<T> Future<T>submit(javax.ws.rs.client.InvocationCallback<T> callback)<T> Future<T>submit(javax.ws.rs.core.GenericType<T> responseType)CompletableFuture<javax.ws.rs.core.Response>submitCF()<T> CompletableFuture<T>submitCF(Class<T> responseType)<T> CompletableFuture<T>submitCF(javax.ws.rs.core.GenericType<T> responseType)voidwriteRequestBody(OutputStream outputStream) 
 - 
 
- 
- 
Field Detail
- 
tracingLogger
protected RESTEasyTracingLogger tracingLogger
 
- 
client
protected ResteasyClient client
 
- 
headers
protected ClientRequestHeaders headers
 
- 
method
protected String method
 
- 
entity
protected Object entity
 
- 
entityGenericType
protected Type entityGenericType
 
- 
entityClass
protected Class<?> entityClass
 
- 
entityAnnotations
protected Annotation[] entityAnnotations
 
- 
configuration
protected ClientConfiguration configuration
 
- 
uri
protected URI uri
 
- 
chunked
protected boolean chunked
 
- 
clientInvoker
protected ClientInvoker clientInvoker
 
- 
actualTarget
protected javax.ws.rs.client.WebTarget actualTarget
 
- 
delegatingOutputStream
protected DelegatingOutputStream delegatingOutputStream
 
- 
entityStream
protected OutputStream entityStream
 
 - 
 
- 
Constructor Detail
- 
ClientInvocation
public ClientInvocation(ResteasyClient client, URI uri, ClientRequestHeaders headers, ClientConfiguration parent)
 
- 
ClientInvocation
protected ClientInvocation(ClientInvocation clientInvocation)
 
 - 
 
- 
Method Detail
- 
extractResult
public static <T> T extractResult(javax.ws.rs.core.GenericType<T> responseType, javax.ws.rs.core.Response response, Annotation[] annotations)Extracts result from response throwing an appropriate exception if not a successful response.- Type Parameters:
 T- type- Parameters:
 responseType- generic typeresponse- response entityannotations- array of annotations- Returns:
 - extracted result of type T
 
 
- 
handleErrorStatus
public static <T> T handleErrorStatus(javax.ws.rs.core.Response response)
Throw an exception. Expecting a status of 400 or greater.- Type Parameters:
 T- type- Parameters:
 response- response entity- Returns:
 - unreachable
 
 
- 
getClientConfiguration
public ClientConfiguration getClientConfiguration()
 
- 
getClient
public ResteasyClient getClient()
 
- 
getDelegatingOutputStream
public DelegatingOutputStream getDelegatingOutputStream()
 
- 
setDelegatingOutputStream
public void setDelegatingOutputStream(DelegatingOutputStream delegatingOutputStream)
 
- 
getEntityStream
public OutputStream getEntityStream()
 
- 
setEntityStream
public void setEntityStream(OutputStream entityStream)
 
- 
getUri
public URI getUri()
 
- 
setUri
public void setUri(URI uri)
 
- 
getEntityAnnotations
public Annotation[] getEntityAnnotations()
 
- 
setEntityAnnotations
public void setEntityAnnotations(Annotation[] entityAnnotations)
 
- 
getMethod
public String getMethod()
 
- 
setMethod
public void setMethod(String method)
 
- 
setHeaders
public void setHeaders(ClientRequestHeaders headers)
 
- 
getEntity
public Object getEntity()
 
- 
getEntityGenericType
public Type getEntityGenericType()
 
- 
getEntityClass
public Class<?> getEntityClass()
 
- 
getHeaders
public ClientRequestHeaders getHeaders()
 
- 
setEntity
public void setEntity(javax.ws.rs.client.Entity<?> entity)
 
- 
setEntityObject
public void setEntityObject(Object ent)
 
- 
writeRequestBody
public void writeRequestBody(OutputStream outputStream) throws IOException
- Throws:
 IOException
 
- 
getWriterInterceptors
public javax.ws.rs.ext.WriterInterceptor[] getWriterInterceptors()
 
- 
getRequestFilters
public javax.ws.rs.client.ClientRequestFilter[] getRequestFilters()
 
- 
getResponseFilters
public javax.ws.rs.client.ClientResponseFilter[] getResponseFilters()
 
- 
getConfiguration
public javax.ws.rs.core.Configuration getConfiguration()
 
- 
isChunked
public boolean isChunked()
 
- 
setChunked
public void setChunked(boolean chunked)
 
- 
invoke
public ClientResponse invoke()
- Specified by:
 invokein interfacejavax.ws.rs.client.Invocation
 
- 
invoke
public <T> T invoke(Class<T> responseType)
- Specified by:
 invokein interfacejavax.ws.rs.client.Invocation
 
- 
invoke
public <T> T invoke(javax.ws.rs.core.GenericType<T> responseType)
- Specified by:
 invokein interfacejavax.ws.rs.client.Invocation
 
- 
submit
public Future<javax.ws.rs.core.Response> submit()
- Specified by:
 submitin interfacejavax.ws.rs.client.Invocation
 
- 
submit
public <T> Future<T> submit(Class<T> responseType)
- Specified by:
 submitin interfacejavax.ws.rs.client.Invocation
 
- 
submit
public <T> Future<T> submit(javax.ws.rs.core.GenericType<T> responseType)
- Specified by:
 submitin interfacejavax.ws.rs.client.Invocation
 
- 
submit
public <T> Future<T> submit(javax.ws.rs.client.InvocationCallback<T> callback)
- Specified by:
 submitin interfacejavax.ws.rs.client.Invocation
 
- 
asyncInvocationExecutor
public ExecutorService asyncInvocationExecutor()
 
- 
getGenericTypeExtractor
protected static <T> AsyncClientHttpEngine.ResultExtractor<T> getGenericTypeExtractor(javax.ws.rs.core.GenericType<T> responseType)
 
- 
getResponseTypeExtractor
protected static <T> AsyncClientHttpEngine.ResultExtractor<T> getResponseTypeExtractor(Class<T> responseType)
 
- 
submitCF
public CompletableFuture<javax.ws.rs.core.Response> submitCF()
 
- 
submitCF
public <T> CompletableFuture<T> submitCF(Class<T> responseType)
 
- 
submitCF
public <T> CompletableFuture<T> submitCF(javax.ws.rs.core.GenericType<T> responseType)
 
- 
reactive
public Optional<org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.ReactiveInvocation> reactive()
If the client's HTTP engine implementsReactiveClientHttpEnginethen you can access the latter'sPublishervia this method. 
- 
property
public javax.ws.rs.client.Invocation property(String name, Object value)
- Specified by:
 propertyin interfacejavax.ws.rs.client.Invocation
 
- 
getClientInvoker
public ClientInvoker getClientInvoker()
 
- 
setClientInvoker
public void setClientInvoker(ClientInvoker clientInvoker)
 
- 
filterRequest
protected ClientResponse filterRequest(ClientRequestContextImpl requestContext)
 
- 
filterResponse
protected ClientResponse filterResponse(ClientRequestContextImpl requestContext, ClientResponse response)
 
- 
getTracingLogger
public RESTEasyTracingLogger getTracingLogger()
 
- 
setActualTarget
public void setActualTarget(javax.ws.rs.client.WebTarget target)
 
- 
getActualTarget
public javax.ws.rs.client.WebTarget getActualTarget()
 
 - 
 
 -