"WEBNMS_5 API Docs"

com.adventnet.nms.alertdb
Class AlertHistory

java.lang.Object
  extended by com.adventnet.nms.alertdb.AlertHistory
All Implemented Interfaces:
DBInterface, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
AlertAnnotation

public class AlertHistory
extends java.lang.Object
implements DBInterface, java.io.Serializable

AlertHistory object will be created whenever an action on Alert is taken by WebNMS. The actions may be Updating an Alert, Clearing an Alert, Deleting an Alert. AlertHistory contains fields entity, modTime and notes. AlertAnnotation is direct known subclass of AlertHistory.

See Also:
Alert, Serialized Form

Constructor Summary
AlertHistory()
           
 
Method Summary
 java.lang.Object clone()
          Return a new AlertHistory object which is a clone of this AlertHistory object.
 java.lang.String convertToString(long value)
          This method converts a long value into string type.
 void decodeObj(byte[] bytes)
          This method sets the properties of the AlertHistory object from the byte[] passed as an argument.
 byte[] encodeObj()
          Returns the byte array in encoded format of the AlertHistory object.
 java.lang.Long getAaid()
           
 java.lang.String getEntity()
          Get the entity of the AlertHistory.
 java.lang.String getKey()
          This method returns the primary key value (entity) for this AlertHistory object
 java.lang.String getKeyName()
          This method returns the name of the field which is used as the primary key for alerts.
 long getModTime()
          Get the time at which this alert was last modified.
 java.lang.String getNotes()
          Get the detailed annotations about updates on this alert.
 java.lang.String getOwnerName()
          Gets the owner to which the corresponding Alert belongs.
 java.util.Properties getProperties()
          Returns all the properties of an AlertHistory object.
 void setEntity(java.lang.String entity)
          Sets the entity of this alert.
 void setModTime(long modTime)
          Sets the time at which this alert was last modified.
 void setNotes(java.lang.String notes)
          Sets the detailed annotations about updates on this alert.
 void setOwnerName(java.lang.String owner)
          Sets the owner to which the corresponding Alert belongs.
 void setProperties(java.util.Properties p)
          To set the AlertHistory object's properties.
 java.lang.String toString()
          Returns the string representation of the History Object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AlertHistory

public AlertHistory()
Method Detail

getAaid

public java.lang.Long getAaid()

getEntity

public java.lang.String getEntity()
Get the entity of the AlertHistory. It is used to do corelation of events into alerts. All events having the same entity value (which is referred to as Failure Object) will result in only one alert. The entity of an alert has be set in the EventObject itself from, either Trap parsers, event parsers or event filter. Once the alert is generated, the entity cannot be modified.

Returns:
The entity (failure object) of this alert.

setEntity

public void setEntity(java.lang.String entity)
Sets the entity of this alert. This field is the key for an alert. No two alerts will have the same entity value. It is used to do corelation of events into alerts. All events having the same entity value (which is referred to as Failure Object) will result in only one alert. The entity of an alert has be set in the EventObject itself from, either Trap parsers, event parsers or event filter. Once the alert is generated, the entity cannot be modified.

Parameters:
entity - The value of the entity (Failure object).

getModTime

public long getModTime()
Get the time at which this alert was last modified.

Returns:
The time this alert was last modified.

setModTime

public void setModTime(long modTime)
Sets the time at which this alert was last modified.

Parameters:
modTime - The modified time of this alert.

getNotes

public java.lang.String getNotes()
Get the detailed annotations about updates on this alert. Users could add their own annotations to an alert from the client.

Returns:
The detailed annotations about this alert.

setNotes

public void setNotes(java.lang.String notes)
Sets the detailed annotations about updates on this alert. Users could add their own annotations to an alert from the client. This will delete the old annotations.

Parameters:
notes - The annotations to be done from this alert.

getOwnerName

public java.lang.String getOwnerName()
Gets the owner to which the corresponding Alert belongs.

Returns:
The owner name to which the corresponding Alert belongs.

setOwnerName

public void setOwnerName(java.lang.String owner)
Sets the owner to which the corresponding Alert belongs.

Parameters:
owner - The owner name to which the corresponding Alert belongs.

getProperties

public java.util.Properties getProperties()
Returns all the properties of an AlertHistory object.

Specified by:
getProperties in interface DBInterface
Returns:
properties of an AlertHistory object.

clone

public java.lang.Object clone()
Return a new AlertHistory object which is a clone of this AlertHistory object.

Specified by:
clone in interface DBInterface
Overrides:
clone in class java.lang.Object
Returns:
The cloned copy of this AlertHistory.

setProperties

public void setProperties(java.util.Properties p)
To set the AlertHistory object's properties.

Specified by:
setProperties in interface DBInterface
Parameters:
p - The values of the fields in this AlertHistory. entity, id, modTime.

getKey

public java.lang.String getKey()
This method returns the primary key value (entity) for this AlertHistory object

Specified by:
getKey in interface DBInterface
Returns:
The unique key for this AlertHistory object.

getKeyName

public java.lang.String getKeyName()
This method returns the name of the field which is used as the primary key for alerts. This is used to define the primary key for the Alert table when the alert objects are stored in the database.

Specified by:
getKeyName in interface DBInterface
Returns:
The name of the field used as the primary key.

convertToString

public java.lang.String convertToString(long value)
This method converts a long value into string type.

Parameters:
value - parameter which is to be converted into string type.
Returns:
a string value of long type.

encodeObj

public byte[] encodeObj()
Returns the byte array in encoded format of the AlertHistory object.

Returns:
byte array of AlertHistory in encoded format.

decodeObj

public void decodeObj(byte[] bytes)
               throws java.io.IOException
This method sets the properties of the AlertHistory object from the byte[] passed as an argument.

Parameters:
bytes - The byte[] containing the properties of AlertHitory object as returned by the encodeObj() method present in this class.
Throws:
java.io.IOException
See Also:
encodeObj()

toString

public java.lang.String toString()
Returns the string representation of the History Object. Returns the concatinated string of modTime and notes of the History Object.

Overrides:
toString in class java.lang.Object
Returns:
String representation of AlertHistory object

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.