All Packages  Class Hierarchy  This Package  Previous  Next  Index
  Class w3c.www.protocol.http.icp.ICPFilter
java.lang.Object
   |
   +----w3c.www.protocol.http.icp.ICPFilter
  -  public class ICPFilter
  -  extends Object
  -  implements PropRequestFilter, PropertyMonitoring
   
  -   CONFIG_P CONFIG_P
-   Properties - Our configuration file.
  
-   debug debug
-   Our we in debug mode ?
  
-   DEBUG_P DEBUG_P
-   Properties - Our debug flag.
  
-   DISABLE_CACHE_P DISABLE_CACHE_P
-   Properties - disable caching when fetching from a neighbour proxy.
  
-   disableCache disableCache
-   Should we disablecaching when fetching through a proxy ?
  
-   friends friends
-   Our senders, indexed by InetAddress.
  
-   icp icp
-   Our ICP engine.
  
-   PORT_P PORT_P
-   Properties - Our own UDP port number.
  
-   props props
-   The properties we are initialized from.
  
-   TIMEOUT_P TIMEOUT_P
-   Properties - Our default timeout value.
  
-   timeoutValue timeoutValue
-   Our default timeout value for waiting for replies (in ms).
   
  -   ICPFilter() ICPFilter()
-  
   
  -   createICPSender(String, int, String) createICPSender(String, int, String)
-  
  
-   exceptionFilter(Request, HttpException) exceptionFilter(Request, HttpException)
-   This filter doesn't handle exceptions.
  
-   getSender(InetAddress, int) getSender(InetAddress, int)
-   Get the sender object for the given InetAddress instance.
  
-   getSocket() getSocket()
-  
  
-   ingoingFilter(Request) ingoingFilter(Request)
-   Our ingoingFilter method.
  
-   initialize(HttpManager) initialize(HttpManager)
-   Initialize the ICP filter.
  
-   locateProxy(ICPReply) locateProxy(ICPReply)
-   Locate the HTTP service of the proxy that has emitted that reply.
  
-   outgoingFilter(Request, Reply) outgoingFilter(Request, Reply)
-   Our outgoingFilter does nothing (at all).
  
-   parseConfiguration() parseConfiguration()
-   Parse the configuration file.
  
-   propertyChanged(String) propertyChanged(String)
-  
  
-   runQuery(ICPQuery) runQuery(ICPQuery)
-   Run the ICP query, and return the proxy we should go to.
  
-   sendQuery(ICPQuery) sendQuery(ICPQuery)
-   Send the given query to all our neighbors.
  
-   sync() sync()
-   This filter doesn't maintain dynamic state.
   
 DEBUG_P
DEBUG_P
 public static final String DEBUG_P
  -  Properties - Our debug flag.
 
 CONFIG_P
CONFIG_P
 public static final String CONFIG_P
  -  Properties - Our configuration file.
 
 PORT_P
PORT_P
 public static final String PORT_P
  -  Properties - Our own UDP port number.
 
 TIMEOUT_P
TIMEOUT_P
 public static final String TIMEOUT_P
  -  Properties - Our default timeout value.
 
 DISABLE_CACHE_P
DISABLE_CACHE_P
 public static final String DISABLE_CACHE_P
  -  Properties - disable caching when fetching from a neighbour proxy.
 
 props
props
 protected ObservableProperties props
  -  The properties we are initialized from.
 
 icp
icp
 protected ICPReceiver icp
  -  Our ICP engine.
 
 friends
friends
 protected Hashtable friends
  -  Our senders, indexed by InetAddress.
 
 timeoutValue
timeoutValue
 protected long timeoutValue
  -  Our default timeout value for waiting for replies (in ms).
 
 debug
debug
 protected boolean debug
  -  Our we in debug mode ?
 
 disableCache
disableCache
 protected boolean disableCache
  -  Should we disablecaching when fetching through a proxy ?
 
   
 ICPFilter
ICPFilter
 public ICPFilter()
   
 propertyChanged
propertyChanged
 public boolean propertyChanged(String name)
 getSocket
getSocket
 protected DatagramSocket getSocket()
 createICPSender
createICPSender
 protected void createICPSender(String host,
                                int dstport,
                                String http) throws UnknownHostException, MalformedURLException, SocketException
 parseConfiguration
parseConfiguration
 protected void parseConfiguration()
  -  Parse the configuration file.
 
 getSender
getSender
 public ICPSender getSender(InetAddress addr,
                            int port)
  -  Get the sender object for the given InetAddress instance.
   
- 
    -  Parameters:
    
-  addr - The InetAddress of the sender.
    
-  Returns:
    
-  An ICPSender instance, if available, null
 otherwise.
  
 
 locateProxy
locateProxy
 protected URL locateProxy(ICPReply reply)
  -  Locate the HTTP service of the proxy that has emitted that reply.
   
- 
    -  Parameters:
    
-  reply - The reply emitted by the host that alos host the HTTP
 service we are looking for.
    
-  Returns:
    
-  The URL of the proxy, or null if no matching
 proxy was found.
  
 
 sendQuery
sendQuery
 protected int sendQuery(ICPQuery query)
  -  Send the given query to all our neighbors.
   
- 
    -  Returns:
    
-  The number of times we emitted the query.
  
 
 runQuery
runQuery
 protected URL runQuery(ICPQuery query)
  -  Run the ICP query, and return the proxy we should go to.
   
- 
    -  Parameters:
    
-  url - The URL we are looking for.
    
-  Returns:
    
-  The URL of the proxy we should go to for that URL, or 
 null if none was found.
  
 
 exceptionFilter
exceptionFilter
 public boolean exceptionFilter(Request request,
                                HttpException ex)
  -  This filter doesn't handle exceptions.
   
- 
    -  Parameters:
    
-  request - The request that triggered the exception.
    -  ex - The triggered exception.
    
-  Returns:
    
-  Always false.
  
 
 ingoingFilter
ingoingFilter
 public Reply ingoingFilter(Request request)
  -  Our ingoingFilter method.
 This method emits (only for GET requestst currently) an ICP query
 to all our neighbors, and wait for either one of them to
 reply with a hit, or, our timeout value to expire.
 If a hit reply is received, we then use the corresponding proxy
 to fullfill the request.
 
   
- 
    -  Parameters:
    
-  request - The request that is about to be emitted.
    
-  Returns:
    
-  Always null.
  
 
 outgoingFilter
outgoingFilter
 public Reply outgoingFilter(Request request,
                             Reply reply)
  -  Our outgoingFilter does nothing (at all).
   
- 
    -  Parameters:
    
-  request - The request that has been processed.
    -  reply - The original reply (from origin server)
    
-  Returns:
    
-  Always null.
  
 
 sync
sync
 public void sync()
  -  This filter doesn't maintain dynamic state.
 
 initialize
initialize
 public void initialize(HttpManager manager) throws PropRequestFilterException
  -  Initialize the ICP filter.
 This is where we parse the configuration file in order to know
 about our neighbors. We then register ourself to the HTTP manager.
   
- 
    -  Parameters:
    
-  manager - The HTTP manager.
    
-  Throws: FilterInitException
    
-  If the filter cannot launch its server
 part (listening for incomming ICP requests)
  
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index