|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.ws.rest.api.response.HttpResponse
public class HttpResponse
Base class for HTTP responses. Subclasses offer specializations for various common response types.
| Constructor Summary | |
|---|---|
HttpResponse()
Create a new instance, the HTTP status code defaults to 204. |
|
HttpResponse(int status)
Create a new instance with the specified status code. |
|
HttpResponse(int status,
Representation<?> representation)
Create a new instance |
|
HttpResponse(Representation<?> representation)
Create a new instance, the HTTP status code defaults to 200. |
|
| Method Summary | |
|---|---|
void |
addResponseHeaders(HttpContext context)
Add the HTTP headers associated with any representation and cache control. |
CacheControl |
getCacheControl()
|
void |
getCacheControl(CacheControl cacheControl)
Get the cache control information that will be sent with the response |
Representation<?> |
getRepresentation()
Get the representation associated with the response. |
int |
getStatus()
Get the response status code. |
void |
setRepresentation(Representation<?> representation)
Set the representation associated with the response. |
void |
setStatus(int status)
Set the response status code. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpResponse()
public HttpResponse(Representation<?> representation)
representation - the representation that will form the entity body
of the HTTP responsepublic HttpResponse(int status)
status - the HTTP status code
public HttpResponse(int status,
Representation<?> representation)
status - the HTTP status coderepresentation - the representation that will form the entity body
of the HTTP response| Method Detail |
|---|
public Representation<?> getRepresentation()
public void setRepresentation(Representation<?> representation)
representation - the representation
public void setStatus(int status)
throws java.lang.IllegalArgumentException
status - the status code, see RFC 2616.
java.lang.IllegalArgumentException - if the status code is outside the permitted rangepublic int getStatus()
public void getCacheControl(CacheControl cacheControl)
public CacheControl getCacheControl()
public void addResponseHeaders(HttpContext context)
context - the current HTTP context
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||