Class ClientInvocation
- java.lang.Object
-
- org.jboss.resteasy.client.jaxrs.internal.ClientInvocation
-
- All Implemented Interfaces:
javax.ws.rs.client.Invocation
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.WebTarget
actualTarget
protected boolean
chunked
protected ResteasyClient
client
protected ClientInvoker
clientInvoker
protected ClientConfiguration
configuration
protected DelegatingOutputStream
delegatingOutputStream
protected Object
entity
protected Annotation[]
entityAnnotations
protected Class<?>
entityClass
protected Type
entityGenericType
protected OutputStream
entityStream
protected ClientRequestHeaders
headers
protected String
method
protected RESTEasyTracingLogger
tracingLogger
protected URI
uri
-
Constructor Summary
Constructors Modifier Constructor Description protected
ClientInvocation(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 ExecutorService
asyncInvocationExecutor()
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.protected ClientResponse
filterRequest(ClientRequestContextImpl requestContext)
protected ClientResponse
filterResponse(ClientRequestContextImpl requestContext, ClientResponse response)
javax.ws.rs.client.WebTarget
getActualTarget()
ResteasyClient
getClient()
ClientConfiguration
getClientConfiguration()
ClientInvoker
getClientInvoker()
javax.ws.rs.core.Configuration
getConfiguration()
DelegatingOutputStream
getDelegatingOutputStream()
Object
getEntity()
Annotation[]
getEntityAnnotations()
Class<?>
getEntityClass()
Type
getEntityGenericType()
OutputStream
getEntityStream()
protected static <T> AsyncClientHttpEngine.ResultExtractor<T>
getGenericTypeExtractor(javax.ws.rs.core.GenericType<T> responseType)
ClientRequestHeaders
getHeaders()
String
getMethod()
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)
RESTEasyTracingLogger
getTracingLogger()
URI
getUri()
javax.ws.rs.ext.WriterInterceptor[]
getWriterInterceptors()
static <T> T
handleErrorStatus(javax.ws.rs.core.Response response)
Throw an exception.ClientResponse
invoke()
<T> T
invoke(Class<T> responseType)
<T> T
invoke(javax.ws.rs.core.GenericType<T> responseType)
boolean
isChunked()
javax.ws.rs.client.Invocation
property(String name, Object value)
Optional<org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.ReactiveInvocation>
reactive()
If the client's HTTP engine implementsReactiveClientHttpEngine
then you can access the latter'sPublisher
via this method.void
setActualTarget(javax.ws.rs.client.WebTarget target)
void
setChunked(boolean chunked)
void
setClientInvoker(ClientInvoker clientInvoker)
void
setDelegatingOutputStream(DelegatingOutputStream delegatingOutputStream)
void
setEntity(javax.ws.rs.client.Entity<?> entity)
void
setEntityAnnotations(Annotation[] entityAnnotations)
void
setEntityObject(Object ent)
void
setEntityStream(OutputStream entityStream)
void
setHeaders(ClientRequestHeaders headers)
void
setMethod(String method)
void
setUri(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)
void
writeRequestBody(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:
invoke
in interfacejavax.ws.rs.client.Invocation
-
invoke
public <T> T invoke(Class<T> responseType)
- Specified by:
invoke
in interfacejavax.ws.rs.client.Invocation
-
invoke
public <T> T invoke(javax.ws.rs.core.GenericType<T> responseType)
- Specified by:
invoke
in interfacejavax.ws.rs.client.Invocation
-
submit
public Future<javax.ws.rs.core.Response> submit()
- Specified by:
submit
in interfacejavax.ws.rs.client.Invocation
-
submit
public <T> Future<T> submit(Class<T> responseType)
- Specified by:
submit
in interfacejavax.ws.rs.client.Invocation
-
submit
public <T> Future<T> submit(javax.ws.rs.core.GenericType<T> responseType)
- Specified by:
submit
in interfacejavax.ws.rs.client.Invocation
-
submit
public <T> Future<T> submit(javax.ws.rs.client.InvocationCallback<T> callback)
- Specified by:
submit
in 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 implementsReactiveClientHttpEngine
then you can access the latter'sPublisher
via this method.
-
property
public javax.ws.rs.client.Invocation property(String name, Object value)
- Specified by:
property
in 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()
-
-