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
-
collectDst
- Disposition of
CollectUpdate objects.
-
collectExt
- File extension for
CollectorUpdate save files.
-
collectPort
- Default remote connection port number.
-
collectSrc
- Source of Collector data.
-
confName
-
-
cycleTime
-
-
findVCCs
-
-
loglevel
-
-
map_name
-
-
map_prefix
-
-
maskAddresses
-
-
maxDepth
-
-
modelDst
- Disposition of
ModelUpdate objects.
-
modelExt
- File extension for
ModelUpdate save files.
-
modelPort
- Port number to listen for remote connections.
-
nCollectors
-
-
netName
-
-
node
-
-
nodePassword
-
-
noNewNodes
-
-
password
-
-
runName
-
-
switchesOnly
-
-
ConfigMgr(String, String)
- Class constructor.
-
getCollectDst()
- Gets the configured
CollectorUpdate destination.
-
getCollectSrc()
- Gets the configured
CollectorUpdate source.
-
getFindVCCs()
- Gets the configured find_vccs value
-
getLogLevel()
- Gets the configured log_level
-
getMapNames()
- Gets the list of mask_names for address masking.
-
getMapPrefixes()
- Gets the list of prefixes for address masking.
-
getMaskAddresses()
- Gets the configured mask_addresses value
-
getMaxDepth()
- Gets the configured max_depth value
-
getModelDst()
- Gets the configured
ModelUpdate destination.
-
getModelPort()
- Gets the configured port to listen for remote connections.
-
getNCollectors()
- Gets the number of requested data collectors
-
getNetName()
- Gets the configured network name
-
getNodePasswords()
- Gets the list of passwords for the pre-configured network nodes.
-
getNodes()
- Gets the list of pre-configured network node addresses
-
getNoNewNodes()
- Gets the configured no_new_nodes value
-
getPasswords()
- Gets the list of possible network access passwords
-
getRunName()
- Gets the configured run name
-
getSwitchesOnly()
- Gets the configured switches_only value
-
parse(Reader)
- Parses the specified configuration file.
-
parseCollectInput(StreamTokenizer)
- Parses a
collect_input configuration line.
-
parseCollectors(StreamTokenizer)
- Parses a
collectors configuration line.
-
parseEOL(StreamTokenizer)
- Gets an End-Of-Line from the configuration stream.
-
parseFindVCCs(StreamTokenizer)
- Parses the find_vccs value from the configuration stream
-
parseInt(StreamTokenizer, String, boolean)
- Gets an integer from the configuration stream.
-
parseLogLevel(StreamTokenizer)
- Parses the log_level value from the configuration stream.
-
parseMapping(StreamTokenizer)
- Parses the mask_addresses value from the configuration stream.
-
parseMaskAddresses(StreamTokenizer)
- Parses the mask_addresses value from the configuration stream.
-
parseMaxDepth(StreamTokenizer)
- Parses the max_depth value from the configuration stream
-
parseModelOutput(StreamTokenizer)
- Parses a
model_output configuration line.
-
parseNet(StreamTokenizer)
- Parses a
net configuration line.
-
parseNode(StreamTokenizer)
- Parses a
node configuration line.
-
parseNoNewNodes(StreamTokenizer)
- Parses the no_new_nodes value from the configuration stream
-
parsePassword(StreamTokenizer)
- Parses a
password configuration line.
-
parseSwitchesOnly(StreamTokenizer)
- Parses the switches_only value from the configuration stream
-
parseWord(StreamTokenizer, String, boolean)
- Gets a word from the configuration stream.
-
setNetName(String)
- Overrides the configured network name.
collectExt
public static final String collectExt
- File extension for
CollectorUpdate save files.
modelExt
public static final String modelExt
- File extension for
ModelUpdate save files.
collectPort
private static final int collectPort
- Default remote connection port number.
confName
private String confName
runName
private String runName
netName
private String netName
nCollectors
private int nCollectors
password
private Vector password
node
private Vector node
nodePassword
private Vector nodePassword
loglevel
private int loglevel
maskAddresses
private boolean maskAddresses
map_prefix
private Vector map_prefix
map_name
private Vector map_name
cycleTime
private int cycleTime
noNewNodes
private boolean noNewNodes
maxDepth
private int maxDepth
switchesOnly
private boolean switchesOnly
findVCCs
private boolean findVCCs
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.
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.
modelPort
private int modelPort
- Port number to listen for remote connections. If
0, then
no remote connections will be accepted.
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
getRunName
public String getRunName()
- Gets the configured run name
- Returns:
- the run name
getNetName
public String getNetName()
- Gets the configured network name
- Returns:
- the network name
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
getNCollectors
public int getNCollectors()
- Gets the number of requested data collectors
- Returns:
- the requested number of data collectors
getPasswords
public String[] getPasswords()
- Gets the list of possible network access passwords
- Returns:
- an array of possible network access passwords
getNodes
public InetAddress[] getNodes()
- Gets the list of pre-configured network node addresses
- Returns:
- an array of pre-configured network node addresses
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
getCollectSrc
public String getCollectSrc()
- Gets the configured
CollectorUpdate source.
- Returns:
- the configured
CollectorUpdate source
getCollectDst
public String getCollectDst()
- Gets the configured
CollectorUpdate destination.
- Returns:
- the configured
CollectorUpdate destination
getModelPort
public int getModelPort()
- Gets the configured port to listen for remote connections.
- Returns:
- the configured port to listen for remote connections
getModelDst
public String getModelDst()
- Gets the configured
ModelUpdate destination.
- Returns:
- the configured
ModelUpdate destination
getLogLevel
public int getLogLevel()
- Gets the configured log_level
- Returns:
- the configured log_level
getMaskAddresses
public boolean getMaskAddresses()
- Gets the configured mask_addresses value
- Returns:
- the configured mask_addresses value
getMapPrefixes
public String[] getMapPrefixes()
- Gets the list of prefixes for address masking.
- Returns:
- an array of pre-configured prefixes
getMapNames
public String[] getMapNames()
- Gets the list of mask_names for address masking.
- Returns:
- an array of pre-configured mask_names
getNoNewNodes
public boolean getNoNewNodes()
- Gets the configured no_new_nodes value
- Returns:
- the configured no_new_nodes value
getMaxDepth
public int getMaxDepth()
- Gets the configured max_depth value
- Returns:
- the configured max_depth value
getSwitchesOnly
public boolean getSwitchesOnly()
- Gets the configured switches_only value
- Returns:
- the configured switches_only value
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