Class ClientInvocation
- java.lang.Object
-
- org.jboss.resteasy.client.jaxrs.internal.ClientInvocation
-
- All Implemented Interfaces:
javax.ws.rs.client.Invocation
public class ClientInvocation extends java.lang.Object implements javax.ws.rs.client.Invocation- Version:
- $Revision: 1 $
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanchunkedprotected ResteasyClientclientprotected ClientConfigurationconfigurationprotected DelegatingOutputStreamdelegatingOutputStreamprotected java.lang.Objectentityprotected java.lang.annotation.Annotation[]entityAnnotationsprotected java.lang.Class<?>entityClassprotected java.lang.reflect.TypeentityGenericTypeprotected java.io.OutputStreamentityStreamprotected ClientRequestHeadersheadersprotected java.lang.Stringmethodprotected java.net.URIuri
-
Constructor Summary
Constructors Constructor Description ClientInvocation(ResteasyClient client, java.net.URI uri, ClientRequestHeaders headers, ClientConfiguration parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> TextractResult(javax.ws.rs.core.GenericType<T> responseType, javax.ws.rs.core.Response response, java.lang.annotation.Annotation[] annotations)Extracts result from response throwing an appropriate exception if not a successful response.ResteasyClientgetClient()ClientConfigurationgetClientConfiguration()javax.ws.rs.core.ConfigurationgetConfiguration()DelegatingOutputStreamgetDelegatingOutputStream()java.lang.ObjectgetEntity()java.lang.annotation.Annotation[]getEntityAnnotations()java.lang.Class<?>getEntityClass()java.lang.reflect.TypegetEntityGenericType()java.io.OutputStreamgetEntityStream()ClientRequestHeadersgetHeaders()java.lang.StringgetMethod()java.util.Map<java.lang.String,java.lang.Object>getMutableProperties()javax.ws.rs.client.ClientRequestFilter[]getRequestFilters()javax.ws.rs.client.ClientResponseFilter[]getResponseFilters()java.net.URIgetUri()javax.ws.rs.ext.WriterInterceptor[]getWriterInterceptors()static <T> ThandleErrorStatus(javax.ws.rs.core.Response response)Throw an exception.javax.ws.rs.core.Responseinvoke()<T> Tinvoke(java.lang.Class<T> responseType)<T> Tinvoke(javax.ws.rs.core.GenericType<T> responseType)booleanisChunked()javax.ws.rs.client.Invocationproperty(java.lang.String name, java.lang.Object value)voidsetChunked(boolean chunked)voidsetDelegatingOutputStream(DelegatingOutputStream delegatingOutputStream)voidsetEntity(javax.ws.rs.client.Entity<?> entity)voidsetEntityAnnotations(java.lang.annotation.Annotation[] entityAnnotations)voidsetEntityObject(java.lang.Object ent)voidsetEntityStream(java.io.OutputStream entityStream)voidsetHeaders(ClientRequestHeaders headers)voidsetMethod(java.lang.String method)voidsetUri(java.net.URI uri)java.util.concurrent.Future<javax.ws.rs.core.Response>submit()<T> java.util.concurrent.Future<T>submit(java.lang.Class<T> responseType)<T> java.util.concurrent.Future<T>submit(javax.ws.rs.client.InvocationCallback<T> callback)<T> java.util.concurrent.Future<T>submit(javax.ws.rs.core.GenericType<T> responseType)voidwriteRequestBody(java.io.OutputStream outputStream)
-
-
-
Field Detail
-
client
protected ResteasyClient client
-
headers
protected ClientRequestHeaders headers
-
method
protected java.lang.String method
-
entity
protected java.lang.Object entity
-
entityGenericType
protected java.lang.reflect.Type entityGenericType
-
entityClass
protected java.lang.Class<?> entityClass
-
entityAnnotations
protected java.lang.annotation.Annotation[] entityAnnotations
-
configuration
protected ClientConfiguration configuration
-
uri
protected java.net.URI uri
-
chunked
protected boolean chunked
-
delegatingOutputStream
protected DelegatingOutputStream delegatingOutputStream
-
entityStream
protected java.io.OutputStream entityStream
-
-
Constructor Detail
-
ClientInvocation
public ClientInvocation(ResteasyClient client, java.net.URI uri, ClientRequestHeaders headers, ClientConfiguration parent)
-
-
Method Detail
-
extractResult
public static <T> T extractResult(javax.ws.rs.core.GenericType<T> responseType, javax.ws.rs.core.Response response, java.lang.annotation.Annotation[] annotations)Extracts result from response throwing an appropriate exception if not a successful response.- Type Parameters:
T-- Parameters:
responseType-response-annotations-- Returns:
-
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-- Parameters:
response-- Returns:
-
getClientConfiguration
public ClientConfiguration getClientConfiguration()
-
getClient
public ResteasyClient getClient()
-
getDelegatingOutputStream
public DelegatingOutputStream getDelegatingOutputStream()
-
setDelegatingOutputStream
public void setDelegatingOutputStream(DelegatingOutputStream delegatingOutputStream)
-
getEntityStream
public java.io.OutputStream getEntityStream()
-
setEntityStream
public void setEntityStream(java.io.OutputStream entityStream)
-
getUri
public java.net.URI getUri()
-
setUri
public void setUri(java.net.URI uri)
-
getEntityAnnotations
public java.lang.annotation.Annotation[] getEntityAnnotations()
-
setEntityAnnotations
public void setEntityAnnotations(java.lang.annotation.Annotation[] entityAnnotations)
-
getMethod
public java.lang.String getMethod()
-
setMethod
public void setMethod(java.lang.String method)
-
setHeaders
public void setHeaders(ClientRequestHeaders headers)
-
getMutableProperties
public java.util.Map<java.lang.String,java.lang.Object> getMutableProperties()
-
getEntity
public java.lang.Object getEntity()
-
getEntityGenericType
public java.lang.reflect.Type getEntityGenericType()
-
getEntityClass
public java.lang.Class<?> getEntityClass()
-
getHeaders
public ClientRequestHeaders getHeaders()
-
setEntity
public void setEntity(javax.ws.rs.client.Entity<?> entity)
-
setEntityObject
public void setEntityObject(java.lang.Object ent)
-
writeRequestBody
public void writeRequestBody(java.io.OutputStream outputStream) throws java.io.IOException- Throws:
java.io.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 javax.ws.rs.core.Response invoke()
- Specified by:
invokein interfacejavax.ws.rs.client.Invocation
-
invoke
public <T> T invoke(java.lang.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 java.util.concurrent.Future<javax.ws.rs.core.Response> submit()
- Specified by:
submitin interfacejavax.ws.rs.client.Invocation
-
submit
public <T> java.util.concurrent.Future<T> submit(java.lang.Class<T> responseType)
- Specified by:
submitin interfacejavax.ws.rs.client.Invocation
-
submit
public <T> java.util.concurrent.Future<T> submit(javax.ws.rs.core.GenericType<T> responseType)
- Specified by:
submitin interfacejavax.ws.rs.client.Invocation
-
submit
public <T> java.util.concurrent.Future<T> submit(javax.ws.rs.client.InvocationCallback<T> callback)
- Specified by:
submitin interfacejavax.ws.rs.client.Invocation
-
property
public javax.ws.rs.client.Invocation property(java.lang.String name, java.lang.Object value)- Specified by:
propertyin interfacejavax.ws.rs.client.Invocation
-
-