prupp
Class Responder

java.lang.Object
  |
  +--prupp.Responder
Direct Known Subclasses:
CacheSender, MetaPageHandler, WebReader

public class Responder
extends java.lang.Object

The base handler for a response from the server.


Field Summary
protected  java.lang.String authuser
          the authenticated userid if any
protected  java.io.DataInputStream clientis
          inputstram from client
protected  java.io.DataOutputStream clientos
          outputstream to client
protected  java.lang.String extrainfo
          extra info we want
protected  java.lang.String requestLine
          the requested url
protected  int statusCode
          the status of the page fetched (proxys status, not the response code from the web server)
 
Constructor Summary
Responder(java.lang.String reqLine, java.io.DataInputStream input, java.io.DataOutputStream output)
          basic constructor
 
Method Summary
protected  void error(java.lang.String message)
          write a simple error page (400 Bad Request) to the client
protected  void forbidden(java.net.URL url)
          write an illegal access (403) to the client
 java.lang.String getAuthuser()
          get the authuser for this request
 java.lang.String getExtraInfo()
          get the extrainfo for this request
 java.lang.String getRequestLine()
          get the requestLine for this request
 int getStatusCode()
          get the current status of this request
protected  void internalError(java.lang.String message)
          Write a 500 Internal Server Error to the client (problem with the proxy).
protected  void requestAuthentication(java.lang.String realm, java.net.URL url)
          write a 407 Proxy Authentication Required to the client
protected  void send(java.lang.String sb)
          send data to the client
 void setAuthuser(java.lang.String authuser)
          set the authuser for this request
 void setExtraInfo(java.lang.String extrainfo)
          sets the extra information we want to save, this could be like compressionration etc
 void setRequestLine(java.lang.String reqLine)
          set the requestLine for this request
 void setStatusCode(int statusCode)
          sets the statusCode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clientos

protected java.io.DataOutputStream clientos
outputstream to client

clientis

protected java.io.DataInputStream clientis
inputstram from client

requestLine

protected java.lang.String requestLine
the requested url

statusCode

protected int statusCode
the status of the page fetched (proxys status, not the response code from the web server)

authuser

protected java.lang.String authuser
the authenticated userid if any

extrainfo

protected java.lang.String extrainfo
extra info we want
Constructor Detail

Responder

public Responder(java.lang.String reqLine,
                 java.io.DataInputStream input,
                 java.io.DataOutputStream output)
basic constructor
Parameters:
reqLine - The request being handled.
input - The inputstream from the client.
output - The outputstream to the client.
Method Detail

setRequestLine

public void setRequestLine(java.lang.String reqLine)
set the requestLine for this request
Parameters:
reqLine - the new requestLine

getRequestLine

public java.lang.String getRequestLine()
get the requestLine for this request
Returns:
the requestLine

setExtraInfo

public void setExtraInfo(java.lang.String extrainfo)
sets the extra information we want to save, this could be like compressionration etc
Parameters:
extrainfo - the new information we want to save

getExtraInfo

public java.lang.String getExtraInfo()
get the extrainfo for this request
Returns:
the extrainfo

setAuthuser

public void setAuthuser(java.lang.String authuser)
set the authuser for this request
Parameters:
authuser - the new authuser

getAuthuser

public java.lang.String getAuthuser()
get the authuser for this request
Returns:
the authuser

setStatusCode

public void setStatusCode(int statusCode)
sets the statusCode.
Parameters:
statusCode - the new StatusCode

getStatusCode

public int getStatusCode()
get the current status of this request
Returns:
the statuscode for this request

error

protected void error(java.lang.String message)
write a simple error page (400 Bad Request) to the client
Parameters:
message - a description of the error

forbidden

protected void forbidden(java.net.URL url)
write an illegal access (403) to the client
Parameters:
url - the URL that is unaccessable.

requestAuthentication

protected void requestAuthentication(java.lang.String realm,
                                     java.net.URL url)
write a 407 Proxy Authentication Required to the client
Parameters:
url - the URL that is restricted

internalError

protected void internalError(java.lang.String message)
Write a 500 Internal Server Error to the client (problem with the proxy).
Parameters:
message - a description of the error that occured

send

protected void send(java.lang.String sb)
send data to the client
Parameters:
sb - the StringBuffer holding the data to be sent