public class Response extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Response.Status
HTTP Status code enumerations.
|
Constructor and Description |
---|
Response()
for serialization
|
Response(Response.Status status) |
Response(Response.Status status,
java.lang.String message) |
Response(ResponseData data) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMessage() |
java.lang.String |
getMethod() |
ResponseData |
getResponseData() |
java.lang.String |
getService() |
Response.Status |
getStatus() |
static void |
setDefaultAuthenticationHeader(javax.servlet.http.HttpServletResponse response)
Set the default HTTP authentication header in the response.
|
void |
setMessage(java.lang.String message)
Set an optional message to be shown with the response
|
void |
setMethod(java.lang.String method) |
void |
setResponseData(ResponseData data) |
void |
setService(java.lang.String service) |
void |
setStatus(Response.Status status) |
void |
writeTo(javax.servlet.http.HttpServletResponse response)
Write this response to the given response object.
|
public Response()
public Response(Response.Status status)
status
- public Response(Response.Status status, java.lang.String message)
status
- message
- public Response(ResponseData data)
data
- public void writeTo(javax.servlet.http.HttpServletResponse response)
Response.Status.UNAUTHORIZED
.response
- setDefaultAuthenticationHeader(HttpServletResponse)
,
setStatus(core.tut.pori.http.Response.Status)
public static void setDefaultAuthenticationHeader(javax.servlet.http.HttpServletResponse response)
response
- public Response.Status getStatus()
public void setStatus(Response.Status status)
status
- the status to setpublic java.lang.String getMethod()
public void setMethod(java.lang.String method)
method
- the method to setpublic java.lang.String getService()
public void setService(java.lang.String service)
service
- the service to setpublic ResponseData getResponseData()
public void setResponseData(ResponseData data)
data
- the data to setpublic java.lang.String getMessage()
public void setMessage(java.lang.String message)
message
- Copyright © 2015 Tampere University of Technology, Pori Department.