All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class calypso.core.connmanager.ConnectionManager

java.lang.Object
   |
   +----java.rmi.server.RemoteObject
           |
           +----java.rmi.server.RemoteServer
                   |
                   +----java.rmi.server.UnicastRemoteObject
                           |
                           +----calypso.core.connmanager.ConnectionManager

public class ConnectionManager
extends UnicastRemoteObject
implements ConnectionManagerInterface
Implementation of the Calypso Connection Manager. This class is a Singleton, so there can be only one connection manager at a time.

Author:
Jukka Aro / TCM Laboratory / HUT
See Also:
ConnectionManagerInterface

Method Index

 o addMCConnection(MCConnectionDescr)
Adds a new multicast connection descriptor to the hashtable containing all MC connections over the switch.
 o addPPConnection(PPConnectionDescr)
Adds a new point-to-point connection descriptor to the hashtable containing all PP connections over the switch.
 o closeMCConnection(MCConnectionDescr)
Closes a multicast connection.
 o closePPConnection(PPConnectionDescr)
Closes a point-to-point connection.
 o createMCConnection(InetAddress)
Creates a new multicast connection
 o createPPConnection(InetAddress, InetAddress)
Creates a new point-to-point connection
 o getMCConnectionDescr(Long)
Fetches a multicast connection descriptor.
 o getMCConnectionDescrs()
Fetches descriptors for all multicast connections over the switch.
 o getNextConnID()
 o getPPConnectionDescr(Long)
Fetches a point-to-point connection descriptor.
 o getPPConnectionDescrs()
Fetches descriptors for all point-to-point connections over the switch.
 o hasMCKey(Long)
Tests if the hashtable containing all multicast connections over the switch has the specified long as a key.
 o hasPPKey(Long)
Tests if the hashtable containing all point-to-point connections over the switch has the specified long as a key.
 o init()
Initializes the Connection Manager
 o instance()
Returns a reference to the only ConnectionManager instance in existence
 o registerPartialMCConnection(Long, VPIVCI, InetAddress, InetAddress, VCPoint)
 o registerPartialPPConnection(Long, int, VPIVCI, InetAddress)
Creates a partial point-to-point connection (adds one leg to an existing connection).
 o setupMCConnection(Long, VPIVCI, InetAddress, InetAddress, VCPoint)

Methods

 o init
 public static void init()
Initializes the Connection Manager

 o instance
 public static ConnectionManager instance()
Returns a reference to the only ConnectionManager instance in existence

Returns:
Reference to the ConnectionManager class instance
 o getNextConnID
 protected static int getNextConnID()
Returns:
Next connection ID number
 o hasPPKey
 public boolean hasPPKey(Long id_)
Tests if the hashtable containing all point-to-point connections over the switch has the specified long as a key.

Parameters:
id_ - Long to be searched for among the keys in the PPDescrs hashtable
Returns:
true if the specified object is a key in the PPDescrs hashtable; false otherwise.
 o hasMCKey
 public boolean hasMCKey(Long id_)
Tests if the hashtable containing all multicast connections over the switch has the specified long as a key.

Parameters:
id_ - Long to be searched for among the keys in the MCDescrs hashtable
Returns:
true if the specified object is a key in the MCDescrs hashtable; false otherwise.
 o createPPConnection
 public VCConnectionDescr createPPConnection(InetAddress IP1_,
                                             InetAddress IP2_) throws RemoteException, SwitchException
Creates a new point-to-point connection

Parameters:
IP1_ - Router's IP address
IP2_ - Client's IP address
Returns:
PPConnectionDescr describing the new connection
Throws: RemoteException
If some problems with the remote connection occur.
Throws: SwitchException
If IP addresses are not found in routing table.
 o registerPartialPPConnection
 public PPConnectionDescr registerPartialPPConnection(Long connID_,
                                                      int oPort_,
                                                      VPIVCI oVCC_,
                                                      InetAddress dest_) throws RemoteException, SwitchException
Creates a partial point-to-point connection (adds one leg to an existing connection).

Parameters:
connID_ - Identity number of the connection descriptor
oPort_ - Port number on the router's side of the switch
oVCC_ - VPI/VCI pair on the router's side of the switch
dest_ - Router's IP address
Returns:
PPConnectionDescr describing the new connection
Throws: RemoteException
If some problems with the remote connection occur.
Throws: SwitchException
If IP addresses are not found in routing table.
 o createMCConnection
 public VCConnectionDescr createMCConnection(InetAddress IP1_) throws RemoteException, SwitchException
Creates a new multicast connection

Parameters:
IP1_ - Router's IP address
Returns:
MCConnectionDescr describing the new connection
Throws: RemoteException
If some problems with the remote connection occur.
Throws: SwitchException
If router's IP address is not found in routing table.
 o setupMCConnection
 public void setupMCConnection(Long connID_,
                               VPIVCI oVCC_,
                               InetAddress dest_,
                               InetAddress clientIP_,
                               VCPoint outPoint_)
 o registerPartialMCConnection
 public MCConnectionDescr registerPartialMCConnection(Long connID_,
                                                      VPIVCI oVCC_,
                                                      InetAddress dest_,
                                                      InetAddress clientIP_,
                                                      VCPoint outPoint_)
 o addPPConnection
 public void addPPConnection(PPConnectionDescr ppcd_) throws RemoteException
Adds a new point-to-point connection descriptor to the hashtable containing all PP connections over the switch.

Parameters:
ppcd_ - PP connection descriptor to be added
Throws: RemoteException
If some problems with the remote connection occur.
 o addMCConnection
 public void addMCConnection(MCConnectionDescr mccd_) throws RemoteException
Adds a new multicast connection descriptor to the hashtable containing all MC connections over the switch.

Parameters:
mccd_ - MC connection descriptor to be added
Throws: RemoteException
If some problems with the remote connection occur.
 o getPPConnectionDescr
 public PPConnectionDescr getPPConnectionDescr(Long connID)
Fetches a point-to-point connection descriptor.

Parameters:
connID - Long representing the ID number of the connection to be fetched
Returns:
PPConnectionDescr that matches the ID number
 o getPPConnectionDescrs
 public Enumeration getPPConnectionDescrs()
Fetches descriptors for all point-to-point connections over the switch.

Returns:
java.util.Enumeration of point-to-point connection descriptors
 o getMCConnectionDescr
 public MCConnectionDescr getMCConnectionDescr(Long connID_)
Fetches a multicast connection descriptor.

Parameters:
connID - Long representing the ID number of the connection to be fetched
Returns:
MCConnectionDescr that matches the ID number
 o getMCConnectionDescrs
 public Enumeration getMCConnectionDescrs()
Fetches descriptors for all multicast connections over the switch.

Returns:
java.util.Enumeration of multicast connection descriptors
 o closePPConnection
 protected void closePPConnection(PPConnectionDescr ppcd_) throws RemoteException
Closes a point-to-point connection. This method can be called by a point-to-point connection descriptor only and is therefore declared protected. The connection is removed from the hashtable of the Connection Manager.

Parameters:
ppcd_ - PP Connection descriptor of the connection to be closed
 o closeMCConnection
 protected void closeMCConnection(MCConnectionDescr mccd_) throws RemoteException
Closes a multicast connection. This method can be called by a multicast connection descriptor only and is therefore declared protected. The connection is removed from the hashtable of the Connection Manager.

Parameters:
mccd_ - MC Connection descriptor of the connection to be closed

All Packages  Class Hierarchy  This Package  Previous  Next  Index