"WEBNMS_5 API Docs"

com.adventnet.management.config.xml
Class AttributeResult

java.lang.Object
  extended by com.adventnet.management.config.xml.BaseElement
      extended by com.adventnet.management.config.xml.AttributeResult
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
GroupResult

public class AttributeResult
extends BaseElement

This class holds the complete result of configuration over a device.It encapsulates details like taskName, deviceName, identifier and status of configuration. The order of attribute result may vary from device to device in a set of devices assigned for configuration.

Sample Configuration Result:

<?xml version="1.0" encoding="ISO-8859-1"?>
<ConfigResult taskName="SystemConfig" rollbackEnabled="false">
<DeviceResult deviceName="192.168.4.19" configuration="Attempted">
<AttributeResult identifier="1.6.0" label="sysLocation" errorStatus="0" message="Success"/>
</DeviceResult>
<DeviceResult deviceName="192.168.4.24" configuration="Attempted">
<AttributeResult identifier="1.6.0" label="sysLocation" errorStatus="0" message="Success"/>
</DeviceResult>
</ConfigResult>

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.adventnet.management.config.xml.BaseElement
element, isServer
 
Constructor Summary
AttributeResult(AttributeResult[] groupResults)
          Creates a new AttributeResult instance for the Group Attribute.
AttributeResult(org.w3c.dom.Element element)
          Creates a new AttributeResult instance from this Element.
AttributeResult(java.lang.String identifier, int errorStatus, java.lang.String message)
          Creates a new AttributeResult instance.
AttributeResult(java.lang.String identifier, int errorStatus, java.lang.String message, int attributeType)
          Creates a new AttributeResult instance.
 
Method Summary
 int getAttributeType()
          Returns the type of the attribute which can be either SCALAR_ATTRIBUTE or GROUP_ATTRIBUTE.
 AttributeResult[] getGroupResult()
          Returns the result of child attributes present in a Group Attribute.
 java.lang.String getIdentifier()
          Returns the attribute that has been configured.
 java.lang.String getLabel()
          Returns the label that has been assigned in the corresponding attribute.
 java.lang.String getMessage()
          Returns the response of the configuration over a particular agent.
 int getStatus()
          Returns the status of configuration for this identifier over a particular 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

AttributeResult

public AttributeResult(org.w3c.dom.Element element)
                throws InvalidTemplateException
Creates a new AttributeResult instance from this Element.

Parameters:
element - element containing AttributeResult or GroupResult as the root element.
Throws:
InvalidTemplateException - if the element is null.

AttributeResult

public AttributeResult(java.lang.String identifier,
                       int errorStatus,
                       java.lang.String message)
Creates a new AttributeResult instance.

Parameters:
identifier - identifier of the configured attribute.
errorStatus - status of configuration.
message - Success if the device is successfully configured or the corresponding error message in case of failure.

AttributeResult

public AttributeResult(java.lang.String identifier,
                       int errorStatus,
                       java.lang.String message,
                       int attributeType)
Creates a new AttributeResult instance.

Parameters:
identifier - identifier of the configured attribute.
errorStatus - status of configuration for this attribute
message - Success if the device is successfully configured or the corresponding error message in case of failure
attributeType - the attribute type which is the one of the constants in the AttributeConstants class.
See Also:
AttributeConstants

AttributeResult

public AttributeResult(AttributeResult[] groupResults)
Creates a new AttributeResult instance for the Group Attribute.

Parameters:
groupResults - result for the child attribute in a Group Attribute.
Method Detail

getIdentifier

public java.lang.String getIdentifier()
Returns the attribute that has been configured. In case of Snmp, it returns the OID value. In case of Tftp & Telnet it returns the command. In the case TL1, it returns commandCode.

Returns:
the attribute specific to a protocol if present, else null.

getStatus

public int getStatus()
Returns the status of configuration for this identifier over a particular device. For Group Attributes, status depends on the configuration of the child attributes.If any of the child attributes failed during configuration it returns a non zero value indicating failure.

Returns:
an int value. If configuration was succeeded, it returns 0 , otherwise non zero value.

getMessage

public java.lang.String getMessage()
Returns the response of the configuration over a particular agent. In case of TELNET and TL1 configuration , it returns the output of the command. For SNMP and TFTP configuration, it returns Success if the configuration succeeded, else the corresponding agent's response.

Returns:
a protocol specific message.

getGroupResult

public AttributeResult[] getGroupResult()
Returns the result of child attributes present in a Group Attribute. If the attribute type is other than Group Attribute, it returns null.

Returns:
an array of AttributeResult for child attributes.

getAttributeType

public int getAttributeType()
Returns the type of the attribute which can be either SCALAR_ATTRIBUTE or GROUP_ATTRIBUTE. If the attribute type is Group Attribute, then the configuration status for child attributes can be obtained from the method getGroupResult() .

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

getLabel

public java.lang.String getLabel()
Returns the label that has been assigned in the corresponding attribute.

Returns:
label if present, else null.

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.