|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.www.protocol.http.icp.ICPFilter
public class ICPFilter
Field Summary | |
---|---|
static java.lang.String |
CONFIG_P
Properties - Our configuration file. |
protected boolean |
debug
Our we in debug mode ? |
static java.lang.String |
DEBUG_P
Properties - Our debug flag. |
static java.lang.String |
DISABLE_CACHE_P
Properties - disable caching when fetching from a neighbour proxy. |
protected boolean |
disableCache
Should we disablecaching when fetching through a proxy ? |
protected java.util.Hashtable |
friends
Our senders, indexed by InetAddress. |
protected org.w3c.www.protocol.http.icp.ICPReceiver |
icp
Our ICP engine. |
static java.lang.String |
PORT_P
Properties - Our own UDP port number. |
protected ObservableProperties |
props
The properties we are initialized from. |
static java.lang.String |
TIMEOUT_P
Properties - Our default timeout value. |
protected long |
timeoutValue
Our default timeout value for waiting for replies (in ms). |
Constructor Summary | |
---|---|
ICPFilter()
|
Method Summary | |
---|---|
protected void |
createICPSender(java.lang.String host,
int dstport,
java.lang.String http)
|
boolean |
exceptionFilter(Request request,
HttpException ex)
This filter doesn't handle exceptions. |
org.w3c.www.protocol.http.icp.ICPSender |
getSender(java.net.InetAddress addr,
int port)
Get the sender object for the given InetAddress instance. |
protected java.net.DatagramSocket |
getSocket()
|
Reply |
ingoingFilter(Request request)
Our ingoingFilter method. |
void |
initialize(HttpManager manager)
Initialize the ICP filter. |
protected java.net.URL |
locateProxy(org.w3c.www.protocol.http.icp.ICPReply reply)
Locate the HTTP service of the proxy that has emitted that reply. |
Reply |
outgoingFilter(Request request,
Reply reply)
Our outgoingFilter does nothing (at all). |
protected void |
parseConfiguration()
Parse the configuration file. |
boolean |
propertyChanged(java.lang.String name)
The callback method, invoked when any property change occurs. |
protected java.net.URL |
runQuery(org.w3c.www.protocol.http.icp.ICPQuery query)
Run the ICP query, and return the proxy we should go to. |
protected int |
sendQuery(org.w3c.www.protocol.http.icp.ICPQuery query)
Send the given query to all our neighbors. |
void |
sync()
This filter doesn't maintain dynamic state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEBUG_P
public static final java.lang.String CONFIG_P
public static final java.lang.String PORT_P
public static final java.lang.String TIMEOUT_P
public static final java.lang.String DISABLE_CACHE_P
protected ObservableProperties props
protected org.w3c.www.protocol.http.icp.ICPReceiver icp
protected java.util.Hashtable friends
protected long timeoutValue
protected boolean debug
protected boolean disableCache
Constructor Detail |
---|
public ICPFilter()
Method Detail |
---|
public boolean propertyChanged(java.lang.String name)
PropertyMonitoring
propertyChanged
in interface PropertyMonitoring
name
- The name of the property that changed.
protected java.net.DatagramSocket getSocket()
protected void createICPSender(java.lang.String host, int dstport, java.lang.String http) throws java.net.UnknownHostException, java.net.MalformedURLException, java.net.SocketException
java.net.UnknownHostException
java.net.MalformedURLException
java.net.SocketException
protected void parseConfiguration()
public org.w3c.www.protocol.http.icp.ICPSender getSender(java.net.InetAddress addr, int port)
addr
- The InetAddress of the sender.
protected java.net.URL locateProxy(org.w3c.www.protocol.http.icp.ICPReply reply)
reply
- The reply emitted by the host that alos host the HTTP
service we are looking for.
protected int sendQuery(org.w3c.www.protocol.http.icp.ICPQuery query)
protected java.net.URL runQuery(org.w3c.www.protocol.http.icp.ICPQuery query)
url
- The URL we are looking for.
public boolean exceptionFilter(Request request, HttpException ex)
exceptionFilter
in interface RequestFilter
request
- The request that triggered the exception.ex
- The triggered exception.
public Reply ingoingFilter(Request request)
If a hit reply is received, we then use the corresponding proxy to fullfill the request.
ingoingFilter
in interface RequestFilter
request
- The request that is about to be emitted.
public Reply outgoingFilter(Request request, Reply reply)
outgoingFilter
in interface RequestFilter
request
- The request that has been processed.reply
- The original reply (from origin server)
public void sync()
sync
in interface RequestFilter
public void initialize(HttpManager manager) throws PropRequestFilterException
initialize
in interface PropRequestFilter
manager
- The HTTP manager.
PropRequestFilterException
- If the filter cannot
launch its server part (listening for incomming ICP requests)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |