org.openflow.gui
Class MultipleConnectionAndTopologyHandler<CH extends ConnectionHandler>

java.lang.Object
  extended by org.openflow.gui.MultipleConnectionAndTopologyHandler<CH>

public class MultipleConnectionAndTopologyHandler<CH extends ConnectionHandler>
extends java.lang.Object

This class tracks the connection(s) to the backend(s) and their associated topology(ies). It may be helpful when populating more than one topology or receiving topology information from multiple connections.

Author:
David Underhill

Constructor Summary
MultipleConnectionAndTopologyHandler()
          Initialize the multiple connection and topology manager with the initial connection.
MultipleConnectionAndTopologyHandler(CH ch)
          Initialize the multiple connection and topology manager with the initial connection.
 
Method Summary
 void addConnectionManager(CH conn)
          Add a connection manager.
 CH getConnectionManager(int index)
          Returns the requested connection to the backend.
 int getNumConnectionManagers()
          Returns the number of connections being maintained
 int getNumTopologies()
          Returns the number of topologies being maintained
 Topology getTopology(int index)
          Returns the requested connection to the backend.
 void pzClosing(PZManager manager)
          Shuts down all connections in response to the GUI being shutdown.
 void removeConnection(int index)
          Removes and shuts down the specified connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultipleConnectionAndTopologyHandler

public MultipleConnectionAndTopologyHandler()
Initialize the multiple connection and topology manager with the initial connection.


MultipleConnectionAndTopologyHandler

public MultipleConnectionAndTopologyHandler(CH ch)
Initialize the multiple connection and topology manager with the initial connection.

Parameters:
ch - the initial connection manager (if null then it starts with no connections)
Method Detail

addConnectionManager

public void addConnectionManager(CH conn)
Add a connection manager. That manager's topology is registered in the topology list if it is not already present.


getConnectionManager

public CH getConnectionManager(int index)
Returns the requested connection to the backend.

Parameters:
index - the index of the connection to get

getNumConnectionManagers

public int getNumConnectionManagers()
Returns the number of connections being maintained


removeConnection

public void removeConnection(int index)
Removes and shuts down the specified connection. If it was the only connection populating a topology, then that topology is discarded from the list.

Parameters:
index - the index of the connection to remove

pzClosing

public void pzClosing(PZManager manager)
Shuts down all connections in response to the GUI being shutdown.


getTopology

public Topology getTopology(int index)
Returns the requested connection to the backend.

Parameters:
index - the index of the connection to get

getNumTopologies

public int getNumTopologies()
Returns the number of topologies being maintained