public class AthosConfigModel extends java.lang.Object implements AthosConfigModelIF
Modifier and Type | Class and Description |
---|---|
protected class |
AthosConfigModel.ReturnNodeList
Get product element.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.Vector |
pListeners |
protected java.util.HashMap |
propListeners |
protected java.lang.Object |
ref |
protected org.w3c.dom.Document |
theDocument |
protected java.util.HashMap |
vetoListeners |
protected java.util.Vector |
vListeners |
protected XMLConfiguration |
xmlConfig |
Constructor and Description |
---|
AthosConfigModel(java.lang.Object ref)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a property change listener.
|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener l)
Add a property change listener for a specific property.
|
org.w3c.dom.Element |
addService(org.w3c.dom.Element pattern,
java.lang.String name,
org.w3c.dom.NodeList appNodeList)
Add service.
|
void |
addVetoableChangeListener(java.lang.String propertyName,
java.beans.VetoableChangeListener l)
Add a veto change listener for a specific property.
|
void |
addVetoableChangeListener(java.beans.VetoableChangeListener l)
Add a veto change listener.
|
protected static boolean |
booleanValue(java.lang.String value) |
org.w3c.dom.NodeList |
checkConsistence()
check the consistence
|
void |
checkConsistence(AthosConfigModel.ReturnNodeList ret,
org.w3c.dom.Element node)
check the consistence of a single element.
|
protected void |
createDoc(org.w3c.dom.Document iniDoc)
Create a document that has a INI as source.
|
void |
extend(org.w3c.dom.Node serviceNode,
org.w3c.dom.Node application)
Extends the given product/service node is to be used for the given application node.
|
protected void |
firePropertyChange(java.lang.String propName,
java.lang.Object oldValue,
java.lang.Object newValue)
Fire a property change event.
|
protected void |
fireVetoableChange(java.lang.String propName,
java.lang.Object oldValue,
java.lang.Object newValue)
Fire a vetoable change event.
|
org.w3c.dom.NodeList |
getAvailableApplications()
Get an array of available application product.
|
org.w3c.dom.NodeList |
getAvailableProducts()
Get an array of available product description attributes.
|
org.w3c.dom.Document |
getDocument()
Get the document.
|
GUIFactoryIF |
getFactory()
Get the factory that creates the GUI elements.
|
java.lang.String |
getFilename()
Get the filename of the configuration.
|
org.w3c.dom.Element |
getGlobal()
Get the global node.
|
org.w3c.dom.NodeList |
getNoneDriverNodes()
Get an array of non driver nodes.
|
org.w3c.dom.Element |
getProduct(org.w3c.dom.NodeList products,
java.lang.String driverName)
Get an array of available product description attributes.
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String def)
Get a string property.
|
java.beans.PropertyChangeListener[] |
getPropertyChangepListeners()
Returns an array of all the property change listeners registered on this model.
|
java.beans.VetoableChangeListener[] |
getVetoableChangepListeners()
Returns an array of all the vetoable change listeners registered on this model.
|
static boolean |
hasToBeEncoded(org.w3c.dom.Element variable)
Return a boolean whether the element should be defined via the system environment.
|
protected boolean |
hasVariable(org.w3c.dom.NodeList nodeList,
java.lang.String name) |
boolean |
isDesignedFor(org.w3c.dom.Node serviceNode,
org.w3c.dom.Node application)
Get a boolean whether the given node is designed for the given application node.
|
static boolean |
isEnvironment(org.w3c.dom.Element variable)
Return a boolean whether the element should be defined via the system environment.
|
static boolean |
isGlobal(org.w3c.dom.Element variable)
Return a boolean whether the element is global in INI file.
|
static boolean |
isINI(org.w3c.dom.Element variable)
Return a boolean whether the element should be defined in INI file.
|
static boolean |
isObligatory(org.w3c.dom.Element variable)
Return a boolean whether the element is obligatory.
|
static void |
main(java.lang.String[] args)
The main testing routine.
|
void |
newConfig()
Create a new configuration.
|
void |
openFile(java.io.File file)
Open an INI file.
|
void |
openFile(java.lang.String filename)
Open an INI file.
|
void |
reduce(org.w3c.dom.Node serviceNode,
org.w3c.dom.Node application,
org.w3c.dom.NodeList otherApp)
Remove the given application dependencies from given product/service node.
|
void |
reduceApplicationAttributes(org.w3c.dom.Node serviceNode,
org.w3c.dom.Node application,
org.w3c.dom.NodeList otherApp)
Remove the given application dependencies from given product/service node.
|
protected void |
removeEnvironment(org.w3c.dom.Node product)
Remove envinroment from product node.
|
protected void |
removeGlobal(org.w3c.dom.Node node)
Remove global variable from node.
|
protected void |
removeLocal(org.w3c.dom.Node node)
Remove local variable from node.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove a property change listener.
|
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener l)
Remove a property change listener for a specific property.
|
void |
removeVetoableChangeListener(java.lang.String propertyName,
java.beans.VetoableChangeListener l)
Remove a vetoable change listener for a specific property.
|
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener l)
Remove a vetoable change listener.
|
void |
saveFile(java.io.File file)
Save an INI file.
|
void |
saveFile(java.lang.String filename)
Save the INI file.
|
void |
setDocument(org.w3c.dom.Document doc)
Set the document.
|
void |
setFilename(java.lang.String filename)
Set the name of the INI file.
|
protected java.util.Vector pListeners
protected java.util.HashMap propListeners
protected java.util.Vector vListeners
protected java.util.HashMap vetoListeners
protected org.w3c.dom.Document theDocument
protected XMLConfiguration xmlConfig
protected java.lang.Object ref
public AthosConfigModel(java.lang.Object ref) throws java.lang.Exception
java.lang.Exception
public void newConfig()
newConfig
in interface AthosConfigModelIF
public java.lang.String getProperty(java.lang.String key, java.lang.String def)
getProperty
in interface AthosConfigModelIF
key
- the property keyword.def
- the default value.public GUIFactoryIF getFactory()
getFactory
in interface AthosConfigModelIF
public org.w3c.dom.Document getDocument()
getDocument
in interface AthosConfigModelIF
public void setFilename(java.lang.String filename) throws java.lang.Exception
java.lang.Exception
public void setDocument(org.w3c.dom.Document doc)
doc
- the document.public void openFile(java.lang.String filename) throws java.lang.Exception
openFile
in interface AthosConfigModelIF
filename
- the name of the file to be opened.java.lang.Exception
public void openFile(java.io.File file) throws java.lang.Exception
openFile
in interface AthosConfigModelIF
file
- the file descriptor of the file to be opened.java.lang.Exception
public void saveFile(java.lang.String filename) throws java.lang.Exception
saveFile
in interface AthosConfigModelIF
filename
- the name of the file to be saved.java.lang.Exception
public void saveFile(java.io.File file) throws java.lang.Exception
saveFile
in interface AthosConfigModelIF
file
- the file descriptor of the file to be saved.java.lang.Exception
public org.w3c.dom.Element getGlobal()
getGlobal
in interface AthosConfigModelIF
public org.w3c.dom.Element addService(org.w3c.dom.Element pattern, java.lang.String name, org.w3c.dom.NodeList appNodeList)
addService
in interface AthosConfigModelIF
pattern
- the product node that should be added.name
- the name of the new service.public org.w3c.dom.Element getProduct(org.w3c.dom.NodeList products, java.lang.String driverName) throws java.lang.Exception
java.lang.Exception
public org.w3c.dom.NodeList getAvailableProducts() throws java.lang.Exception
getAvailableProducts
in interface AthosConfigModelIF
java.lang.Exception
public org.w3c.dom.NodeList getNoneDriverNodes() throws java.lang.Exception
getNoneDriverNodes
in interface AthosConfigModelIF
java.lang.Exception
public org.w3c.dom.NodeList getAvailableApplications() throws java.lang.Exception
getAvailableApplications
in interface AthosConfigModelIF
java.lang.Exception
public void extend(org.w3c.dom.Node serviceNode, org.w3c.dom.Node application)
extend
in interface AthosConfigModelIF
protected void removeEnvironment(org.w3c.dom.Node product)
protected void removeLocal(org.w3c.dom.Node node)
protected void removeGlobal(org.w3c.dom.Node node)
public void reduce(org.w3c.dom.Node serviceNode, org.w3c.dom.Node application, org.w3c.dom.NodeList otherApp)
reduce
in interface AthosConfigModelIF
public void reduceApplicationAttributes(org.w3c.dom.Node serviceNode, org.w3c.dom.Node application, org.w3c.dom.NodeList otherApp)
public boolean isDesignedFor(org.w3c.dom.Node serviceNode, org.w3c.dom.Node application) throws java.lang.Exception
isDesignedFor
in interface AthosConfigModelIF
java.lang.Exception
public static boolean isObligatory(org.w3c.dom.Element variable)
public static boolean hasToBeEncoded(org.w3c.dom.Element variable)
public static boolean isEnvironment(org.w3c.dom.Element variable)
public static boolean isGlobal(org.w3c.dom.Element variable)
public static boolean isINI(org.w3c.dom.Element variable)
protected boolean hasVariable(org.w3c.dom.NodeList nodeList, java.lang.String name)
public org.w3c.dom.NodeList checkConsistence()
checkConsistence
in interface AthosConfigModelIF
public void checkConsistence(AthosConfigModel.ReturnNodeList ret, org.w3c.dom.Element node)
public java.lang.String getFilename()
getFilename
in interface AthosConfigModelIF
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l
- the listenerpublic void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
propertyName
- the name of the property.l
- the listenerpublic java.beans.PropertyChangeListener[] getPropertyChangepListeners()
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
l
- the listenerpublic void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
propertyName
- the name of the property.l
- the listenerprotected void firePropertyChange(java.lang.String propName, java.lang.Object oldValue, java.lang.Object newValue)
propertyName
- the property nameoldValue
- theold value.newValue
- the new valuepublic void addVetoableChangeListener(java.beans.VetoableChangeListener l)
l
- the listenerpublic void addVetoableChangeListener(java.lang.String propertyName, java.beans.VetoableChangeListener l)
propertyName
- the name of the property.l
- the listenerpublic java.beans.VetoableChangeListener[] getVetoableChangepListeners()
public void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
l
- the listenerpublic void removeVetoableChangeListener(java.lang.String propertyName, java.beans.VetoableChangeListener l)
propertyName
- the name of the property.l
- the listenerprotected void fireVetoableChange(java.lang.String propName, java.lang.Object oldValue, java.lang.Object newValue) throws java.beans.PropertyVetoException
propertyName
- the property nameoldValue
- theold value.newValue
- the new valuejava.beans.PropertyVetoException
protected static boolean booleanValue(java.lang.String value)
protected void createDoc(org.w3c.dom.Document iniDoc) throws java.lang.Exception
java.lang.Exception
public static void main(java.lang.String[] args)
args
- The runtime parameters.