"WEBNMS_5 API Docs"

com.adventnet.management.config.xml
Class Attribute

java.lang.Object
  extended by com.adventnet.management.config.xml.BaseElement
      extended by com.adventnet.management.config.xml.Attribute
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ColumnAttribute, FTPAttribute, GroupAttribute, SnmpAttribute, TelnetAttribute, TftpAttribute, TL1Attribute

public class Attribute
extends BaseElement

This class holds data for configuring various types of devices. Attributes are classified as scalar , table and group Attributes. Group Attributes consists of scalar and table attributes in addition to user specific properties. Advantage of using Group Attributes is that all attributes defined in a group will be collected and send in a seperate packet for configuration. Table Attributes are used for manipulating rows in an agent.

Inorder to keep the Web NMS in sync with the Network Elements after configuration , Managed Object name can also be specified for updation. ManagedObject will be updated only if the configuration of this attribute gets succeeded for a particular device. If the Attribute to be configured contains the MOName as one of the property, then this MOName will be taken for updating the Managed Object, even though MOName is specified in the Device.i.e priority will be given to the MOName specified in Attribute.

Name of the Managed Object can be specified by using the following method

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

Thus different ManagedObject names can be specified for different attributes defined in a Task and the Attribute's label will be taken for updating the Managed Object.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.adventnet.management.config.xml.BaseElement
element, isServer
 
Constructor Summary
Attribute()
          Creates an Attribute by initializing an empty Element of name "Attribute".
Attribute(org.w3c.dom.Element element)
          Creates an Attribute from this element.
 
Method Summary
 Attribute[] getAttributeList()
          Gets the child attributes for this attribute.
 int getAttributeType()
          Returns the type of the attribute which can be either SCALAR_ATTRIBUTE or TABLE_ATTRIBUTE or GROUP_ATTRIBUTE.
 java.lang.String getIdentifier()
          Returns an identifier for the attribute.i.e oid in case of SNMP, command in case of TFTP and TELNET and commandCode in case of TL1.
 java.util.Properties getUserAttributes()
          Returns user specific attributes as a set of properties for Group Attributes.
 void setAttributeList(Attribute[] configAttributes)
          Sets the column attributes for a Table Attribute or child attributes for a Group Attribute.
 void setAttributeType(int type)
          Sets the type of the attribute.
 void setUserAttributes(java.util.Properties prop)
          Sets the user specific attributes for a Group Attribute.
 
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

Attribute

public Attribute()
Creates an Attribute by initializing an empty Element of name "Attribute".


Attribute

public Attribute(org.w3c.dom.Element element)
          throws InvalidTemplateException
Creates an Attribute from this element.

Parameters:
element - element containing Attribute as the root element.
Throws:
InvalidTemplateException - if the element is null.
Method Detail

getIdentifier

public java.lang.String getIdentifier()
Returns an identifier for the attribute.i.e oid in case of SNMP, command in case of TFTP and TELNET and commandCode in case of TL1. This method is called by ConfigServer on auditing the attribute level details in DB and in generating the result for the configuration of this attribute.

Returns:
an identifier for this attribute.

getAttributeType

public int getAttributeType()
Returns the type of the attribute which can be either SCALAR_ATTRIBUTE or TABLE_ATTRIBUTE or GROUP_ATTRIBUTE. If the type is other than the constants specified in AttributeConstants it returns -1.

Returns:
an int value which is one of the constants in AttributeConstants class .
See Also:
AttributeConstants

setAttributeType

public void setAttributeType(int type)
Sets the type of the attribute. The various types are SCALAR_ATTRIBUTE, GROUP_ATTRIBUTE and TABLE_ATTRIBUTE.By default the attribute type is SCALAR. To create a Group Attribute, this method can be used for setting the attribute type and method setAttributeList( Attribute[] ) can be used for associating attributes for this group.

Parameters:
type - an int value which is one of the constants in AttributeConstants class.
See Also:
AttributeConstants

getUserAttributes

public java.util.Properties getUserAttributes()
Returns user specific attributes as a set of properties for Group Attributes.

Returns:
Properties containing user specific Attributes.

setUserAttributes

public void setUserAttributes(java.util.Properties prop)
Sets the user specific attributes for a Group Attribute. User Attributes will be more helpful to distinguish the various Group Attributes present in a configuration task.

Parameters:
prop - containing the user specific Attributes.

getAttributeList

public Attribute[] getAttributeList()
Gets the child attributes for this attribute. For attributes of type TABLE_ATTRIBUTE, it returns column attributes and for Group Attributes, it returns child attributes and returns null for scalar attributes.

Returns:
an array of attribute.

setAttributeList

public void setAttributeList(Attribute[] configAttributes)
Sets the column attributes for a Table Attribute or child attributes for a Group Attribute.

Parameters:
configAttributes - an array of Attributes.

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.