AdventNet Web NMS 4 API Specification

com.adventnet.management.config
Class AttributeEvent

java.lang.Object
  |
  +--com.adventnet.management.config.AttributeEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CorbaAttributeEvent, FTPAttributeEvent, SnmpAttributeEvent, TelnetAttributeEvent, TftpAttributeEvent, TL1AttributeEvent

public abstract class AttributeEvent
extends java.lang.Object
implements java.io.Serializable

This event indicates that an attribute has been configured over a device. Registered Listeners will be notified with these events for each attribute defined in a ConfigTask . Listeners can be registered with the ConfigServer through DeviceConfigurationAPI. AttributeEvent will be generated and notified for each retry of attribute on the device.

See Also:
ConfigTask, DeviceConfigurationAPI.registerTaskListener(String, ConfigTaskListener), Serialized Form

Constructor Summary
AttributeEvent(java.lang.String taskName, java.lang.String subTaskName, java.lang.String deviceName, java.lang.String identifier, int errorStatus, java.lang.String message)
          Creates an AttributeEvent of type GROUP_ATTRIBUTE.
AttributeEvent(java.lang.String taskName, java.lang.String subTaskName, java.lang.String deviceName, java.lang.String identifier, java.lang.String label, java.lang.String value, int errorStatus, java.lang.String message, boolean endOfRetry)
          Creates an AttributeEvent of type SCALAR_ATTRIBUTE.
 
Method Summary
 java.lang.String getAttribute()
          Returns the identifier for which the configuration was done.
 int getAttributeType()
          Returns the attribute type.
 java.lang.String getDeviceName()
          Returns the name of the configured device.
 AttributeEvent[] getGroupEvents()
          Returns an array of AttributeEvent ,if the attribute configured is of type Group Attribute.
 java.lang.String getLabel()
          Returns the label of the attribute if defined.
 java.lang.String getMessage()
          Returns the result of configuration of attribute over a device.
 int getStatus()
          Returns the status of configuration for this attribute.
 java.lang.String getSubTaskName()
          Returns the name of the subtask in a CombinedTask.
 java.lang.String getTaskName()
          Returns the name of the executed task.
 java.lang.String getValue()
          Return the value of the attribute.
 boolean isEndOfRetry()
          Specifies whether retry is finished for this attribute or not.
 void setAttributeType(int type)
          Sets the attribute type for this event.
 void setGroupEvents(AttributeEvent[] groupAttributeEvents)
          Sets an array of AttributeEvent for the child attributes present in a Group Attribute.
 java.lang.String toString()
          Returns the concatenated string of taskName, deviceName,identifier and status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeEvent

public AttributeEvent(java.lang.String taskName,
                      java.lang.String subTaskName,
                      java.lang.String deviceName,
                      java.lang.String identifier,
                      int errorStatus,
                      java.lang.String message)
Creates an AttributeEvent of type GROUP_ATTRIBUTE. If the configured attribute is of type GROUP_ATTRIBUTE, then the AttributeEvent for the child attributes can be get from getGroupEvents()
Parameters:
taskName - name of the task to which this attribute belongs.
subTaskName - name of the subtask in a CombinedTask.
deviceName - name of the configured device.
identifier - name of the configured attribute.
errorStatus - status of configuration for this attribute.
message - result of configuration for this attribute.
See Also:
Attribute

AttributeEvent

public AttributeEvent(java.lang.String taskName,
                      java.lang.String subTaskName,
                      java.lang.String deviceName,
                      java.lang.String identifier,
                      java.lang.String label,
                      java.lang.String value,
                      int errorStatus,
                      java.lang.String message,
                      boolean endOfRetry)
Creates an AttributeEvent of type SCALAR_ATTRIBUTE.
Parameters:
taskName - name of the task to which this attribute belongs.
subTaskName - name of the subtask in a CombinedTask.
deviceName - name of the configured device.
identifier - name of the configured attribute.
label - label of the configured attribute.
value - value of the attribute configured.
errorStatus - status of configuration for this attribute.
message - result of configuration for this attribute.
endOfRetry - specifies whether retries got finished for this attribute or not.
See Also:
Attribute
Method Detail

getTaskName

public java.lang.String getTaskName()
Returns the name of the executed task.
Returns:
a String representing the name of the executed task.

getSubTaskName

public java.lang.String getSubTaskName()
Returns the name of the subtask in a CombinedTask.
Returns:
subTaskName if the executed task is a CombinedTask, otherwise null.

getDeviceName

public java.lang.String getDeviceName()
Returns the name of the configured device.
Returns:
deviceName

getStatus

public int getStatus()
Returns the status of configuration for this attribute.
Returns:
0 for Success and -1 indicating Failure.

getMessage

public java.lang.String getMessage()
Returns the result of configuration of attribute over a device. Applicable to AttributeEvent of type SCALAR_ATTRIBUTE.
Returns:
a String representing the message value
See Also:
AttributeConstants

getAttribute

public java.lang.String getAttribute()
Returns the identifier for which the configuration was done. Applicable to AttributeEvent of type SCALAR_ATTRIBUTE.
Returns:
oid in case of SNMP, command in case of TELNET, TFTP and CommmandCode for TL1.
See Also:
AttributeConstants

getLabel

public java.lang.String getLabel()
Returns the label of the attribute if defined. Applicable to AttributeEvent of type SCALAR_ATTRIBUTE.
Returns:
a String representing the label value.
See Also:
AttributeConstants

getValue

public java.lang.String getValue()
Return the value of the attribute. Applicable to AttributeEvent of type SCALAR_ATTRIBUTE.
Returns:
this object's current value as a String.
See Also:
AttributeConstants

isEndOfRetry

public boolean isEndOfRetry()
Specifies whether retry is finished for this attribute or not.
Returns:
true if all the specified retries are finished, otherwise false.

toString

public java.lang.String toString()
Returns the concatenated string of taskName, deviceName,identifier and status.
Overrides:
toString in class java.lang.Object
Returns:
the value of this object as a String.

setGroupEvents

public void setGroupEvents(AttributeEvent[] groupAttributeEvents)
Sets an array of AttributeEvent for the child attributes present in a Group Attribute. Applicable to AttributeEvent of type GROUP_ATTRIBUTE.
Parameters:
groupAttributeEvents - events for the child attributes defined in a Group Attribute.
See Also:
getGroupEvents(), AttributeConstants

getGroupEvents

public AttributeEvent[] getGroupEvents()
Returns an array of AttributeEvent ,if the attribute configured is of type Group Attribute. Applicable to AttributeEvent of type GROUP_ATTRIBUTE.
Returns:
an AttributeEvent array corresponding to the child attributes defined in a Group Attribute.
See Also:
getGroupEvents(), Attribute.getAttributeType(), AttributeConstants

setAttributeType

public void setAttributeType(int type)
Sets the attribute type for this event.
Parameters:
type - an int value
See Also:
getAttributeType()

getAttributeType

public int getAttributeType()
Returns the attribute type. If the type is GROUP_ATTRIBUTE,getGroupEvents returns the corresponding AttributeEvent for child attributes.
Returns:
an int value which is one of the constants AttributeConstants
See Also:
setAttributeType(int), AttributeConstants

AdventNet Web NMS 4 API Specification