Class Network

java.lang.Object
   |
   +----VisiModel.ATMNetwork
           |
           +----Network

public class Network
extends ATMNetwork
Class definition for a displayable representation of an IP/ATM network.

Version:
$Revision: 1.15 $, $Date: 2000/10/30 17:05:09 $
Author:
John Cavanaugh

Variable Index

 o config
The network's configuration.
 o frame
The frame the network is being displayed in.
 o VCC_LIST_INC
 o VCC_LIST_SIZE
 o vccList
List of all the VCCs in the network.
 o view
The view settings being used for display.
 o viewer
A viewer that is displaying information about the network.

Constructor Index

 o Network(VisiFrame)
Constructs an IP/ATM network.
 o Network(VisiFrame, String)
Constructs a named IP/ATM network.

Method Index

 o addNode(Node)
Add a node to the network; overrides addNode() in ATMNetwork.
 o clear()
Clear the network.
 o clearNodeLocations()
Clears display locations from all nodes.
 o connectPhy(Node, Node)
Establish a physical connection between two nodes.
 o connectVCC(String, int, int, String, int, int, int, int)
Establish a VCC between two nodes.
 o count()
Count the nodes in the network.
 o countEndSystems()
Count the end systems in the network.
 o countOrphans()
Count the orphan hosts in the network.
 o countSwitches()
Count the switches in the network.
 o countUnknownNodes()
Count the nodes of unknown type in the network.
 o countVccs()
Count the VCCs in the network.
 o draw(Graphics)
Draw the network.
 o findMaxBandwidth()
Find the maximum bandwidth of any port in the network.
 o getConfig()
Get the network's configuration.
 o getFrame()
Get the network's display frame.
 o getSummaryString()
Get a summary of the network in printable format.
 o getVCC(String, int, int, String, int, int)
Find a VCC in an IP/ATM network.
 o getVCCEnumeration()
Return an enumeration over the VCCs in the network.
 o getView()
Get the network's view settings.
 o getViewer()
Get the network information viewer.
 o handleUpdate(ModelUpdate)
Process a node update.
 o removeNode(Node)
Remove a node from the network.
 o removePhy(Node, Node)
Delete a physical connection between two nodes.
 o removeVCC(VCC)
Delete a VCC from the network.
 o reposition()
Choose display positions for the areas and nodes in the network.
 o resetVCCRanks()
Resets the rank in all VCCs.
 o setConfig(VisiConfig)
Set the network's configuration.
 o setView(ViewSettings)
Set the network's view settings.
 o setViewer(NetworkInfoViewer)
Set the network information viewer.
 o toString()
Return a string describing the network object.
 o whichNode(Point)
Find which node, if any, the cursor is on.

Variables

 o frame
 private VisiFrame frame
The frame the network is being displayed in.

 o config
 private VisiConfig config
The network's configuration.

 o view
 private ViewSettings view
The view settings being used for display.

 o vccList
 private Vector vccList
List of all the VCCs in the network. The VCCs also appear in the vccAdjLists of the nodes they connect.

 o VCC_LIST_SIZE
 private static final int VCC_LIST_SIZE
 o VCC_LIST_INC
 private static final int VCC_LIST_INC
 o viewer
 private NetworkInfoViewer viewer
A viewer that is displaying information about the network.

Constructors

 o Network
 public Network(VisiFrame frame,
                String name)
Constructs a named IP/ATM network.

 o Network
 public Network(VisiFrame frame)
Constructs an IP/ATM network.

Methods

 o handleUpdate
 public void handleUpdate(ModelUpdate update)
Process a node update.

Parameters:
update - the update to be processed.
 o addNode
 public void addNode(Node node)
Add a node to the network; overrides addNode() in ATMNetwork.

Parameters:
node - the node to be added.
 o removeNode
 public void removeNode(Node node)
Remove a node from the network.

Parameters:
node - the node to be removed.
 o clearNodeLocations
 private void clearNodeLocations()
Clears display locations from all nodes.

 o resetVCCRanks
 private void resetVCCRanks()
Resets the rank in all VCCs.

 o connectPhy
 public void connectPhy(Node n1,
                        Node n2)
Establish a physical connection between two nodes.

Parameters:
n1 - the node at one end of the connection.
n2 - the node at one end of the connection.
 o removePhy
 public void removePhy(Node n1,
                       Node n2)
Delete a physical connection between two nodes.

Parameters:
cc - a flag indicating whether the VCC is complete.
 o getVCC
 public VCC getVCC(String s1,
                   int vpi1,
                   int vci1,
                   String s2,
                   int vpi2,
                   int vci2)
Find a VCC in an IP/ATM network.

Parameters:
s1 - the name of the first node.
vpi1 - the VPI at the first node.
vci1 - the VCI at the first node.
s2 - the name of the second node.
vpi2 - the VPI at the second node.
vci2 - the VCI at the second node.
 o connectVCC
 public void connectVCC(String s1,
                        int vpi1,
                        int vci1,
                        String s2,
                        int vpi2,
                        int vci2,
                        int sigType,
                        int owner)
Establish a VCC between two nodes.

Parameters:
s1 - the name of the first node.
vpi1 - the VPI at the first node.
vci1 - the VCI at the first node.
s2 - the name of the second node.
vpi2 - the VPI at the second node.
vci2 - the VCI at the second node.
sigType - the signalling protocol which established the VCC.
owner - the owner of the VCC.
 o removeVCC
 public void removeVCC(VCC vcc)
Delete a VCC from the network.

Parameters:
vcc - the VCC to be removed.
 o getVCCEnumeration
 public Enumeration getVCCEnumeration()
Return an enumeration over the VCCs in the network.

Returns:
an Enumeration over the list of VCCs in the network.
 o clear
 public void clear()
Clear the network.

Overrides:
clear in class ATMNetwork
 o draw
 public void draw(Graphics g)
Draw the network.

Parameters:
g - the graphics context for the drawing area.
 o reposition
 public void reposition()
Choose display positions for the areas and nodes in the network.

 o whichNode
 public Node whichNode(Point cursorLoc)
Find which node, if any, the cursor is on.

Parameters:
cursorLoc - the location of the cursor.
Returns:
the node whose icon contains the cursor; null if the cursor is not on any node.
 o findMaxBandwidth
 public long findMaxBandwidth()
Find the maximum bandwidth of any port in the network.

Returns:
the maximum bandwidth, in cells per second, of any switch port in the network.
 o count
 public int count()
Count the nodes in the network.

Returns:
the number of nodes in the network.
 o countSwitches
 public int countSwitches()
Count the switches in the network.

Returns:
the number of switches in the network.
 o countEndSystems
 public int countEndSystems()
Count the end systems in the network.

Returns:
the number of end systems in the network.
 o countUnknownNodes
 public int countUnknownNodes()
Count the nodes of unknown type in the network.

Returns:
the number of nodes of unknown type in the network.
 o countOrphans
 public int countOrphans()
Count the orphan hosts in the network. An orphan host is an end system with no connection to an ATM switch.

Returns:
the number of orphan hosts in the network.
 o countVccs
 public int countVccs()
Count the VCCs in the network.

Returns:
the number of VCCs in the network.
 o getSummaryString
 public String[] getSummaryString()
Get a summary of the network in printable format.

Returns:
an array of strings summarizing the various elements in the network.
 o getFrame
 public VisiFrame getFrame()
Get the network's display frame.

Returns:
the display frame for the network.
 o getConfig
 public VisiConfig getConfig()
Get the network's configuration.

Returns:
the configuration for the network.
 o setConfig
 public void setConfig(VisiConfig config)
Set the network's configuration.

Parameters:
config - the configuration for the network.
 o getView
 public ViewSettings getView()
Get the network's view settings.

Returns:
the view settings for the network.
 o setView
 public void setView(ViewSettings view)
Set the network's view settings.

Parameters:
view - the view settings for the network.
 o getViewer
 public NetworkInfoViewer getViewer()
Get the network information viewer.

Returns:
the viewer displaying information about the network.
 o setViewer
 public void setViewer(NetworkInfoViewer viewer)
Set the network information viewer.

Parameters:
viewer - the viewer displaying information about the network.
 o toString
 public String toString()
Return a string describing the network object.

Returns:
a string describing the network object.
Overrides:
toString in class ATMNetwork