Class CollectorNetwork

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

public class CollectorNetwork
extends ATMNetwork
Collector-specific representation of an IP/ATM network.

Version:
$Revision: 1.9 $, $Date: 2000/10/31 20:32:02 $
Author:
Mike Spengler, Joseph Thomas

Variable Index

 o addrs
 o ca
Link back to CollectorAnalyzer
 o currTime
The current CollectorUpdate time.
 o dc
Link back to DataCollector
 o locked
Lock to synchronize work queues when deleting/merging elements.
 o lockedNode
 o ms
The ModelUpdate storage manager.
 o nodes
Cache of actively updating nodes.
 o nWorkers
How many DataCollectorWorkers there are

Constructor Index

 o CollectorNetwork(String, ConfigMgr, ModelStorage, DataCollector, CollectorAnalyzer, long)
Class constructor.

Method Index

 o acquireLock(NodeAddress)
Test if lock can be acquired and do so if possible
 o dumpState(FIFO)
Dumps the current state of this network.
 o endCycle(NodeEnd)
Ends a collector node update cycle.
 o findNode(NodeAddress)
Finds a node in the nework.
 o getCachedNode(NodeAddress)
Gets a node from the active cache.
 o getCurrTime()
Gets the current CollectorUpdate time.
 o getLock()
Return status of lock
 o matchInterface(NodeAddress, CollectorNode)
Check for interface with the address
 o releaseLock()
Release lock
 o replaceCachedNode(NodeAddress, CollectorNode)
Replaces a node in the active cache.
 o startCycle(NodeBegin)
Starts a collector node update cycle.
 o updateModel(CollectorUpdate)
Updates the network model using the supplied update object.

Variables

 o currTime
 private static long currTime
The current CollectorUpdate time.

 o nodes
 private CollectorNode nodes[]
Cache of actively updating nodes.

 o addrs
 private NodeAddress addrs[]
 o ms
 protected ModelStorage ms
The ModelUpdate storage manager.

 o locked
 private static boolean locked
Lock to synchronize work queues when deleting/merging elements.

 o lockedNode
 private static NodeAddress lockedNode
 o dc
 private DataCollector dc
Link back to DataCollector

 o ca
 private CollectorAnalyzer ca
Link back to CollectorAnalyzer

 o nWorkers
 private int nWorkers
How many DataCollectorWorkers there are

Constructors

 o CollectorNetwork
 public CollectorNetwork(String name,
                         ConfigMgr cm,
                         ModelStorage ms,
                         DataCollector dc,
                         CollectorAnalyzer ca,
                         long time)
Class constructor.

Parameters:
name - the network's name
cm - the configuration manager containing all configuration information for this run
ms - the ModelUpdate storage manager
time - the initial 'collector time'

Methods

 o updateModel
 public synchronized void updateModel(CollectorUpdate update)
Updates the network model using the supplied update object.

Parameters:
update - the update to be applied
 o startCycle
 public void startCycle(NodeBegin update)
Starts a collector node update cycle.

Parameters:
update - the update record starting the cycle
 o matchInterface
 private boolean matchInterface(NodeAddress addr,
                                CollectorNode node)
Check for interface with the address

Parameters:
addr - node address to match against
node - node to search interface table of
Returns:
boolean value indicating that this node has an interface with matching address
 o endCycle
 public void endCycle(NodeEnd update)
Ends a collector node update cycle.

Parameters:
update - the update record ending the cycle
 o getCachedNode
 public CollectorNode getCachedNode(NodeAddress addr)
Gets a node from the active cache.

Parameters:
addr - the address of a cached node
Returns:
the cached node
 o replaceCachedNode
 public void replaceCachedNode(NodeAddress addr,
                               CollectorNode node)
Replaces a node in the active cache.

Parameters:
addr - the address of a cached node
node - the new node for the specified address
 o findNode
 public CollectorNode findNode(NodeAddress addr)
Finds a node in the nework.

Parameters:
addr - the address of the node to find
Returns:
the existing node or null if not found
 o dumpState
 public void dumpState(FIFO f)
Dumps the current state of this network.

Parameters:
f - where to queue the ModelUpdate objects representing the model's current state
 o getCurrTime
 public static long getCurrTime()
Gets the current CollectorUpdate time.

Returns:
the current CollectorUpdate time
 o acquireLock
 private synchronized boolean acquireLock(NodeAddress node)
Test if lock can be acquired and do so if possible

Returns:
if lock was acquired
 o getLock
 public boolean getLock()
Return status of lock

Returns:
current lock status
 o releaseLock
 private void releaseLock()
Release lock