pygmy.core
Class HttpResponse

java.lang.Object
  extended by pygmy.core.Response
      extended by pygmy.core.HttpResponse

public class HttpResponse
extends Response

This holds the response data for the http response.


Constructor Summary
HttpResponse(HttpRequest request, java.io.OutputStream aStream)
           
HttpResponse(HttpRequest request, java.io.OutputStream aStream, ResponseListener listener)
           
 
Method Summary
 void addHeader(java.lang.String key, java.lang.String value)
           
 void commitResponse()
           
protected  void endTransfer()
           
protected  void endTransfer(java.lang.Exception e)
           
 java.io.OutputStream getOutputStream()
           
 java.io.PrintWriter getPrintWriter()
           
 boolean isKeepAlive()
           
protected  void notifyListeners(int bytesSent, int length)
           
 void sendError(int statusCode, java.lang.String errorMessage)
           
 void sendError(int statusCode, java.lang.String errorMessage, java.lang.Exception e)
           
 void sendResponse(java.io.InputStream is, int length)
           
 void sendResponse(java.io.InputStream is, long beginning, long ending)
           
 void setMimeType(java.lang.String aMimeType)
           
 void setStatusCode(int statusCode)
           
protected  void startTransfer()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpResponse

public HttpResponse(HttpRequest request,
                    java.io.OutputStream aStream)

HttpResponse

public HttpResponse(HttpRequest request,
                    java.io.OutputStream aStream,
                    ResponseListener listener)
Method Detail

isKeepAlive

public boolean isKeepAlive()

addHeader

public void addHeader(java.lang.String key,
                      java.lang.String value)

getPrintWriter

public java.io.PrintWriter getPrintWriter()

setMimeType

public void setMimeType(java.lang.String aMimeType)

sendError

public void sendError(int statusCode,
                      java.lang.String errorMessage)

sendError

public void sendError(int statusCode,
                      java.lang.String errorMessage,
                      java.lang.Exception e)

sendResponse

public void sendResponse(java.io.InputStream is,
                         int length)
                  throws java.io.IOException
Throws:
java.io.IOException

sendResponse

public void sendResponse(java.io.InputStream is,
                         long beginning,
                         long ending)
                  throws java.io.IOException
Throws:
java.io.IOException

setStatusCode

public void setStatusCode(int statusCode)

commitResponse

public void commitResponse()
                    throws java.io.IOException
Throws:
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()

startTransfer

protected void startTransfer()

notifyListeners

protected void notifyListeners(int bytesSent,
                               int length)
                        throws java.io.IOException
Throws:
java.io.IOException

endTransfer

protected void endTransfer()

endTransfer

protected void endTransfer(java.lang.Exception e)