"WEBNMS_5 API Docs"

com.adventnet.management.config.xml
Class Device

java.lang.Object
  extended by com.adventnet.management.config.xml.BaseElement
      extended by com.adventnet.management.config.xml.Device
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CorbaDevice, FTPDevice, SnmpDevice, TelnetDevice

public class Device
extends BaseElement

This class holds all device specific information for configuring a device. The device name can be either DNS name or IPAddress of the device.

In order to keep the Web NMS in sync with the Network Elements, ManagedObject Name (MOName) can also be specified for updation. The ManagedObject (MO) will be updated only if the configuration for a particular device gets succeeded. Here MOName can also differ from the actual device name. By default, MOName will be same as the Device name. If the Attribute to be configured also contains the MOName, then this MOName will be taken for updating the MO, even if MOName is specified in the Device. That is, priority will be given to the MOName specified in the Attribute.

Name of the MO can be specified by using either of the following methods

setMOName("<Name of the MO>");

(or)

Properties prop = new Properties();
prop.put("MOName", "<Name of the MO>");
setProperties(prop);

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.adventnet.management.config.xml.BaseElement
element, isServer
 
Constructor Summary
Device()
          Constructor used to create a Device object with these default values.
Device(org.w3c.dom.Element element)
          Creates a Device object from this element.
Device(java.lang.String host, java.lang.String port)
          Constructor used to create a Device object with host and port as paramaters.
Device(java.lang.String host, java.lang.String port, int retries)
          Constructor used to create a Device object with host, port and retries as paramaters.
Device(java.lang.String host, java.lang.String port, int retries, int timeout)
          Constructor used to create a Device object with host, port, retries and timeout as parameters.
 
Method Summary
 java.lang.String getDeviceName()
          Returns the name of the device to be configured.
 java.lang.String getMOName()
          Returns the name of the ManagedObject to be updated.
 java.lang.String getPort()
          Returns the device Port.
 int getRetries()
          Returns the number of retries.
 int getTimeout()
          Returns the timeOut value in milliseconds.
 void setMOName(java.lang.String moName)
          Sets the name of the ManagedObject to be updated.
 void setRetries(int retries)
          Sets the retries for this device.
 void setTimeout(int timeout)
          Sets the timeout for this device.
 
Methods inherited from class com.adventnet.management.config.xml.BaseElement
addSubTag, getAttribute, getElement, getProperties, getSubTagsByName, hasAttribute, removeSubTagsByName, setAttribute, setProperties, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Device

public Device(org.w3c.dom.Element element)
       throws InvalidTemplateException
Creates a Device object from this element.

Parameters:
element - element containing Device as the root element.
Throws:
InvalidTemplateException - if the element is null.

Device

public Device()
Constructor used to create a Device object with these default values. The default value for host, port, retries, timeout and MOName are taken as localhost, 161, 3, 5000 and localhost respectively.


Device

public Device(java.lang.String host,
              java.lang.String port)
Constructor used to create a Device object with host and port as paramaters.

Parameters:
host - name of the machine where the agent is running.
port - port at which the agent is listening.

Device

public Device(java.lang.String host,
              java.lang.String port,
              int retries)
Constructor used to create a Device object with host, port and retries as paramaters.

Parameters:
host - name of the machine where the agent is running.
port - port at which the agent is listening.
retries - number of times the agent will try to reconnect to the server in case of failure.

Device

public Device(java.lang.String host,
              java.lang.String port,
              int retries,
              int timeout)
Constructor used to create a Device object with host, port, retries and timeout as parameters.

Parameters:
host - name of the machine where the agent is running.
port - port at which the agent is listening.
retries - number of times the agent will try to reconnect to the server in case of failure.
timeout - time in milliseconds for which the agent will wait before going for a retry.
Method Detail

getDeviceName

public java.lang.String getDeviceName()
Returns the name of the device to be configured.

Returns:
name of the device.

getPort

public java.lang.String getPort()
Returns the device Port.

Returns:
the device port at which the agent is listening.

getRetries

public int getRetries()
Returns the number of retries.

Returns:
retries specified for this device.

setRetries

public void setRetries(int retries)
Sets the retries for this device.

Parameters:
retries - number of retries for this device.

getTimeout

public int getTimeout()
Returns the timeOut value in milliseconds.

Returns:
timeout in milliseconds.

setTimeout

public void setTimeout(int timeout)
Sets the timeout for this device. Default value is 5000 milliseconds.

Parameters:
timeout - timeout for the device in milliseconds.

getMOName

public java.lang.String getMOName()
Returns the name of the ManagedObject to be updated.

Returns:
ManagedObject's name for updation.

setMOName

public void setMOName(java.lang.String moName)
Sets the name of the ManagedObject to be updated. If a device is successfully configured , MOConfigUpdater ( defaultImpl for ConfigUpdater Interface ) updates the properties of this ManagedObject.

Parameters:
moName - managedObject name for updation.

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.