AdventNet Web NMS 4 API Specification

com.adventnet.management.config
Class ConfigProvider

java.lang.Object
  |
  +--com.adventnet.management.config.ConfigProvider
Direct Known Subclasses:
FTPConfigProvider, SnmpConfigProvider, TelnetConfigProvider, TftpConfigProvider, TL1ConfigProvider

public abstract class ConfigProvider
extends java.lang.Object

This is a base class whose abstract methods need to be implemented for downloading or uploading configuration from various devices through a specific protocol. An entry for this protocol should be made in <Web NMS Home>/conf/configprovider.xml for the ConfigServer to support this protocol. By default, ConfigServer supports SNMP, TL1, TELNET and TFTP protocols.

Since:
Web NMS 2.3

Field Summary
 ConfigTask configTask
          Maintains the configuration data for uploading configuration from a device.
protected static java.util.Hashtable deviceSessionMap
          Maintains the session established between the ConfigServer and devices for configuration.
 java.lang.String userName
          Name of the user who does the Configuration.
 
Constructor Summary
ConfigProvider()
           
 
Method Summary
abstract  AttributeResult[] configureDevice(java.lang.String taskName, Attribute[] attributeList, Device device)
          Method for configuring various devices through a specific protocol.
abstract  AttributeEvent generateEvent(java.lang.String taskName, java.lang.String subTaskName, Device device, Attribute attribute, AttributeResult result, boolean endOfRetry)
          Method invoked by ConfigServer to generate an AttributeEvent after configuring each and every Attribute .
abstract  Attribute[] getCurrentConfiguration(Device device)
          Method invoked by ConfigServer for uploading configuration from a device.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configTask

public ConfigTask configTask
Maintains the configuration data for uploading configuration from a device.

userName

public java.lang.String userName
Name of the user who does the Configuration.

deviceSessionMap

protected static java.util.Hashtable deviceSessionMap
Maintains the session established between the ConfigServer and devices for configuration.
Constructor Detail

ConfigProvider

public ConfigProvider()
Method Detail

configureDevice

public abstract AttributeResult[] configureDevice(java.lang.String taskName,
                                                  Attribute[] attributeList,
                                                  Device device)
                                           throws ConfigException
Method for configuring various devices through a specific protocol. This is called by the ConfigServer once the task is submitted for execution. ConfigServer removes those attributes which are successfully configured after each retry and pass only the failed attributes for configuration in the next retry.
Parameters:
taskName - name of the task in execution.
attributeList - list of the attributes to be configured over a device.
device - name of the device to be configured.
Returns:
an AttributeResult array for the configured attributes.

generateEvent

public abstract AttributeEvent generateEvent(java.lang.String taskName,
                                             java.lang.String subTaskName,
                                             Device device,
                                             Attribute attribute,
                                             AttributeResult result,
                                             boolean endOfRetry)
Method invoked by ConfigServer to generate an AttributeEvent after configuring each and every Attribute .
Parameters:
taskName - name of the task for which the event is to be generated
subTaskName - name of the subtask in a CombinedTask, otherwise null.
device - Device that has been configured.
attribute - Attribute that has been configured over a device.
result - AttributeResult for the configuration.
endOfRetry - specifies whether number of retries set for the device has reached or not.
Returns:
an AttributeEvent for a configured attribute

getCurrentConfiguration

public abstract Attribute[] getCurrentConfiguration(Device device)
                                             throws ConfigException
Method invoked by ConfigServer for uploading configuration from a device. This method uses the configuration data from ConfigTask (protected variable in this class) for uploading the configuration.
Parameters:
device - Device for getting the configuration.
Returns:
an Attribute containing the configuration data.
Throws:
ConfigException - if it fails to upload configuration from the device.

AdventNet Web NMS 4 API Specification