|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HttpResponseContext
An abstraction of a HTTP response.
The default state is a HTTP response with a status code of 204 (No Content) with no headers and entity.
Method Summary | |
---|---|
java.lang.annotation.Annotation[] |
getAnnotations()
Get the annotations associated with the response entity (if any). |
java.lang.Object |
getEntity()
|
java.lang.reflect.Type |
getEntityType()
|
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. |
javax.ws.rs.core.Response |
getResponse()
Get the response that was set. |
int |
getStatus()
|
boolean |
isCommitted()
Ascertain if a response has been committed to the container. |
boolean |
isResponseSet()
Check if the response has been set using the setReponse methods. |
void |
setAnnotations(java.lang.annotation.Annotation[] annotations)
Set the annotations associated with the response entity (if any). |
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 |
setStatus(int status)
Set the status of the response. |
Method Detail |
---|
javax.ws.rs.core.Response getResponse()
void setResponse(javax.ws.rs.core.Response response)
response
- the response.boolean isResponseSet()
int getStatus()
void setStatus(int status)
status
- the status.java.lang.Object getEntity()
java.lang.reflect.Type getEntityType()
void setEntity(java.lang.Object entity)
entity
- the entity. If the entity is an instance of
GenericEntity
then the entity and entity type are
set from the entity and type of that GenericEntity
.java.lang.annotation.Annotation[] getAnnotations()
void setAnnotations(java.lang.annotation.Annotation[] annotations)
annotations
- the annotations.javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> getHttpHeaders()
setResponse(javax.ws.rs.core.Response)
will replace any headers previously set.
java.io.OutputStream getOutputStream() throws java.io.IOException
OutputStream
to which an entity may be written.
The first byte written will result in the writing of thethe status code and headers.
java.io.IOException
- if an IO error occursboolean isCommitted()
A response is committed if the status code, headers have been written to the container.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |