|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--prupp.HTTPHeaderHandler
Do some magic.
Handles the (client)requst to the Proxy, figures out what to do. A typical request: GET /index.html HTTP/1.0 Proxy-Connection: Keep-Alive User-Agent: Mozilla/4.04j2 [en] (X11; I; SunOS 5.5.1 sun4u) Pragma: no-cache Host: www.ludd.luth.se Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png Accept-Language: en Accept-Charset: iso-8859-1,*,utf-8
SPEC from HTTP-1.1 (RFC 2068) Request = Request-Line ; Section 5.1 *( general-header ; Section 4.5 | request-header ; Section 5.3 | entity-header ) ; Section 7.1 CRLF [ message-body ] ; Section 7.2 Request-Line = Method SP Request-URI SP HTTP-Version CRLF
Field Summary | |
protected boolean |
cacheAllowed
are we allowed to cache the page? |
protected java.lang.String |
request
the current request |
protected boolean |
useCached
are we allowed to use the cache? |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY,
MIN_PRIORITY,
NORM_PRIORITY |
Constructor Summary | |
HTTPHeaderHandler(java.net.Socket socket)
reads the HTTP Header from the socket and determine what to do. |
Method Summary | |
java.lang.String |
getConnection()
Get the connection of this request for status-pages etc. |
java.net.InetAddress |
getInetAddress()
Get the InetAddress of user |
java.util.Date |
getStarted()
Get the time this connection started for status-pages etc. |
java.lang.String |
getStatus()
Get the current status of this request so we can build status-pages etc. |
protected boolean |
readContent(HTTPHeader header)
If this request has a body (due to some post or so) read it in and append it to the request. |
void |
run()
Reads the request and finds out which type of handler to use tries to use the cache if possible and if not use a webreader to handle the fetching and sending of the file. |
protected boolean |
setURL(HTTPHeader header)
Try to make an URL of the request. |
Methods inherited from class java.lang.Thread |
activeCount,
checkAccess,
countStackFrames,
currentThread,
destroy,
dumpStack,
enumerate,
getContextClassLoader,
getName,
getPriority,
getThreadGroup,
interrupt,
interrupted,
isAlive,
isDaemon,
isInterrupted,
join,
join,
join,
resume,
setContextClassLoader,
setDaemon,
setName,
setPriority,
sleep,
sleep,
start,
stop,
stop,
suspend,
toString,
yield |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected boolean useCached
protected boolean cacheAllowed
protected java.lang.String request
Constructor Detail |
public HTTPHeaderHandler(java.net.Socket socket)
socket
- the client were talking to.Method Detail |
public void run()
protected boolean readContent(HTTPHeader header)
protected boolean setURL(HTTPHeader header)
header
- the HTTP header for this request.public java.lang.String getStatus()
public java.lang.String getConnection()
public java.util.Date getStarted()
public java.net.InetAddress getInetAddress()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |