|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrabbit.proxy.Connection
public class Connection
The base connection class for rabbit. This is the class that handle the http protocoll for proxies.
Constructor Summary | |
---|---|
Connection(ConnectionId id,
SocketChannel channel,
Selector selector,
HttpProxy proxy)
|
Method Summary | |
---|---|
void |
doError(int statuscode,
Exception e)
Send an error (400 Bad Request or 504) to the client. |
void |
doError(int status,
String message)
Send an error (400 Bad Request) to the client. |
SocketChannel |
getChannel()
|
boolean |
getChunking()
Get the chunking option. |
String |
getContentLength()
|
Counter |
getCounter()
|
String |
getExtraInfo()
|
HttpGenerator |
getHttpGenerator()
|
ConnectionId |
getId()
|
boolean |
getKeepalive()
Get the keepalive value. |
Logger |
getLogger()
|
boolean |
getMayCache()
Get the state of this request. |
boolean |
getMayFilter()
Get the state of the request. |
boolean |
getMayUseCache()
Get the state of this request. |
boolean |
getMeta()
Get the state of this request. |
String |
getPassword()
|
HttpProxy |
getProxy()
|
String |
getRequestLine()
|
String |
getRequestVersion()
Get the http version that the client used. |
Selector |
getSelector()
|
long |
getStarted()
Get the time this connection was started. |
String |
getStatus()
|
String |
getStatusCode()
|
String |
getUserName()
|
void |
handleMeta()
Handle a meta page. |
void |
handleRequest()
Handle a request by getting the datastream (from the cache or the web). |
void |
logAndClose(rabbit.proxy.Connection.RequestHandler rh)
|
void |
logAndRestart()
|
protected boolean |
mustTunnel(rabbit.proxy.Connection.RequestHandler rh)
Check if we must tunnel a request. |
void |
readRequest()
Read a request. |
void |
setChunking(boolean b)
Set the chunking option. |
void |
setContentLength(String contentLength)
Set the content length of the response. |
void |
setExtraInfo(String info)
Set the extra info. |
void |
setKeepalive(boolean keepalive)
Set keepalive to a new value. |
void |
setMayCache(boolean cacheAllowed)
Set the state of this request. |
void |
setMayFilter(boolean filterAllowed)
Get the state of this request. |
void |
setMayUseCache(boolean useCache)
Set the state of this request. |
void |
setMeta(boolean meta)
Set the state of this request. |
void |
setPassword(String password)
|
void |
setStatusCode(String statusCode)
|
void |
setUserName(String userName)
|
boolean |
useFullURI()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Connection(ConnectionId id, SocketChannel channel, Selector selector, HttpProxy proxy)
Method Detail |
---|
public ConnectionId getId()
public void readRequest()
public void handleMeta()
public void handleRequest()
protected boolean mustTunnel(rabbit.proxy.Connection.RequestHandler rh)
rh
- the request handler.public void doError(int status, String message)
status
- the status code of the error.message
- the error message to tell the client.public void doError(int statuscode, Exception e)
statuscode
- the status code of the error.e
- the exception to tell the client.public SocketChannel getChannel()
public Selector getSelector()
public HttpProxy getProxy()
public Logger getLogger()
public Counter getCounter()
public void setKeepalive(boolean keepalive)
keepalive
- the new keepalive value.public boolean getKeepalive()
public String getUserName()
public void setUserName(String userName)
public String getPassword()
public void setPassword(String password)
public String getRequestLine()
public String getRequestVersion()
public String getStatus()
public String getStatusCode()
public String getContentLength()
public String getExtraInfo()
public void setExtraInfo(String info)
info
- the new info.public long getStarted()
public void setChunking(boolean b)
b
- if true this connection should use chunking.public boolean getChunking()
public boolean getMeta()
public void setMeta(boolean meta)
meta
- true if this request is a metapage request, false otherwise.public void setMayUseCache(boolean useCache)
useCache
- true if we may use the cache for this request,
false otherwise.public boolean getMayUseCache()
public void setMayCache(boolean cacheAllowed)
cacheAllowed
- true if we may cache the response, false otherwise.public boolean getMayCache()
public void setMayFilter(boolean filterAllowed)
filterAllowed
- true if we may filter the response, false otherwise.public boolean getMayFilter()
public void setContentLength(String contentLength)
contentLength
- the new content length.public void setStatusCode(String statusCode)
public boolean useFullURI()
public void logAndClose(rabbit.proxy.Connection.RequestHandler rh)
public void logAndRestart()
public HttpGenerator getHttpGenerator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |