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
 void addHeaderField(java.lang.String name, java.lang.String value)
          Add an HTTP header to the response.
 java.io.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, java.lang.String reason)
          Set status code.
 

Method Detail

getOutputStream

java.io.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,
               java.lang.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(java.lang.String name,
                    java.lang.String value)
Add an HTTP header to the response.

Parameters:
name - Name of the header, e.g. Last-Modified-Date
value - The value of the header

getStatus

int getStatus()
Get the status code from this response.

Returns:
The statuscode.