|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.ws.rs.core.Response
org.jboss.resteasy.client.ClientResponse<T>
org.jboss.resteasy.client.core.BaseClientResponse<T>
public class BaseClientResponse<T>
Nested Class Summary | |
---|---|
static interface |
BaseClientResponse.BaseClientResponseStreamFactory
|
Nested classes/interfaces inherited from class javax.ws.rs.core.Response |
---|
Response.ResponseBuilder, Response.Status, Response.StatusType |
Field Summary | |
---|---|
protected String |
alternateMediaType
|
protected Annotation[] |
annotations
|
protected String |
attributeExceptionsTo
|
protected Map<String,Object> |
attributes
|
protected Exception |
exception
|
protected ClientExecutor |
executor
|
protected Type |
genericReturnType
|
protected MultivaluedMap<String,String> |
headers
|
protected LinkHeader |
linkHeader
|
protected Link |
location
|
protected MessageBodyReaderInterceptor[] |
messageBodyReaderInterceptors
|
protected ResteasyProviderFactory |
providerFactory
|
protected Class<?> |
returnType
|
protected int |
status
|
protected BaseClientResponse.BaseClientResponseStreamFactory |
streamFactory
|
protected Object |
unmarshaledEntity
|
protected boolean |
wasReleased
|
Constructor Summary | |
---|---|
BaseClientResponse(BaseClientResponse.BaseClientResponseStreamFactory streamFactory)
|
|
BaseClientResponse(BaseClientResponse.BaseClientResponseStreamFactory streamFactory,
ClientExecutor executor)
|
Method Summary | ||
---|---|---|
void |
checkFailureStatus()
|
|
static ClientResponse |
copyFromError(ClientResponse copy)
Store entity within a byte array input stream because we want to release the connection if a ClientResponseFailure is thrown. |
|
ClientResponseFailure |
createResponseFailure(String message)
|
|
ClientResponseFailure |
createResponseFailure(String message,
Exception e)
|
|
protected void |
finalize()
|
|
Annotation[] |
getAnnotations()
|
|
String |
getAttributeExceptionsTo()
|
|
Map<String,Object> |
getAttributes()
Used to pass information to and between interceptors. |
|
T |
getEntity()
Unmarshal the target entity from the response OutputStream. |
|
|
getEntity(Class<T2> type)
Extract the response body with the provided type information This method actually does the reading on the OutputStream. |
|
|
getEntity(Class<T2> type,
Type genericType)
Extract the response body with the provided type information This method actually does the reading on the OutputStream. |
|
|
getEntity(Class<T2> type,
Type genericType,
Annotation[] anns)
|
|
|
getEntity(GenericType<T2> genericType)
Extract the response body with the provided type information. |
|
|
getEntity(GenericType<T2> genericType,
Annotation[] ann)
|
|
Exception |
getException()
|
|
Link |
getHeaderAsLink(String headerName)
Header is assumed to be a URL, a Link object is created from it if it exists. |
|
MultivaluedMap<String,String> |
getHeaders()
This method returns the same exact map as Response.getMetadata() except as a map of strings rather than objects |
|
LinkHeader |
getLinkHeader()
Get the link headers of the response. |
|
Link |
getLocation()
Get the Location header as a Link so you can easily execute on it. |
|
protected MediaType |
getMediaType()
|
|
MultivaluedMap<String,Object> |
getMetadata()
Get metadata associated with the response as a map. |
|
String |
getResponseHeader(String headerKey)
|
|
Response.Status |
getResponseStatus()
|
|
Class<?> |
getReturnType()
|
|
int |
getStatus()
Get the status code associated with the response. |
|
BaseClientResponse.BaseClientResponseStreamFactory |
getStreamFactory()
|
|
protected
|
readFrom(Class<T2> type,
Type genericType,
MediaType media,
Annotation[] annotations)
|
|
void |
releaseConnection()
|
|
void |
resetStream()
Attempts to reset the InputStream of the response. |
|
void |
setAlternateMediaType(String alternateMediaType)
|
|
void |
setAnnotations(Annotation[] annotations)
|
|
void |
setAttributeExceptionsTo(String attributeExceptionsTo)
|
|
void |
setAttributes(Map<String,Object> attributes)
|
|
void |
setException(Exception exception)
|
|
void |
setGenericReturnType(Type genericReturnType)
|
|
void |
setHeaders(MultivaluedMap<String,String> headers)
|
|
void |
setMessageBodyReaderInterceptors(MessageBodyReaderInterceptor[] messageBodyReaderInterceptors)
|
|
void |
setProviderFactory(ResteasyProviderFactory providerFactory)
|
|
void |
setReturnType(Class<T> returnType)
|
|
void |
setStatus(int status)
|
|
void |
setStreamFactory(BaseClientResponse.BaseClientResponseStreamFactory streamFactory)
|
|
boolean |
wasReleased()
|
Methods inherited from class javax.ws.rs.core.Response |
---|
created, fromResponse, noContent, notAcceptable, notModified, notModified, notModified, ok, ok, ok, ok, ok, seeOther, serverError, status, status, status, temporaryRedirect |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ResteasyProviderFactory providerFactory
protected String attributeExceptionsTo
protected MultivaluedMap<String,String> headers
protected String alternateMediaType
protected Class<?> returnType
protected Type genericReturnType
protected Annotation[] annotations
protected int status
protected boolean wasReleased
protected Object unmarshaledEntity
protected MessageBodyReaderInterceptor[] messageBodyReaderInterceptors
protected Exception exception
protected BaseClientResponse.BaseClientResponseStreamFactory streamFactory
protected LinkHeader linkHeader
protected Link location
protected ClientExecutor executor
protected Map<String,Object> attributes
Constructor Detail |
---|
public BaseClientResponse(BaseClientResponse.BaseClientResponseStreamFactory streamFactory, ClientExecutor executor)
public BaseClientResponse(BaseClientResponse.BaseClientResponseStreamFactory streamFactory)
Method Detail |
---|
public static ClientResponse copyFromError(ClientResponse copy)
copy
-
public Map<String,Object> getAttributes()
ClientResponse
getAttributes
in class ClientResponse<T>
public void setAttributes(Map<String,Object> attributes)
public void setMessageBodyReaderInterceptors(MessageBodyReaderInterceptor[] messageBodyReaderInterceptors)
public void setStatus(int status)
public void setHeaders(MultivaluedMap<String,String> headers)
public void setProviderFactory(ResteasyProviderFactory providerFactory)
public void setReturnType(Class<T> returnType)
public Class<?> getReturnType()
public void setGenericReturnType(Type genericReturnType)
public void setAnnotations(Annotation[] annotations)
public String getAttributeExceptionsTo()
public void setAttributeExceptionsTo(String attributeExceptionsTo)
public Exception getException()
public void setException(Exception exception)
public Annotation[] getAnnotations()
public String getResponseHeader(String headerKey)
public LinkHeader getLinkHeader()
ClientResponse
getLinkHeader
in class ClientResponse<T>
public Link getLocation()
ClientResponse
getLocation
in class ClientResponse<T>
public Link getHeaderAsLink(String headerName)
ClientResponse
getHeaderAsLink
in class ClientResponse<T>
public void setAlternateMediaType(String alternateMediaType)
public BaseClientResponse.BaseClientResponseStreamFactory getStreamFactory()
public void setStreamFactory(BaseClientResponse.BaseClientResponseStreamFactory streamFactory)
public void resetStream()
ClientResponse
resetStream
in class ClientResponse<T>
public T getEntity()
ClientResponse
getEntity
in class ClientResponse<T>
MessageBodyWriter
public <T2> T2 getEntity(Class<T2> type)
ClientResponse
getEntity
in class ClientResponse<T>
public <T2> T2 getEntity(Class<T2> type, Type genericType)
ClientResponse
getEntity
in class ClientResponse<T>
public <T2> T2 getEntity(Class<T2> type, Type genericType, Annotation[] anns)
getEntity
in class ClientResponse<T>
protected MediaType getMediaType()
protected <T2> Object readFrom(Class<T2> type, Type genericType, MediaType media, Annotation[] annotations)
public <T2> T2 getEntity(GenericType<T2> genericType)
ClientResponse
Listlist = response.getEntity(new GenericType () {}); This method actually does the reading on the OutputStream. It will only do the read once. Afterwards, it will cache the result and return the cached result.
- Specified by:
getEntity
in classClientResponse<T>
- Returns:
public <T2> T2 getEntity(GenericType<T2> genericType, Annotation[] ann)
getEntity
in class ClientResponse<T>
public MultivaluedMap<String,String> getHeaders()
ClientResponse
getHeaders
in class ClientResponse<T>
public MultivaluedMap<String,Object> getMetadata()
Response
RuntimeDelegate.HeaderDelegate
if one is available via
RuntimeDelegate.createHeaderDelegate(java.lang.Class)
for the class of the value or using the values toString
method if a
header delegate is not available.
getMetadata
in class Response
public int getStatus()
Response
getStatus
in class Response
public void checkFailureStatus()
public ClientResponseFailure createResponseFailure(String message)
public ClientResponseFailure createResponseFailure(String message, Exception e)
public Response.Status getResponseStatus()
getResponseStatus
in class ClientResponse<T>
public boolean wasReleased()
public final void releaseConnection()
releaseConnection
in class ClientResponse<T>
protected final void finalize() throws Throwable
finalize
in class Object
Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |