Package com.nt.udc.ndk.gui
Class DCNodeConfigData
java.lang.Object
com.nt.udc.ndk.gui.DCNodeConfigData
- All Implemented Interfaces:
ConfigIfc
,Serializable
,Cloneable
- Direct Known Subclasses:
FtpEIConfigData
,FtpFileEIConfigData
,SoapXmlEIConfigData
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
protected Hashtable
Hashtable containing byte arrays representing secondary configuration files.static final String
static final String
static final String
protected boolean
True, if a value has changedstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected String
ID for the node that this DCNodeConfigData Object representsstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected String
Name of the rules file or Class nameprotected byte[]
Rules information for the node that this DCNodeConfigData Object contains configuration information for.static final String
protected String
Name of the file which contains the list of secondary configuration file names.static final String
protected String
Location of the UDC installationprotected boolean
Indicates whether the node should use a rules file or a Classprotected Hashtable
Hashtable that holds all the variablesstatic final String
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor to be used by GUI to create a DCNodeConfigData with initial set of default valuesDCNodeConfigData
(String inUdcHome, String inNodeId) Constructor to be used by NodeManager which is aware of the udcHome and nodeId -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDeviceListPasswordToWallet
(String nodeContext) This method extracts the password from DeviceListVersionOne and adds it to the wallet, specifically for EI SMDR nodeclone()
Deep clone the HashTable (varTable)void
defaultValue
(String name, String value) Sets the default value for the given keyvoid
deleteItem
(String itemName) Removes the given item fromvarTable
boolean
Returns the absolute path name for the backup directory for the node represented by this DCNodeConfigData Object.Returns the absolute path name for the config directory for the node represented by this DCNodeConfigData Object.byte[]
getConfigFile
(String filename) Returns the contents of given secondary configuration file nameReturns the names of secondary configuration files used by this node.boolean
getDirty()
Returns the absolute path name of the rules file containing the "General" information being used for the node associated with this DCNodeConfigData Object.Returns the directory location of the UDC installation.Called by the GUI to retrieve items fromvarTable
Returns the preferred rule set for this nodeReturns the absolute path name of the file containing the preferred rules file names being used for the node associated with this DCNodeConfigData Object.byte[]
Returns the absolute path name of the rules file being used for the node associated with this DCNodeConfigData Object.Returns the name of the rule file.byte[]
getRules()
Returns the set ofString
keys used for setting values of this node.boolean
void
load()
Used by the NodeManager to load the general configuration and rules files into memory.void
load
(boolean getPasswords) protected void
Builds theconfigFiles
Hashtable based on the contents of the "secondary.cfg" file.protected byte[]
Returns the contents of the given configuration filenamevoid
save()
Used by the NodeManager to persist the general configuration and rules files to disk.protected void
Sets the default values for this DCNodeConfigData's general configuration parameters.void
setConfigFile
(String filename, byte[] data) Stores a secondary configuration file in this DCNodeConfigData objectprotected void
Should be overridden by derived classes to set node specific default values.void
setDirty
(boolean d) Sets value ofdirtyFlag
tod
void
setHomeDir
(String inUdcHome) SetsudcHome
.void
Called by the GUI to add items to
.varTable
void
Used by the NodeManager to set the nodeId for the node associated with this DCNodeConfigData Object.void
setPreferredRules
(Vector prefRules) Sets the preferred rule set for this node.void
setRuleClass
(byte[] ruleClass) void
setRuleFileName
(String name) Sets the name of the rule file.void
setRuleFilePathName
(String inRuleFilePathName) Sets the absolute path name of the rules file being used for the node associated with this DCNodeConfigData Object.void
setRules
(byte[] rules) void
setRulesFromClass
(File ruleClassFile, String classString) Reads the contents of the given file and sets the rule name to the given String.void
setRulesFromClass
(String inRuleClassName, String asHostName, int urlPort) Used by the AdminServer to set the given Class file.void
setRulesFromFile
(String inRuleFileName) Used by the AdminServer to read the given rules file.void
setUseFile
(boolean useFile) toString()
protected void
Writes out the secondary configuration files to disk.void
writeDefaultFields
(String nodeContext) This method writes default fields and their values in the general.cfgprotected void
Writes the given byte stream to the given configuration filename
-
Field Details
-
varTable
Hashtable that holds all the variables -
nodeId
ID for the node that this DCNodeConfigData Object represents -
udcHome
Location of the UDC installation -
ruleName
Name of the rules file or Class name -
secFileName
Name of the file which contains the list of secondary configuration file names. -
useFile
protected boolean useFileIndicates whether the node should use a rules file or a Class -
rules
protected byte[] rulesRules information for the node that this DCNodeConfigData Object contains configuration information for. -
dirtyFlag
protected boolean dirtyFlagTrue, if a value has changed -
configFiles
Hashtable containing byte arrays representing secondary configuration files. The hashtable is keyed by the path/name of the file. This provides base-level access to the data for generic purposes while still allowing derived classes access for specific purposes. -
DEBUG
- See Also:
-
DATAFILESIZE
- See Also:
-
PUSHTIME
- See Also:
-
PULLTIME
- See Also:
-
LOGFILESIZE
- See Also:
-
RULESFILE
- See Also:
-
ROUTING
- See Also:
-
ROUTINGATTRIBUTE
- See Also:
-
NUMCHANNELS
- See Also:
-
EXPCHANVALUE
- See Also:
-
EXPCHANVALUE2
- See Also:
-
EXPCHANOPERATOR
- See Also:
-
NUMEXPCHANVALUES
- See Also:
-
NUMEXPCHANVALUES2
- See Also:
-
NARBACKUP
- See Also:
-
BULKIO
- See Also:
-
NARBACKUPDAYS
- See Also:
-
BACKUP
- See Also:
-
ASCODEBASE
- See Also:
-
SECONDARYCFG
- See Also:
-
MONITORINPUT
- See Also:
-
INPUTMONTIME
- See Also:
-
INPUTMONTIMEUNIT
- See Also:
-
RECORDSTATS
- See Also:
-
FILELEVELTRANSACTION
- See Also:
-
DEVICE_LIST_V1
- See Also:
-
VOIP_EI_SMDR
- See Also:
-
-
Constructor Details
-
DCNodeConfigData
public DCNodeConfigData()Constructor to be used by GUI to create a DCNodeConfigData with initial set of default values -
DCNodeConfigData
Constructor to be used by NodeManager which is aware of the udcHome and nodeId- Throws:
IOException
-
-
Method Details
-
getDirty
public boolean getDirty()- Returns:
- value of
dirtyFlag
-
setDirty
public void setDirty(boolean d) Sets value ofdirtyFlag
tod
-
getConfigDir
Returns the absolute path name for the config directory for the node represented by this DCNodeConfigData Object.- Returns:
- Absolute path name for the node's config directory. Default is:
udcHome
/config/nodeId
- Throws:
IOException
- IfudcHome
ornodeId
have not been set.
-
getBackupDir
Returns the absolute path name for the backup directory for the node represented by this DCNodeConfigData Object.- Returns:
- Absolute path name for the node's back up directory. Default is:
udcHome
/backup/nodeId
- Throws:
IOException
- IfudcHome
ornodeId
have not been set.
-
getUseFile
public boolean getUseFile() -
setUseFile
public void setUseFile(boolean useFile) -
getRuleFilePathName
Returns the absolute path name of the rules file being used for the node associated with this DCNodeConfigData Object.- Returns:
- Absolute path name of the rules file. Default is:
invalid input: ' 'getConfigDir()
+File.separator
+ "rules.cfg
". - Throws:
IOException
-
getRuleName
Returns the name of the rule file. Default isrules.cfg
-
setRuleFileName
Sets the name of the rule file. Default isrules.cfg
-
setRuleFilePathName
Sets the absolute path name of the rules file being used for the node associated with this DCNodeConfigData Object.- Parameters:
inRuleFilePathName
- Absolute path name of the rules file.
-
getRules
public byte[] getRules() -
setRules
public void setRules(byte[] rules) -
getRuleClass
public byte[] getRuleClass() -
setRuleClass
public void setRuleClass(byte[] ruleClass) -
getPrefRulesFilePathName
Returns the absolute path name of the file containing the preferred rules file names being used for the node associated with this DCNodeConfigData Object.- Returns:
- Absolute path name of the preferred rules file. Default is:
invalid input: ' 'getConfigDir()
+File.separator
+ "preferredRules.cfg
". - Throws:
IOException
-
getGenConfigFilePathName
Returns the absolute path name of the rules file containing the "General" information being used for the node associated with this DCNodeConfigData Object.- Returns:
- Absolute path name of the General config file. Default is:
invalid input: ' 'getConfigDir()
+File.separator
+ "general.cfg
". - Throws:
IOException
-
defaultValue
Sets the default value for the given key- Parameters:
name
- name of the configuration parametervalue
- default value
-
getHomeDir
Returns the directory location of the UDC installation.- Returns:
- Value of
udcHome
- Throws:
IOException
- IfudcHome
has not been set
-
setHomeDir
SetsudcHome
. This is used by the NodeManager to set the directory location of the UDC installation.- Parameters:
inUdcHome
- Directory where the UDC program is installed
-
setNodeId
Used by the NodeManager to set the nodeId for the node associated with this DCNodeConfigData Object.- Parameters:
inNodeId
- String identifier for the node
-
getNodeId
-
setRulesFromFile
Used by the AdminServer to read the given rules file.- Parameters:
inRuleFileName
- name of the rules file to read- Throws:
IOException
-
setRulesFromClass
Reads the contents of the given file and sets the rule name to the given String.- Parameters:
ruleClassFile
- File object representing the NPL class file to be used.classString
- Name of the Java class forruleClassFile
- Throws:
ClassNotFoundException
-
setRulesFromClass
public void setRulesFromClass(String inRuleClassName, String asHostName, int urlPort) throws ClassNotFoundException Used by the AdminServer to set the given Class file.- Parameters:
inRuleClassName
- name of the Class to load- Throws:
ClassNotFoundException
-
load
Used by the NodeManager to load the general configuration and rules files into memory.
The path for the general config file is always
udcHome/config/nodeId/general.cfg
- Throws:
IOException
- If either the general.cfg orruleName
file could not be read
-
load
- Throws:
IOException
-
save
Used by the NodeManager to persist the general configuration and rules files to disk.
The path for the general config file is always
udcHome/config/nodeId/general.cfg
- Throws:
IOException
- If the config directory does not exist, or either the general.cfg or rules.cfg file could not be written to
-
writeDefaultFields
This method writes default fields and their values in the general.cfg- Parameters:
nodeContext
- is the id used to determine the default fields for any particular cartridge
-
deleteItem
Removes the given item fromvarTable
-
getConfigFileNames
Returns the names of secondary configuration files used by this node.- Returns:
- an
Enumeration
of the filenames - See Also:
-
setConfigFile
Stores a secondary configuration file in this DCNodeConfigData object- Parameters:
filename
- The name of the secondary configuration filedata
- A byte array representing the contenst of the file
-
getConfigFile
Returns the contents of given secondary configuration file name- Parameters:
filename
- name of the secondary configuration file- Returns:
- a
byte[]
representing the contents of the file
-
toString
-
equals
-
getItem
Called by the GUI to retrieve items fromvarTable
-
setItem
-
setPreferredRules
Sets the preferred rule set for this node.
This Vector holds display-name/file-name pairs for the set of rules files that are appropriate for this node given its market segment (which is set at node creation time). The set of rules available to this node are the intersection of the files named in this Vector and the files physically present on disk. The display names are used in the configuration GUI.
Vector format is as follows:
[0] display name 1
When this data is written to and read from disk, it is NOT placed in
[1] file name 1
...
varTable
. Rather, the prefix "preferredRules" is used for each key, and this is stored via a Properties object. -
getPreferredRules
Returns the preferred rule set for this node -
getSettingsKeys
Returns the set ofString
keys used for setting values of this node.- Returns:
- an
Enumeration
of the keys used - See Also:
-
readFile
Returns the contents of the given configuration filename- Returns:
- Contents of
fileSpec
; an empty byte array is returned if the file could not be found. - Throws:
IOException
-
writeFile
Writes the given byte stream to the given configuration filename- Parameters:
outputFile
- Name of the file to write tobytes
- Contents of the file to be written- Throws:
IOException
-
addDeviceListPasswordToWallet
This method extracts the password from DeviceListVersionOne and adds it to the wallet, specifically for EI SMDR node- Parameters:
nodeContext
- is the ID used to determine the node context.deviceList
- a colon-separated string containing device details, including the password to be added to the wallet.
-
setBaseDefaults
protected void setBaseDefaults()Sets the default values for this DCNodeConfigData's general configuration parameters.
These are:
DEBUG = 1
DATAFILESIZE = 2000
PUSHTIME = 60
PULLTIME = 20
LOGFILESIZE = 10000
BACKUP = false
SECONDARYCFG = "secondary.cfg"
-
setDefaults
protected void setDefaults()Should be overridden by derived classes to set node specific default values. Default implementation is empty. -
writeConfigFiles
Writes out the secondary configuration files to disk. The default file location is the value returned bygetConfigDir()
, which is generally the node'sconfig
directory.- Throws:
IOException
-
readConfigFiles
Builds theconfigFiles
Hashtable based on the contents of the "secondary.cfg" file. The "secondary.cfg" file contains a list of all of the filenames originally stored inconfigFiles
. By default, this method assumes that all files were stored in the node'sconfig
directory (the value returned bygetConfigDir()
. If the "secondary.cfg" file does not exist (indicating that no secondary files were designated, then theconfigFiles
Hashtable is initialized to an empty table.- Throws:
IOException
-
clone
Deep clone the HashTable (varTable)
-