Class ConnectionManager

public class ConnectionManager
implements java.lang.Runnable

Title:

Description:The Connection Manager. Keeps track of the fanout, creates the incoming connections, outgoing connections, and also creates a daemon thread that keeps the host cache up to dat through periodic refreshes.

Copyright: Copyright (c) 2003

Company:

Version:
1.0
Author:
Ravi Kosuri
Constructor Detail

ConnectionManager

public ConnectionManager(java.lang.String bootFileName)
Constructor Initializes the host cache with entries from a bootstrap file

Method Detail

setFanout

public void setFanout(int f)
Sets the fanout.
Parameters:
f -

getFanout

public int getFanout()
Return the fanout
Returns:

getOutgoingConnection

private OutgoingConnection getOutgoingConnection()
returns an outgoing connection that connects(presumably) to another FreeOxy server.
Returns:
Throws:
java.lang.Exception -

getIncomingConnectionsforListening

public java.util.Vector getIncomingConnectionsforListening()
returns the list of incoming connections maintained by the connection manager
Returns:

getOutgoingConnectionsforSearch

public java.util.Vector getOutgoingConnectionsforSearch()
returns the list of live(hopefully) outgoing connections maintained by the connection manager
Returns:

run

public void run()
Responsible for creating fanout number of incoming connection threads(and hoping that the threads can handle the stuff that comes to them without bothering me with the details of parsing).

getBasePort

public int getBasePort()
Calculates the base port from today's day.
Returns:

getRandomPort

public int getRandomPort()
This method will calculate a port from a hash of today's date, and then choose a port randomly between port and port+fanout. Stub for now
Returns: