|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HttpResponseContext
Encapsulates the response to a HTTP request.
The default state of a response is a HTTP response with a status code of 204 (OK) with no HTTP response headers and no entity.
Method Summary | |
---|---|
java.lang.Object |
getEntity()
Get the entity of the response |
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> |
getHttpHeaders()
Get the HTTP response headers. |
java.io.OutputStream |
getOutputStream()
Get an OutputStream to which an entity may be written. |
int |
getStatus()
Get the status of the response. |
boolean |
isCommitted()
Ascertain if a response has been committed to an underlying container. |
boolean |
isResponseSet()
Check if the response has been set using the setReponse methods. |
void |
setEntity(java.lang.Object entity)
Set the entity of the response |
void |
setResponse(javax.ws.rs.core.Response response)
Set the response state from a Response instance. |
void |
setResponse(javax.ws.rs.core.Response response,
javax.ws.rs.core.MediaType contentType)
Set the response state from a Response instance. |
void |
setStatus(int status)
Set the status of the response. |
Method Detail |
---|
void setResponse(javax.ws.rs.core.Response response)
If an entity is set but there is no MIME media type declared for the Content-Type response header then the MIME media type will be set to "application/octet-stream".
response
- the response.void setResponse(javax.ws.rs.core.Response response, javax.ws.rs.core.MediaType contentType)
response
- the response.contentType
- the MIME media type to use fot the Content-Type response
header if the header is not set by the response. If null then
"application/octet-stream" will be used.boolean isResponseSet()
int getStatus()
void setStatus(int status)
java.lang.Object getEntity()
void setEntity(java.lang.Object entity)
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> getHttpHeaders()
setHttpResponse
can change the HTTP response
headers and may overwrite headers set previously.
java.io.OutputStream getOutputStream() throws java.io.IOException
The first byte written will cause the status code and headers (if any) to be committed to the underlying container.
java.io.IOException
- if an IO error occursboolean isCommitted()
A response is committed if the status code, headers (if any) have been committed to the underlying container.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |