AdventNet Web NMS 4 API Specification

com.adventnet.management.config.xml
Class DeviceList

java.lang.Object
  |
  +--com.adventnet.management.config.xml.BaseElement
        |
        +--com.adventnet.management.config.xml.DeviceList
All Implemented Interfaces:
java.io.Serializable

public class DeviceList
extends BaseElement

This class represents a set/group of devices that can be stored in DB using ConfigClientAPI.saveDeviceList(deviceListXML). Configuration of these devices can be done by simply specifying the devicelist's name instead of devices.

Sample DeviceList is given below

 <?xml version="1.0" encoding="ISO-8859-1"?>
<DeviceList
    name="SampleDeviceList"
    protocol="snmp">
<Device host="192.168.4.1" port="161" retries="3" timeout="5000" MOName="192.168.4.1" community="public" version="v1"/>
<Device host="192.168.4.2" port="161" retries="3" timeout="5000" MOName="192.168.4.2" community="public" version="v1"/>
</DeviceList>

See Also:
Serialized Form

Fields inherited from class com.adventnet.management.config.xml.BaseElement
element, isServer
 
Constructor Summary
DeviceList(org.w3c.dom.Element element)
          Creates a DeviceList from this element.
DeviceList(java.lang.String deviceListXML)
          Creates a DeviceList from the XML String.
DeviceList(java.lang.String deviceListName, java.lang.String protocol)
          Constructs the DeviceList with the specified devices
 
Method Summary
 java.lang.String getDeviceList()
          Returns the DeviceList in XML format by transforming the DeviceList Element.
 java.lang.String getDeviceListName()
          Returns the name of the device list.
 Device[] getDevices()
          Returns all the devices associated with the devicelist.
 java.lang.String getProtocol()
          Returns the protocol used for configuring these devices.
 void setDevices(Device[] deviceArr)
          Sets the various devices to this devicelist.
 java.lang.String toString()
          Returns the DeviceList in XML format by transforming the DeviceList Element.
 
Methods inherited from class com.adventnet.management.config.xml.BaseElement
addSubTag, getAttribute, getElement, getProperties, getSubTagsByName, hasAttribute, removeSubTagsByName, setAttribute, setProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeviceList

public DeviceList(java.lang.String deviceListName,
                  java.lang.String protocol)
Constructs the DeviceList with the specified devices
Parameters:
deviceListName - a String that specifies the name of the device list.
protocol - name of the protocol that need to be used for configuring these devices.

DeviceList

public DeviceList(org.w3c.dom.Element element)
           throws InvalidTemplateException
Creates a DeviceList from this element.
Parameters:
element - element containing DeviceList as the root element.
Throws:
InvalidTemplateException - if the element is null or element's tag name is not equal to DeviceList.

DeviceList

public DeviceList(java.lang.String deviceListXML)
           throws InvalidTemplateException
Creates a DeviceList from the XML String.
Parameters:
deviceListXML - a String in the form of XML that represents a set of devices.
Throws:
InvalidTemplateException - if string is an invalid DeviceList XML.
Method Detail

setDevices

public void setDevices(Device[] deviceArr)
Sets the various devices to this devicelist.
Parameters:
deviceArr - an Array of devices which constitutes the Devicelist.

getProtocol

public java.lang.String getProtocol()
Returns the protocol used for configuring these devices.
Returns:
name of the protocol used for configuring the devices.

getDeviceListName

public java.lang.String getDeviceListName()
Returns the name of the device list.
Returns:
a String that represents the devicelist's name.

getDevices

public Device[] getDevices()
Returns all the devices associated with the devicelist.
Returns:
an array of associated devices.

getDeviceList

public java.lang.String getDeviceList()
Returns the DeviceList in XML format by transforming the DeviceList Element.
Returns:
devicelist in XML.

toString

public java.lang.String toString()
Returns the DeviceList in XML format by transforming the DeviceList Element.
Overrides:
toString in class BaseElement
Returns:
devicelist in XML.

AdventNet Web NMS 4 API Specification