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
-
aliasList
- The list of names which are alises for a host in our work queue
-
ca
- Pointer to CollectorAnalyzer for this run
-
cm
- Pointer to ConfigManager for this run
-
cs
- Pointer to CollectorStorage manager for this run
-
dcNewQ
- The FIFO queue containing new nodes to be queried by a collection thread
-
dcOldQ
- The FIFO queue containing old nodes to be queried by a collection thread
-
findVCCs
- Look for VCC segments
-
hostList
- The list of host that will be in our work queue
-
maxDepth
- Maximum depth work queue should be allowed to grow to
-
net
- Pointer to the ATMNetwork which represents this run
-
noMoreNodes
- Should we add any nodes beyonds what's listed in the config file?
-
nWorkers
- The number of data collection threads assigned to this run
-
oos
-
-
outName
- Stream for writing SNMP data
-
rcount
-
-
switchesOnly
- Only query nodes which report to be switches
-
worker
- Pointer to worker threads which handle the data collection for nodes
-
DataCollector(ConfigMgr)
- Class constructor.
-
addAlias(IPAddress)
- Add the specified IP address to the alias list.
-
addHost(HostEntry)
- Unconditionally add this HostEntry on the work queue.
-
addNewHost(String)
- Check if the host is a member of the list being checked.
-
addNewHost(String, String)
- Check if the host is a member of the list being checked.
-
closeOut()
- Close SNMP output stream
-
deleteNew(HostEntry)
- Delete an entry from the New FIFO queue.
-
deleteOld(HostEntry)
- Delete an entry from the Old FIFO queue.
-
finalize()
- Close the output stream on exit
-
getAddrExists(String)
- Determine if an address exists in hostList.
-
getFindVCCs()
- Get the value of find_vccs
-
getHostEntry()
- Dequeue an entry from the work queue and return it to caller.
-
getNet()
- Return the net associated with this instance.
-
getNewQueueIteration()
- Return an enumeration of the new FIFO queue.
-
getOldQueueIteration()
- Return an enumeration of the old FIFO queue.
-
getPasswords()
- Return the ConfigMgr's list of passwords
-
getSwitchesOnly()
- Get the value of the switches_only parameter
-
getWorker(int)
- Return the N'th worker process
-
newQueueSize()
- Get ths number of components currently on the processing queue
-
oldQueueSize()
- Get ths number of components currently on the processing queue
-
openOut()
- Open an output stream for writing SNMP traces
-
run()
- Collects all of the
CollectorUpdate data.
-
runFromFile()
- Collects data from the configured file.
-
runFromNet()
- Collects data from the configured network.
-
writeSU(Object, Object)
- Write an SNMP trace
cs
private CollectorStorage cs
- Pointer to CollectorStorage manager for this run
ca
private CollectorAnalyzer ca
- Pointer to CollectorAnalyzer for this run
cm
private ConfigMgr cm
- Pointer to ConfigManager for this run
worker
private DataCollectorWorker worker[]
- Pointer to worker threads which handle the data collection for nodes
nWorkers
private int nWorkers
- The number of data collection threads assigned to this run
dcNewQ
private FIFO dcNewQ
- The FIFO queue containing new nodes to be queried by a collection thread
dcOldQ
private FIFO dcOldQ
- The FIFO queue containing old nodes to be queried by a collection thread
hostList
private Vector hostList
- The list of host that will be in our work queue
aliasList
private Vector aliasList
- The list of names which are alises for a host in our work queue
net
private ATMNetwork net
- Pointer to the ATMNetwork which represents this run
noMoreNodes
private boolean noMoreNodes
- Should we add any nodes beyonds what's listed in the config file?
maxDepth
private int maxDepth
- Maximum depth work queue should be allowed to grow to
switchesOnly
private boolean switchesOnly
- Only query nodes which report to be switches
findVCCs
private boolean findVCCs
- Look for VCC segments
outName
private String outName
- Stream for writing SNMP data
oos
private ObjectOutputStream oos
rcount
private int rcount
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
run
public void run()
- Collects all of the
CollectorUpdate data.
- Overrides:
- run in class Thread
runFromNet
private void runFromNet()
- Collects data from the configured network. Manages all of the
DataCollectorWorkers.
runFromFile
private void runFromFile()
- Collects data from the configured file.
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
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
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.
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
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
getHostEntry
public HostEntry getHostEntry()
- Dequeue an entry from the work queue and return it to caller.
Caller needs to handle any/all exceptions.
getPasswords
public String[] getPasswords()
- Return the ConfigMgr's list of passwords
getNet
public ATMNetwork getNet()
- Return the net associated with this instance.
- Returns:
- the net for this run
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
getNewQueueIteration
public Enumeration getNewQueueIteration()
- Return an enumeration of the new FIFO queue.
- Returns:
- the queue enumeration
getOldQueueIteration
public Enumeration getOldQueueIteration()
- Return an enumeration of the old FIFO queue.
- Returns:
- the queue enumeration
deleteNew
public void deleteNew(HostEntry host)
- Delete an entry from the New FIFO queue.
- Parameters:
- host - Entry to be deleted
deleteOld
public void deleteOld(HostEntry host)
- Delete an entry from the Old FIFO queue.
- Parameters:
- host - Entry to be deleted
newQueueSize
public int newQueueSize()
- Get ths number of components currently on the processing queue
- Returns:
- the count of components on the processing queue
oldQueueSize
public int oldQueueSize()
- Get ths number of components currently on the processing queue
- Returns:
- the count of components on the processing queue
getSwitchesOnly
public boolean getSwitchesOnly()
- Get the value of the switches_only parameter
- Returns:
- the vaule of switches_only
getFindVCCs
public boolean getFindVCCs()
- Get the value of find_vccs
- Returns:
- the value of find_vccs
openOut
private void openOut() throws IOException
- Open an output stream for writing SNMP traces
writeSU
public synchronized void writeSU(Object ob1,
Object ob2) throws IOException
- Write an SNMP trace
closeOut
private void closeOut() throws IOException
- Close SNMP output stream
finalize
protected void finalize() throws IOException
- Close the output stream on exit
- Overrides:
- finalize in class Object