|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ClientResponse
Represents an http response that was received after invoking any one of the
invocation methods on a Resource
. An instance of a ClientResponse is
created by the ConnectionHandler
at the end of the handler chain, and
is returned from every handler on the chain.
Method Summary | ||
---|---|---|
|
getEntity(java.lang.Class<T> cls)
Get the response entity. |
|
|
getEntity(EntityType<T> entityType)
Get the response entity. |
|
java.lang.String |
getMessage()
Get the response message |
|
int |
getStatusCode()
Get the response status code |
|
void |
setEntity(java.lang.Object entity)
Set the response entity |
|
void |
setMessage(java.lang.String message)
Set the response message |
|
void |
setStatusCode(int code)
Set the response status code |
Methods inherited from interface org.apache.wink.client.internal.BaseRequestResponse |
---|
getAttribute, getAttributes, getHeaders, setAttribute |
Method Detail |
---|
int getStatusCode()
void setStatusCode(int code)
code
- status code to setjava.lang.String getMessage()
void setMessage(java.lang.String message)
message
- response message to set<T> T getEntity(java.lang.Class<T> cls)
If the requested type to return is InputStream, then the input stream of the response is returned, and the entity is not read using the providers. The returned input stream is the adapted input stream as created by the InputStream adapters. If the InputStream is read directly, then it will not be possible to receive the entity as any other type other than InputStream.
If the requested type to return is anything other than InputStream, then the entity is read using the appropriate provider before returning it. Subsequent calls to getEntity will return the same instance of the entity.
T
- type of the response entity to getcls
- class of the response entity to get
<T> T getEntity(EntityType<T> entityType)
If the requested type to return is InputStream, then the input stream of the response is returned, and the entity is not read using the providers. The returned input stream is the adapted input stream as created by the InputStream adapters. If the InputStream is read directly, then it will not be possible to receive the entity as any other type other than InputStream.
If the requested type to return is anything other than InputStream, then the entity is read using the appropriate provider before returning it. Subsequent calls to getEntity will return the same instance of the entity.
T
- type of the response entity to getentityType
- an instance of EntityType
specifying the type
of the entity
void setEntity(java.lang.Object entity)
entity
- response entity to set
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |