All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class VisiModel.ConfigMgr

java.lang.Object
   |
   +----VisiModel.ConfigMgr

public class ConfigMgr
extends Object
Manages all of the configuration file information.

The format of the configuration file line entries is:
Keyword Default value
net <network name> MyNet
collectors <number of collectors> 3
password <password to try> public
node <<dns name>|<ip address>> [<node password>] localhost
collect_input net [save [<directory name>] net [save "."]
collect_input file <file name> -
model_input listen [<port number>] [collectPort]
model_input save [<directory name>] ["."]
log_level <level> 0
mask_addresses <boolean> [0/1|false/true|no/yes]; 0
map <prefix> <mask_name> 0
cycle_time <minutes> 43200
no_new_nodes <boolean> [0/1|false/true|no/yes]; 0
max_depth <count> 10000
switches_only <boolean> [0/1|false/true|no/yes]; 0
find_vccs <boolean> [0/1|false/true|no/yes]; 1

Version:
$Revision: 1.10 $, $Date: 2000/10/31 20:29:44 $
Author:
Mike Spengler, Joseph Thomas

Variable Index

 o collectDst
Disposition of CollectUpdate objects.
 o collectExt
File extension for CollectorUpdate save files.
 o collectPort
Default remote connection port number.
 o collectSrc
Source of Collector data.
 o confName
 o cycleTime
 o findVCCs
 o loglevel
 o map_name
 o map_prefix
 o maskAddresses
 o maxDepth
 o modelDst
Disposition of ModelUpdate objects.
 o modelExt
File extension for ModelUpdate save files.
 o modelPort
Port number to listen for remote connections.
 o nCollectors
 o netName
 o node
 o nodePassword
 o noNewNodes
 o password
 o runName
 o switchesOnly

Constructor Index

 o ConfigMgr(String, String)
Class constructor.

Method Index

 o getCollectDst()
Gets the configured CollectorUpdate destination.
 o getCollectSrc()
Gets the configured CollectorUpdate source.
 o getFindVCCs()
Gets the configured find_vccs value
 o getLogLevel()
Gets the configured log_level
 o getMapNames()
Gets the list of mask_names for address masking.
 o getMapPrefixes()
Gets the list of prefixes for address masking.
 o getMaskAddresses()
Gets the configured mask_addresses value
 o getMaxDepth()
Gets the configured max_depth value
 o getModelDst()
Gets the configured ModelUpdate destination.
 o getModelPort()
Gets the configured port to listen for remote connections.
 o getNCollectors()
Gets the number of requested data collectors
 o getNetName()
Gets the configured network name
 o getNodePasswords()
Gets the list of passwords for the pre-configured network nodes.
 o getNodes()
Gets the list of pre-configured network node addresses
 o getNoNewNodes()
Gets the configured no_new_nodes value
 o getPasswords()
Gets the list of possible network access passwords
 o getRunName()
Gets the configured run name
 o getSwitchesOnly()
Gets the configured switches_only value
 o parse(Reader)
Parses the specified configuration file.
 o parseCollectInput(StreamTokenizer)
Parses a collect_input configuration line.
 o parseCollectors(StreamTokenizer)
Parses a collectors configuration line.
 o parseEOL(StreamTokenizer)
Gets an End-Of-Line from the configuration stream.
 o parseFindVCCs(StreamTokenizer)
Parses the find_vccs value from the configuration stream
 o parseInt(StreamTokenizer, String, boolean)
Gets an integer from the configuration stream.
 o parseLogLevel(StreamTokenizer)
Parses the log_level value from the configuration stream.
 o parseMapping(StreamTokenizer)
Parses the mask_addresses value from the configuration stream.
 o parseMaskAddresses(StreamTokenizer)
Parses the mask_addresses value from the configuration stream.
 o parseMaxDepth(StreamTokenizer)
Parses the max_depth value from the configuration stream
 o parseModelOutput(StreamTokenizer)
Parses a model_output configuration line.
 o parseNet(StreamTokenizer)
Parses a net configuration line.
 o parseNode(StreamTokenizer)
Parses a node configuration line.
 o parseNoNewNodes(StreamTokenizer)
Parses the no_new_nodes value from the configuration stream
 o parsePassword(StreamTokenizer)
Parses a password configuration line.
 o parseSwitchesOnly(StreamTokenizer)
Parses the switches_only value from the configuration stream
 o parseWord(StreamTokenizer, String, boolean)
Gets a word from the configuration stream.
 o setNetName(String)
Overrides the configured network name.

Variables

 o collectExt
 public static final String collectExt
File extension for CollectorUpdate save files.

 o modelExt
 public static final String modelExt
File extension for ModelUpdate save files.

 o collectPort
 private static final int collectPort
Default remote connection port number.

 o confName
 private String confName
 o runName
 private String runName
 o netName
 private String netName
 o nCollectors
 private int nCollectors
 o password
 private Vector password
 o node
 private Vector node
 o nodePassword
 private Vector nodePassword
 o loglevel
 private int loglevel
 o maskAddresses
 private boolean maskAddresses
 o map_prefix
 private Vector map_prefix
 o map_name
 private Vector map_name
 o cycleTime
 private int cycleTime
 o noNewNodes
 private boolean noNewNodes
 o maxDepth
 private int maxDepth
 o switchesOnly
 private boolean switchesOnly
 o findVCCs
 private boolean findVCCs
 o collectSrc
 private String collectSrc
Source of Collector data. If null, then the data will be dynamically acquired from the network. Otherwise, this will be the name of a file containing previously serialized CollectorUpdate objects.

 o collectDst
 private String collectDst
Disposition of CollectUpdate objects. If null, then the objects will be discarded after processing. Otherwise, this will be the name of a directory into which the objects will be serialized. The file name will be the runName with an extension of collectExt.

 o modelPort
 private int modelPort
Port number to listen for remote connections. If 0, then no remote connections will be accepted.

 o modelDst
 private String modelDst
Disposition of ModelUpdate objects. If null, then the objects will be discarded after being sent to any remote connections. Otherwise, this will be the name of a directory into which the objects will be serialized. The file name will be the runName with an extension of modelExt.

Constructors

 o ConfigMgr
 public ConfigMgr(String confName,
                  String runName) throws ConfigException
Class constructor.

Parameters:
confName - the user-supplied configuration name
runName - the user-supplied run name
Throws: ConfigException
if a configuration error occurs

Methods

 o parse
 private void parse(Reader in) throws ConfigException, IOException
Parses the specified configuration file.

Parameters:
in - the configuration file reader
Throws: ConfigException
if a configuration syntax error detected
Throws: IOException
if a configuration file IO error occurs
 o parseNet
 private void parseNet(StreamTokenizer st) throws ConfigException, IOException
Parses a net configuration line.

Parameters:
st - the configuration file token stream
Throws: ConfigException
if a configuration syntax error detected
Throws: IOException
if a configuration file IO error occurs
 o parseCollectors
 private void parseCollectors(StreamTokenizer st) throws ConfigException, IOException
Parses a collectors configuration line.

Parameters:
st - the configuration file token stream
Throws: ConfigException
if a configuration syntax error detected
Throws: IOException
if a configuration file IO error occurs
 o parsePassword
 private void parsePassword(StreamTokenizer st) throws ConfigException, IOException
Parses a password configuration line.

Parameters:
st - the configuration file token stream
Throws: ConfigException
if a configuration syntax error detected
Throws: IOException
if a configuration file IO error occurs
 o parseNode
 private void parseNode(StreamTokenizer st) throws ConfigException, IOException
Parses a node configuration line.

Parameters:
st - the configuration file token stream
Throws: ConfigException
if a configuration syntax error detected
Throws: IOException
if a configuration file IO error occurs
 o parseCollectInput
 private void parseCollectInput(StreamTokenizer st) throws ConfigException, IOException
Parses a collect_input configuration line.

Parameters:
st - the configuration file token stream
Throws: ConfigException
if a configuration syntax error detected
Throws: IOException
if a configuration file IO error occurs
 o parseModelOutput
 private void parseModelOutput(StreamTokenizer st) throws ConfigException, IOException
Parses a model_output configuration line.

Parameters:
st - the configuration file token stream
Throws: ConfigException
if a configuration syntax error detected
Throws: IOException
if a configuration file IO error occurs
 o parseWord
 private String parseWord(StreamTokenizer st,
                          String id,
                          boolean opt) throws ConfigException, IOException
Gets a word from the configuration stream.

Parameters:
st - the configuration file token stream
id - the user identifier for the word
opt - true if the word is optional
Returns:
the parsed word or null if an optional word was not present
Throws: ConfigException
if a configuration syntax error detected
Throws: IOException
if a configuration file IO error occurs
 o parseInt
 private int parseInt(StreamTokenizer st,
                      String id,
                      boolean opt) throws ConfigException, IOException
Gets an integer from the configuration stream.

Parameters:
st - the configuration file token stream
id - the user identifier for the integer
opt - true if the integer is optional
Returns:
the parsed integer or MIN_VALUE if an optional integer was not present
Throws: ConfigException
if a configuration syntax error detected
Throws: IOException
if a configuration file IO error occurs
 o parseEOL
 private void parseEOL(StreamTokenizer st) throws ConfigException, IOException
Gets an End-Of-Line from the configuration stream.

Parameters:
st - the configuration file token stream
Throws: ConfigException
if a configuration syntax error detected
Throws: IOException
if a configuration file IO error occurs
 o parseLogLevel
 private void parseLogLevel(StreamTokenizer st) throws ConfigException, IOException
Parses the log_level value from the configuration stream.

Parameters:
st - the configuration file token stream
Throws: ConfigException
if a configuration syntax error is detected
Throws: IOException
if a configuration file IO error occurs
 o parseMaskAddresses
 private void parseMaskAddresses(StreamTokenizer st) throws ConfigException, IOException
Parses the mask_addresses value from the configuration stream.

Parameters:
st - the configuration file token steam
Throws: ConfigException
if a configuration syntax error is detected
Throws: IOException
if a configuration file IO error occurs
 o parseMapping
 private void parseMapping(StreamTokenizer st) throws ConfigException, IOException
Parses the mask_addresses value from the configuration stream.

Parameters:
st - the configuration file token steam
Throws: ConfigException
if a configuration syntax error is detected
Throws: IOException
if a configuration file IO error occurs
 o parseNoNewNodes
 private void parseNoNewNodes(StreamTokenizer st) throws ConfigException, IOException
Parses the no_new_nodes value from the configuration stream

Parameters:
st - the configuration file token stream
Throws: ConfigException
if a configuration syntax error is detected
Throws: IOException
if a configuration file IO error occurs
 o parseMaxDepth
 private void parseMaxDepth(StreamTokenizer st) throws ConfigException, IOException
Parses the max_depth value from the configuration stream

Parameters:
st - the configuration file token stream
Throws: ConfigException
if a configuration syntax error is detected
Throws: IOException
if a configuration file IO error occurs
 o parseSwitchesOnly
 private void parseSwitchesOnly(StreamTokenizer st) throws ConfigException, IOException
Parses the switches_only value from the configuration stream

Parameters:
st - the configuration file token stream
Throws: ConfigException
if a configuration syntax error is detected
Throws: IOException
if a configuration file IO error occurs
 o parseFindVCCs
 private void parseFindVCCs(StreamTokenizer st) throws ConfigException, IOException
Parses the find_vccs value from the configuration stream

Parameters:
st - the configuration file token stream
Throws: ConfigException
if a configuration syntax error is detected
Throws: IOException
if a configuration file IO error occurs
 o getRunName
 public String getRunName()
Gets the configured run name

Returns:
the run name
 o getNetName
 public String getNetName()
Gets the configured network name

Returns:
the network name
 o setNetName
 public void setNetName(String netName)
Overrides the configured network name. When running from a collector update file with a different network name than the supplied parameter file, a null pointer exception will occur when a VisiDisplay client is attached due to the ModelServerWorker being unable to find the network using the configured name. This method overrides the configured network name with the name from the collector update file.

Parameters:
netName - the network name
 o getNCollectors
 public int getNCollectors()
Gets the number of requested data collectors

Returns:
the requested number of data collectors
 o getPasswords
 public String[] getPasswords()
Gets the list of possible network access passwords

Returns:
an array of possible network access passwords
 o getNodes
 public InetAddress[] getNodes()
Gets the list of pre-configured network node addresses

Returns:
an array of pre-configured network node addresses
 o getNodePasswords
 public String[] getNodePasswords()
Gets the list of passwords for the pre-configured network nodes. If the password for an entry is null, no password is known for the node and the password must be discovered. The returned array is indexed according to the array indexes returned via getNodes.

Returns:
an array of pre-configured network node passwords
 o getCollectSrc
 public String getCollectSrc()
Gets the configured CollectorUpdate source.

Returns:
the configured CollectorUpdate source
 o getCollectDst
 public String getCollectDst()
Gets the configured CollectorUpdate destination.

Returns:
the configured CollectorUpdate destination
 o getModelPort
 public int getModelPort()
Gets the configured port to listen for remote connections.

Returns:
the configured port to listen for remote connections
 o getModelDst
 public String getModelDst()
Gets the configured ModelUpdate destination.

Returns:
the configured ModelUpdate destination
 o getLogLevel
 public int getLogLevel()
Gets the configured log_level

Returns:
the configured log_level
 o getMaskAddresses
 public boolean getMaskAddresses()
Gets the configured mask_addresses value

Returns:
the configured mask_addresses value
 o getMapPrefixes
 public String[] getMapPrefixes()
Gets the list of prefixes for address masking.

Returns:
an array of pre-configured prefixes
 o getMapNames
 public String[] getMapNames()
Gets the list of mask_names for address masking.

Returns:
an array of pre-configured mask_names
 o getNoNewNodes
 public boolean getNoNewNodes()
Gets the configured no_new_nodes value

Returns:
the configured no_new_nodes value
 o getMaxDepth
 public int getMaxDepth()
Gets the configured max_depth value

Returns:
the configured max_depth value
 o getSwitchesOnly
 public boolean getSwitchesOnly()
Gets the configured switches_only value

Returns:
the configured switches_only value
 o getFindVCCs
 public boolean getFindVCCs()
Gets the configured find_vccs value

Returns:
the configured find_vccs value

All Packages  Class Hierarchy  This Package  Previous  Next  Index