juju.reattore.protocol.http
Interface HttpResponse

All Superinterfaces:
HttpMessage
All Known Implementing Classes:
BaseHttpResponse

public interface HttpResponse
extends HttpMessage

Encapsulates a HTTP response.


Field Summary
static int SC_FORBIDDEN
          Status code indicating that the server understood the request but refused to fulfill it.
static int SC_INTERNAL_SERVER_ERROR
          Status code indicating that an error occured inside the server.
static int SC_MOVED_PERMANENTLY
          Moved Permanently
static int SC_NOT_FOUND
          Status code indicating that the request resource is not available.
static int SC_OK
          Status code indicating that request succeeded normally.
 
Method Summary
 ByteSource getBody()
          Gets the source to read the body from.
 int getStatus()
          Gets the response status.
 void setBody(ByteSource to)
          Sets the source to read the body from.
 void setHeader(java.lang.String name, java.lang.String value)
          Sets a header.
 void setStatus(int to)
          Sets the response status.
 
Methods inherited from interface juju.reattore.protocol.http.HttpMessage
getHeader, getHeaders, getNumHeaders
 

Field Detail

SC_OK

public static final int SC_OK
Status code indicating that request succeeded normally.

See Also:
Constant Field Values

SC_NOT_FOUND

public static final int SC_NOT_FOUND
Status code indicating that the request resource is not available.

See Also:
Constant Field Values

SC_INTERNAL_SERVER_ERROR

public static final int SC_INTERNAL_SERVER_ERROR
Status code indicating that an error occured inside the server.

See Also:
Constant Field Values

SC_FORBIDDEN

public static final int SC_FORBIDDEN
Status code indicating that the server understood the request but refused to fulfill it.

See Also:
Constant Field Values

SC_MOVED_PERMANENTLY

public static final int SC_MOVED_PERMANENTLY
Moved Permanently

See Also:
Constant Field Values
Method Detail

setStatus

public void setStatus(int to)
Sets the response status.

Parameters:
to - One of the SC_* constants.

setBody

public void setBody(ByteSource to)
Sets the source to read the body from.

Parameters:
to - The source.

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String value)
Sets a header.

Parameters:
name - One of HttpConstants.*
value - The value to use.

getStatus

public int getStatus()
Gets the response status.

Returns:
One of the SC_* constants.

getBody

public ByteSource getBody()
Gets the source to read the body from.

Specified by:
getBody in interface HttpMessage
Returns:
The source.


Copyright © 2002-2003 Michael Hope. All Rights Reserved.