com.vhosting.netconf
Class Config

java.lang.Object
  extended by com.vhosting.netconf.Config

public class Config
extends java.lang.Object

This class provides the elements to modify, add or remove information between the configuration data.

Version:
1.00, 02/11/2010
Author:
Giuseppe Palmeri

Constructor Summary
Config(Anyxml anyxml, Capability cap, java.lang.String config, java.lang.String... values)
          Create the instance of the class with which to provide instructions for changing the configuration data.
 
Method Summary
 org.w3c.dom.Document createAnyxmlValue()
          Create a valid XML document as an argument for the Anyxml element passed to the constructor.
 Capability getCapability()
          Get the capability that owns this configuration.
 java.lang.String getConfig()
          Get the configuration string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Config

public Config(Anyxml anyxml,
              Capability cap,
              java.lang.String config,
              java.lang.String... values)
Create the instance of the class with which to provide instructions for changing the configuration data. A string configuration is a special string that allows you to instruct the server how to change the configuration data.

 < _nodes > [ '|' _nodes ]*
 
 Where:
 
 _nodes = < _node > [ ';' _node ]*
 
 Where:
 
 _node = node-name [ [ '=' value ] | [ '{' < 'merge' | 'replace' | 'create' | 'delete' > '}' ] ]
 
 
 Legend:
 <> = mandatory;
 [] = optional;
 * = 0 or more times;
 
 You can use variables inside and will be replaced by 
 the sight of the values passed as the second argument.
 This ensures the integrity of information entered into the filter.
 The variables are identified as:
 $n where n = 1 to the number of values passed.
 
 
 Examples:
 
 new Config(anyxml, cap, "interfaces/interface{replace}/name=eth0;description=$1", "New eth0 description");
 
 Result: interfaces/interface{replace}/name=eth0;description=New eth0 description
 
 
 This configuration string is calling for changes in scope of the 
 interfaces, the description of the interface eth0 with the new 
 value "New eth0 description".
 

Parameters:
anyxml - An Anyxml element for which the configuration should be valid.
cap - The capability of the data to set.
config - The config string.
values - A set of values that are encoded and introduced into the filter through the corresponding variables.
Method Detail

getConfig

public java.lang.String getConfig()
Get the configuration string.

Returns:
The configuration string.

getCapability

public Capability getCapability()
Get the capability that owns this configuration.

Returns:
The capability that owns this configuration.

createAnyxmlValue

public org.w3c.dom.Document createAnyxmlValue()
Create a valid XML document as an argument for the Anyxml element passed to the constructor.

Returns:
The XML document.