com.sibvisions.rad.server.config
Class ApplicationZone

java.lang.Object
  extended by com.sibvisions.rad.server.config.UpToDateConfigFile
      extended by com.sibvisions.rad.server.config.Zone
          extended by com.sibvisions.rad.server.config.ApplicationZone

public final class ApplicationZone
extends Zone

The ApplicationZone class encapsulates the access to an application configuration.


Constructor Summary
ApplicationZone(String pApplicationName)
          Creates a new instance of ApplicationZone for an application.
 
Method Summary
 String getName()
          Returns the name of the application.
 List<XmlNode> getNodes(String pName)
          Gets the xml node or a list of nodes for a property name from the application configuration.
 List<String> getProperties(String pName)
          Gets a list of values for a property which exists more than once.
 String getProperty(String pName, String pDefault)
          Gets the value of a property from the application configuration file.
 ServerZone getServerZone()
          Gets the current server zone.
 
Methods inherited from class com.sibvisions.rad.server.config.Zone
getConfig, getDirectory, setUpdateEnabled, update
 
Methods inherited from class com.sibvisions.rad.server.config.UpToDateConfigFile
getContent, getFile, getProperty, isValid, setContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationZone

public ApplicationZone(String pApplicationName)
                throws Exception
Creates a new instance of ApplicationZone for an application. The application configuration will be used from the cached zone. The cache for all zones is the Configuration.

Parameters:
pApplicationName - the name of the application
Throws:
Exception - if the configuration is invalid
Method Detail

getProperty

public String getProperty(String pName,
                          String pDefault)
                   throws Exception
Gets the value of a property from the application configuration file. If the property was not found then the property will be read from the server configuration file.

Overrides:
getProperty in class UpToDateConfigFile
Parameters:
pName - the property name (e.g /application/securitymanager/class)
pDefault - the default value if the property is not available in the application and server configuration
Returns:
the value for the property or pDefault if the property is generally not available
Throws:
Exception - if the configuration(s) is/are invalid

getProperties

public List<String> getProperties(String pName)
                           throws Exception
Gets a list of values for a property which exists more than once. The list will be extended with not already containing server properties.

Overrides:
getProperties in class UpToDateConfigFile
Parameters:
pName - the property name
Returns:
the list of merged values from the application and server configuration or null if the property is generally not available
Throws:
Exception - if the configuration is invalid

getNodes

public List<XmlNode> getNodes(String pName)
                       throws Exception
Gets the xml node or a list of nodes for a property name from the application configuration. The list will be extended if the server configuration contains the same property. The list first contains the server nodes and then the application nodes.

Overrides:
getNodes in class UpToDateConfigFile
Parameters:
pName - the property name
Returns:
the available xml node(s) from the application and server configuration ornull if the property is generally not available
Throws:
Exception - if the configuration(s) is/are invalid

getName

public String getName()
Returns the name of the application.

Returns:
the application name

getServerZone

public ServerZone getServerZone()
Gets the current server zone.

Returns:
the zone of the server or null if the zone has errors
See Also:
ServerZone


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.