Class DataCollector

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----DataCollector

public class DataCollector
extends Thread
Acquires the data for generating all CollectorUpdate objects.

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

Variable Index

 o aliasList
The list of names which are alises for a host in our work queue
 o ca
Pointer to CollectorAnalyzer for this run
 o cm
Pointer to ConfigManager for this run
 o cs
Pointer to CollectorStorage manager for this run
 o dcNewQ
The FIFO queue containing new nodes to be queried by a collection thread
 o dcOldQ
The FIFO queue containing old nodes to be queried by a collection thread
 o findVCCs
Look for VCC segments
 o hostList
The list of host that will be in our work queue
 o maxDepth
Maximum depth work queue should be allowed to grow to
 o net
Pointer to the ATMNetwork which represents this run
 o noMoreNodes
Should we add any nodes beyonds what's listed in the config file?
 o nWorkers
The number of data collection threads assigned to this run
 o oos
 o outName
Stream for writing SNMP data
 o rcount
 o switchesOnly
Only query nodes which report to be switches
 o worker
Pointer to worker threads which handle the data collection for nodes

Constructor Index

 o DataCollector(ConfigMgr)
Class constructor.

Method Index

 o addAlias(IPAddress)
Add the specified IP address to the alias list.
 o addHost(HostEntry)
Unconditionally add this HostEntry on the work queue.
 o addNewHost(String)
Check if the host is a member of the list being checked.
 o addNewHost(String, String)
Check if the host is a member of the list being checked.
 o closeOut()
Close SNMP output stream
 o deleteNew(HostEntry)
Delete an entry from the New FIFO queue.
 o deleteOld(HostEntry)
Delete an entry from the Old FIFO queue.
 o finalize()
Close the output stream on exit
 o getAddrExists(String)
Determine if an address exists in hostList.
 o getFindVCCs()
Get the value of find_vccs
 o getHostEntry()
Dequeue an entry from the work queue and return it to caller.
 o getNet()
Return the net associated with this instance.
 o getNewQueueIteration()
Return an enumeration of the new FIFO queue.
 o getOldQueueIteration()
Return an enumeration of the old FIFO queue.
 o getPasswords()
Return the ConfigMgr's list of passwords
 o getSwitchesOnly()
Get the value of the switches_only parameter
 o getWorker(int)
Return the N'th worker process
 o newQueueSize()
Get ths number of components currently on the processing queue
 o oldQueueSize()
Get ths number of components currently on the processing queue
 o openOut()
Open an output stream for writing SNMP traces
 o run()
Collects all of the CollectorUpdate data.
 o runFromFile()
Collects data from the configured file.
 o runFromNet()
Collects data from the configured network.
 o writeSU(Object, Object)
Write an SNMP trace

Variables

 o cs
 private CollectorStorage cs
Pointer to CollectorStorage manager for this run

 o ca
 private CollectorAnalyzer ca
Pointer to CollectorAnalyzer for this run

 o cm
 private ConfigMgr cm
Pointer to ConfigManager for this run

 o worker
 private DataCollectorWorker worker[]
Pointer to worker threads which handle the data collection for nodes

 o nWorkers
 private int nWorkers
The number of data collection threads assigned to this run

 o dcNewQ
 private FIFO dcNewQ
The FIFO queue containing new nodes to be queried by a collection thread

 o dcOldQ
 private FIFO dcOldQ
The FIFO queue containing old nodes to be queried by a collection thread

 o hostList
 private Vector hostList
The list of host that will be in our work queue

 o aliasList
 private Vector aliasList
The list of names which are alises for a host in our work queue

 o net
 private ATMNetwork net
Pointer to the ATMNetwork which represents this run

 o noMoreNodes
 private boolean noMoreNodes
Should we add any nodes beyonds what's listed in the config file?

 o maxDepth
 private int maxDepth
Maximum depth work queue should be allowed to grow to

 o switchesOnly
 private boolean switchesOnly
Only query nodes which report to be switches

 o findVCCs
 private boolean findVCCs
Look for VCC segments

 o outName
 private String outName
Stream for writing SNMP data

 o oos
 private ObjectOutputStream oos
 o rcount
 private int rcount

Constructors

 o DataCollector
 public DataCollector(ConfigMgr cm) throws IOException
Class constructor.

Parameters:
cm - the configuration manager containing all configuration information for this run
Throws: IOException
if any I/O error occurs

Methods

 o run
 public void run()
Collects all of the CollectorUpdate data.

Overrides:
run in class Thread
 o runFromNet
 private void runFromNet()
Collects data from the configured network. Manages all of the DataCollectorWorkers.

 o runFromFile
 private void runFromFile()
Collects data from the configured file.

 o addNewHost
 public int addNewHost(String host)
Check if the host is a member of the list being checked. If not, add it.

Parameters:
host - The string form of the host name
 o addNewHost
 public int addNewHost(String host,
                       String password)
Check if the host is a member of the list being checked. If not, add it.

Parameters:
host - The string form of the host name
password - The string representing the SNMP community name
 o addHost
 public void addHost(HostEntry host)
Unconditionally add this HostEntry on the work queue. Typically called at the end of the DataCollectorWorker process.

Parameters:
host - The HostEntry object identifying this host.
 o addAlias
 public void addAlias(IPAddress iaddr)
Add the specified IP address to the alias list. Adds the specified IP address to the alias list which is checked when deciding if newly discvoered hosts should be added to the query list.

Parameters:
iaddr - The IPAddress object of the address to be added
 o getAddrExists
 public boolean getAddrExists(String addr)
Determine if an address exists in hostList.

Parameters:
addr - the address to look for
Returns:
existance of addr in hostList
 o getHostEntry
 public HostEntry getHostEntry()
Dequeue an entry from the work queue and return it to caller. Caller needs to handle any/all exceptions.

 o getPasswords
 public String[] getPasswords()
Return the ConfigMgr's list of passwords

 o getNet
 public ATMNetwork getNet()
Return the net associated with this instance.

Returns:
the net for this run
 o getWorker
 public DataCollectorWorker getWorker(int n)
Return the N'th worker process

Parameters:
n - the worker process to get
Returns:
pointer to the worker process
 o getNewQueueIteration
 public Enumeration getNewQueueIteration()
Return an enumeration of the new FIFO queue.

Returns:
the queue enumeration
 o getOldQueueIteration
 public Enumeration getOldQueueIteration()
Return an enumeration of the old FIFO queue.

Returns:
the queue enumeration
 o deleteNew
 public void deleteNew(HostEntry host)
Delete an entry from the New FIFO queue.

Parameters:
host - Entry to be deleted
 o deleteOld
 public void deleteOld(HostEntry host)
Delete an entry from the Old FIFO queue.

Parameters:
host - Entry to be deleted
 o newQueueSize
 public int newQueueSize()
Get ths number of components currently on the processing queue

Returns:
the count of components on the processing queue
 o oldQueueSize
 public int oldQueueSize()
Get ths number of components currently on the processing queue

Returns:
the count of components on the processing queue
 o getSwitchesOnly
 public boolean getSwitchesOnly()
Get the value of the switches_only parameter

Returns:
the vaule of switches_only
 o getFindVCCs
 public boolean getFindVCCs()
Get the value of find_vccs

Returns:
the value of find_vccs
 o openOut
 private void openOut() throws IOException
Open an output stream for writing SNMP traces

 o writeSU
 public synchronized void writeSU(Object ob1,
                                  Object ob2) throws IOException
Write an SNMP trace

 o closeOut
 private void closeOut() throws IOException
Close SNMP output stream

 o finalize
 protected void finalize() throws IOException
Close the output stream on exit

Overrides:
finalize in class Object