com.vhosting.netconf
Class EditConfig

java.lang.Object
  extended by com.vhosting.netconf.Operation
      extended by com.vhosting.netconf.EditConfig

public class EditConfig
extends Operation

The edit-config Netconf operation. This operation loads all or part of a specified configuration to the specified target configuration. This operation allows the new configuration to be expressed in several ways, such as using a local file, a remote file, or inline. If the target configuration does not exist, it will be created. The device analyzes the source and target configurations and performs the requested changes. Supported server capabilities:

 urn:ietf:params:netconf:base:1.0
 urn:ietf:params:netconf:capability:url:1.0
 urn:ietf:params:netconf:capability:writable-running:1.0
 urn:ietf:params:netconf:capability:candidate:1.0
 urn:ietf:params:netconf:capability:validate:1.0
 urn:ietf:params:netconf:capability:rollback-on-error:1.0
 
 

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

Nested Class Summary
static class EditConfig.DefaultEditOperation
          This enumeration lists each type of operation by default when editing configuration data.
static class EditConfig.ErrorOption
          This enumeration lists all kinds of error options.
static class EditConfig.TestOption
          This enumeration lists all kinds of tests that can be undertaken during the editing of the configuration data.
 
Nested classes/interfaces inherited from class com.vhosting.netconf.Operation
Operation.Reply
 
Field Summary
 
Fields inherited from class com.vhosting.netconf.Operation
operation, session
 
Constructor Summary
EditConfig(Session session, Datastore target, Config config)
          Create the edit-config Netconf operation.
EditConfig(Session session, Datastore target, Config config, EditConfig.DefaultEditOperation defop)
          Create the edit-config Netconf operation.
EditConfig(Session session, Datastore target, java.net.URL config)
          Create the edit-config Netconf operation.
EditConfig(Session session, Datastore target, java.net.URL config, EditConfig.DefaultEditOperation defop)
          Create the edit-config Netconf operation.
 
Method Summary
static Config createConfig(Capability cap, java.lang.String config, java.lang.String... values)
          Create an instance of Config for use with the operation.
 void setErrorOption(EditConfig.ErrorOption option)
          Set the error option.
 void setTestOption(EditConfig.TestOption option)
          Set the test option on the transaction.
 
Methods inherited from class com.vhosting.netconf.Operation
execute, execute, executeSync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditConfig

public EditConfig(Session session,
                  Datastore target,
                  java.net.URL config,
                  EditConfig.DefaultEditOperation defop)
           throws CapabilityException,
                  java.lang.IllegalArgumentException
Create the edit-config Netconf operation. Allows you to specify configuration data through a URL. Allows you to specify a default operation on the data.

Parameters:
session - The active session.
target - The target Container.
config - The URL of the data configuration.
defop - The default edit operation.
Throws:
CapabilityException - Throw this exception if the server does not have the :url:1.0 capability. Throw this exception if the server does not have the :candidate:1.0 capability and the source container is 'candidate', also. Similarly, throw this exception if the server does not have the :writable-running:1.0 capability and the source container is 'running'.
java.lang.IllegalArgumentException - Throw this exception if the URL specified not have a file: schema.

EditConfig

public EditConfig(Session session,
                  Datastore target,
                  java.net.URL config)
           throws CapabilityException,
                  java.lang.IllegalArgumentException
Create the edit-config Netconf operation. Allows you to specify configuration data through a URL.

Parameters:
session - The active session.
target - The target Container.
config - The URL of the data configuration.
Throws:
CapabilityException - Throw this exception if the server does not have the :url:1.0 capability. Throw this exception if the server does not have the :candidate:1.0 capability and the source container is 'candidate', also. Similarly, throw this exception if the server does not have the :writable-running:1.0 capability and the source container is 'running'.
java.lang.IllegalArgumentException - Throw this exception if the URL specified not have a file: schema.

EditConfig

public EditConfig(Session session,
                  Datastore target,
                  Config config,
                  EditConfig.DefaultEditOperation defop)
           throws CapabilityException
Create the edit-config Netconf operation.

Parameters:
session - The active session.
target - The target Container.
config - The configuration data.
defop - The default edit operation.
Throws:
CapabilityException - Throw this exception if the server does not have the :candidate:1.0 capability and the source container is 'candidate', also. Similarly, throw this exception if the server does not have the :writable-running:1.0 capability and the source container is 'running'.

EditConfig

public EditConfig(Session session,
                  Datastore target,
                  Config config)
           throws CapabilityException
Create the edit-config Netconf operation.

Parameters:
session - The active session.
target - The target Container.
config - The configuration data.
Throws:
CapabilityException - Throw this exception if the server does not have the :candidate:1.0 capability and the source container is 'candidate', also. Similarly, throw this exception if the server does not have the :writable-running:1.0 capability and the source container is 'running'.
Method Detail

createConfig

public static Config createConfig(Capability cap,
                                  java.lang.String config,
                                  java.lang.String... values)
Create an instance of Config for use with the operation.

Parameters:
cap - The capability in which the data belong to configure.
config - The configuration string.
values - A set of values that are encoded and introduced into the filter through the corresponding variables.
Returns:
The instance of the configuration.
See Also:
Config.Config(Anyxml anyxml, Capability cap, String config, String... values)

setTestOption

public void setTestOption(EditConfig.TestOption option)
                   throws CapabilityException
Set the test option on the transaction.

Parameters:
option - The test option.
Throws:
CapabilityException - Throw this exception if the server does not have the :validate:1.0 capability.

setErrorOption

public void setErrorOption(EditConfig.ErrorOption option)
                    throws CapabilityException
Set the error option.

Parameters:
option - The error option.
Throws:
CapabilityException - Throw this exception if the server does not have the :rollback-on-error:1.0 capability.