Class CollectorStorage

java.lang.Object
   |
   +----CollectorStorage

public class CollectorStorage
extends Object
Provides the storage mechanisms used for CollectorUpdate objects.

Version:
$Revision: 1.5 $, $Date: 2000/10/12 14:09:44 $
Author:
Mike Spengler

Variable Index

 o inName
The name of the input stream if a file
 o ois
The input stream for the Collector
 o oos
The output stream for the Collector
 o outName
The name of the output stream if a file
 o rcount
Running reference count.

Constructor Index

 o CollectorStorage(ConfigMgr)
Class constructor.

Method Index

 o closeIn()
Closes the CollectorUpdate input file.
 o closeOut()
Closes the CollectorUpdate save file.
 o finalize()
Ensures that all CollectorUpdate streams are closed.
 o openIn(ConfigMgr)
Opens the CollectorUpdate input file, if specified.
 o openOut(ConfigMgr)
Opens the CollectorUpdate save file, if specified.
 o readCU()
Reads the next CollectorUpdate object from the input file, if one was specified.
 o usingNetQuery()
Returns true if the CollectorUpdate data is configured to be dynamically acquired from the network.
 o writeCU(CollectorUpdate)
Writes the supplied CollectorUpdate object to the save file, if one was specified.

Variables

 o inName
 public String inName
The name of the input stream if a file

 o outName
 public String outName
The name of the output stream if a file

 o ois
 private ObjectInputStream ois
The input stream for the Collector

 o oos
 private ObjectOutputStream oos
The output stream for the Collector

 o rcount
 private int rcount
Running reference count. Used to force a stream reset periodically to prevent memory problems.

Constructors

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

Parameters:
cm - the configuration manager containing all configuration information for this run
Throws: IOException
if any files couldn't be opened

Methods

 o usingNetQuery
 public boolean usingNetQuery()
Returns true if the CollectorUpdate data is configured to be dynamically acquired from the network.

Returns:
true if the CollectorUpdate data is to be sourced from the network.
 o openIn
 private void openIn(ConfigMgr cm) throws IOException
Opens the CollectorUpdate input file, if specified.

Parameters:
cm - the configuration manager containing all configuration information for this run
Throws: IOException
if the file couldn't be opened
 o readCU
 public CollectorUpdate readCU() throws IOException
Reads the next CollectorUpdate object from the input file, if one was specified.

Returns:
the next CollectorUpdate object read
Throws: IOException
if an I/O error occurs
 o closeIn
 private void closeIn() throws IOException
Closes the CollectorUpdate input file.

Throws: IOException
if an I/O error occurs
 o openOut
 private void openOut(ConfigMgr cm) throws IOException
Opens the CollectorUpdate save file, if specified.

Parameters:
cm - the configuration manager containing all configuration information for this run
Throws: IOException
if the save file couldn't be opened
 o writeCU
 public void writeCU(CollectorUpdate cu) throws IOException
Writes the supplied CollectorUpdate object to the save file, if one was specified.

Parameters:
cu - the CollectorUpdate object to be written
Throws: IOException
if an I/O error occurs
 o closeOut
 private void closeOut() throws IOException
Closes the CollectorUpdate save file.

Throws: IOException
if an I/O error occurs
 o finalize
 protected void finalize() throws IOException
Ensures that all CollectorUpdate streams are closed.

Throws: IOException
if an I/O error occurs
Overrides:
finalize in class Object