juju.reattore.protocol.http.impl
Class BaseHttpResponse

java.lang.Object
  |
  +--juju.reattore.protocol.http.impl.BaseHttpResponse
All Implemented Interfaces:
HttpMessage, HttpResponse

public class BaseHttpResponse
extends java.lang.Object
implements HttpResponse

Basic HTTP response implementation.


Field Summary
 
Fields inherited from interface juju.reattore.protocol.http.HttpResponse
SC_FORBIDDEN, SC_INTERNAL_SERVER_ERROR, SC_MOVED_PERMANENTLY, SC_NOT_FOUND, SC_OK
 
Constructor Summary
BaseHttpResponse()
           
 
Method Summary
 ByteSource getBody()
          Gets the source to read the body from.
 java.lang.String getHeader(java.lang.String key)
          Gets a header line.
 java.util.Set getHeaders()
          Gets all headers as a set of Map.Entry items.
 int getNumHeaders()
          Gets the number of parsed headers not including the start line.
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseHttpResponse

public BaseHttpResponse()
Method Detail

getStatus

public int getStatus()
Description copied from interface: HttpResponse
Gets the response status.

Specified by:
getStatus in interface HttpResponse
Returns:
One of the SC_* constants.
See Also:
HttpResponse

setStatus

public void setStatus(int to)
Description copied from interface: HttpResponse
Sets the response status.

Specified by:
setStatus in interface HttpResponse
Parameters:
to - One of the SC_* constants.
See Also:
HttpResponse

setBody

public void setBody(ByteSource to)
Description copied from interface: HttpResponse
Sets the source to read the body from.

Specified by:
setBody in interface HttpResponse
Parameters:
to - The source.
See Also:
HttpResponse

getBody

public ByteSource getBody()
Description copied from interface: HttpResponse
Gets the source to read the body from.

Specified by:
getBody in interface HttpResponse
Returns:
The source.
See Also:
HttpResponse

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String value)
Description copied from interface: HttpResponse
Sets a header.

Specified by:
setHeader in interface HttpResponse
Parameters:
name - One of HttpConstants.*
value - The value to use.
See Also:
HttpResponse

getNumHeaders

public int getNumHeaders()
Description copied from interface: HttpMessage
Gets the number of parsed headers not including the start line.

Specified by:
getNumHeaders in interface HttpMessage
Returns:
The number of header lines.
See Also:
HttpResponse

getHeader

public java.lang.String getHeader(java.lang.String key)
Description copied from interface: HttpMessage
Gets a header line.

Specified by:
getHeader in interface HttpMessage
Parameters:
key - The header to get.
Returns:
The header line as a string or null if it doesn't exist.
See Also:
HttpResponse

getHeaders

public java.util.Set getHeaders()
Description copied from interface: HttpMessage
Gets all headers as a set of Map.Entry items.

Specified by:
getHeaders in interface HttpMessage
Returns:
Set of (name, value) pairs.
See Also:
HttpMessage


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