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 boolean
chunked
protected ResteasyClient
client
protected ClientConfiguration
configuration
protected DelegatingOutputStream
delegatingOutputStream
protected java.lang.Object
entity
protected java.lang.annotation.Annotation[]
entityAnnotations
protected java.lang.Class<?>
entityClass
protected java.lang.reflect.Type
entityGenericType
protected java.io.OutputStream
entityStream
protected ClientRequestHeaders
headers
protected java.lang.String
method
protected java.net.URI
uri
-
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> 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.ResteasyClient
getClient()
ClientConfiguration
getClientConfiguration()
javax.ws.rs.core.Configuration
getConfiguration()
DelegatingOutputStream
getDelegatingOutputStream()
java.lang.Object
getEntity()
java.lang.annotation.Annotation[]
getEntityAnnotations()
java.lang.Class<?>
getEntityClass()
java.lang.reflect.Type
getEntityGenericType()
java.io.OutputStream
getEntityStream()
ClientRequestHeaders
getHeaders()
java.lang.String
getMethod()
java.util.Map<java.lang.String,java.lang.Object>
getMutableProperties()
javax.ws.rs.client.ClientRequestFilter[]
getRequestFilters()
javax.ws.rs.client.ClientResponseFilter[]
getResponseFilters()
java.net.URI
getUri()
javax.ws.rs.ext.WriterInterceptor[]
getWriterInterceptors()
static <T> T
handleErrorStatus(javax.ws.rs.core.Response response)
Throw an exception.javax.ws.rs.core.Response
invoke()
<T> T
invoke(java.lang.Class<T> responseType)
<T> T
invoke(javax.ws.rs.core.GenericType<T> responseType)
boolean
isChunked()
javax.ws.rs.client.Invocation
property(java.lang.String name, java.lang.Object value)
void
setChunked(boolean chunked)
void
setDelegatingOutputStream(DelegatingOutputStream delegatingOutputStream)
void
setEntity(javax.ws.rs.client.Entity<?> entity)
void
setEntityAnnotations(java.lang.annotation.Annotation[] entityAnnotations)
void
setEntityObject(java.lang.Object ent)
void
setEntityStream(java.io.OutputStream entityStream)
void
setHeaders(ClientRequestHeaders headers)
void
setMethod(java.lang.String method)
void
setUri(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)
void
writeRequestBody(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:
invoke
in interfacejavax.ws.rs.client.Invocation
-
invoke
public <T> T invoke(java.lang.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 java.util.concurrent.Future<javax.ws.rs.core.Response> submit()
- Specified by:
submit
in interfacejavax.ws.rs.client.Invocation
-
submit
public <T> java.util.concurrent.Future<T> submit(java.lang.Class<T> responseType)
- Specified by:
submit
in interfacejavax.ws.rs.client.Invocation
-
submit
public <T> java.util.concurrent.Future<T> submit(javax.ws.rs.core.GenericType<T> responseType)
- Specified by:
submit
in interfacejavax.ws.rs.client.Invocation
-
submit
public <T> java.util.concurrent.Future<T> submit(javax.ws.rs.client.InvocationCallback<T> callback)
- Specified by:
submit
in interfacejavax.ws.rs.client.Invocation
-
property
public javax.ws.rs.client.Invocation property(java.lang.String name, java.lang.Object value)
- Specified by:
property
in interfacejavax.ws.rs.client.Invocation
-
-