Package dk.netarkivet.viewerproxy
Interface Response
-
- All Known Implementing Classes:
WebProxy.HttpResponse
public interface Response
The Response interface is a very minimal version of a HTTP response. We use this to decouple the main parts of the proxy server from a given implementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addHeaderField(String name, String value)
Add an HTTP header to the response.OutputStream
getOutputStream()
Return outputstream response should be written to.int
getStatus()
Get the status code from this response.void
setStatus(int statusCode)
Set status code.void
setStatus(int statusCode, String reason)
Set status code.
-
-
-
Method Detail
-
getOutputStream
OutputStream getOutputStream()
Return outputstream response should be written to.- Returns:
- the outputstream response should be written to
-
setStatus
void setStatus(int statusCode)
Set status code.- Parameters:
statusCode
- should be valid http status ie. 200, 404,
-
setStatus
void setStatus(int statusCode, String reason)
Set status code. and explanatory text string describing the status.- Parameters:
statusCode
- should be valid http status ie. 200, 404,reason
- text string explaining status ie. OK, not found,
-
addHeaderField
void addHeaderField(String name, String value)
Add an HTTP header to the response.- Parameters:
name
- Name of the header, e.g. Last-Modified-Datevalue
- The value of the header
-
getStatus
int getStatus()
Get the status code from this response.- Returns:
- The statuscode.
-
-