com.tivoli.twg.monitor
Class TWGMonThresholdEvent

java.lang.Object
  extended bycom.tivoli.twg.monitor.TWGMonThresholdEvent

public class TWGMonThresholdEvent
extends java.lang.Object

This is the TWGMonThresholdEvent class. This class is used to transport data for monitor events to the monitor server. Events described by this class are delivered to the TWGMonThresholdEventSink object that the subsystem has access to

See Also:
TWGMonThresholdEventSink

Field Summary
static int CURRENT_THRESHOLD_EVENT_VERSION
           
static int V12GA_THRESHOLD_EVENT_VERSION
           
 
Constructor Summary
TWGMonThresholdEvent()
          This is the constructor for building an event to be sent from the subsystem to the Event Sink object in the monitor server.
 
Method Summary
 double getActualValue()
           
 short getAlertSeverity()
          It uses the alert severities as defined by the EVENT_SEVERITY_xxx constants in the Alert Manager class: TWGBaseEvent.
 byte getAlertType()
          returns a bit mask indicating the type of alert that this object is reflecting.
 byte getDataType()
          gets a flag byte that indicates via set bits the type of data being returned with the event
 int getDuration()
          returns a value indicating the number of seconds that we were in the state
 int getEventTime()
          returns the time in secs when the event was generated on the Agent
 long getEventTimeMSecs()
          returns the time in msecs when the event was generated on the Agent
 long getManagedObjID()
          returns the managed object id of the system that is the source of the event
 long getThreshCTAD()
          gets the creation time and data portion of the threshold id object contained herein
 int getThreshID()
          gets the id portion of the TWGMonThresholdId object contained in this object
 TWGMonThresholdId getThreshIDClass()
          gets the threshold id object that describes what threshold is popping
 int getTime()
          returns the time that the system first detected the state being reflected in the event
 java.lang.String getValueString()
          returns a string for events from string based attributes
 boolean isChangedEvent()
          Gets whether this event is a change event
 boolean isQueuedEvent()
          Gets whether this event was queued on the agent before is could be sent
 boolean isValid()
          Gets whether this object contains valid data
 void setActualValue(double parm)
          sets the numeric value for an event from a numeric attribute type
 void setAlertType(byte parm)
          sets the alert type that the event is reflecting to the server The possible settings for the alert Type byte are: numeric attributes: TWGMonThreshold.HIGH_ERROR_THRESHOLD Indicates the measured value is above the High Error set point TWGMonThreshold.LOW_ERROR_THRESHOLD Indicates the measured value is below the Low Error set point TWGMonThreshold.HIGH_WARNING_THRESHOLD Indicates that the measured value is above the High Warning set point and below the High Error setting, if set.
 void setDataType(byte parm)
          sets the flag that indicates the type of data the event contains
 void setDuration(int parm)
          sets the duration in seconds that the condition has existed
 void setEventTime(int parm)
          sets the time when the event was generated on the Agent
 void setManagedObjID(long parm)
          sets the managed object id that represents the source of this event
 void setThreshIDandCTAD(int id, long ctad)
          creates and sets the threshold id object with the information describing the threshold that occurred
 void setTime(int parm)
          sets the time condition started to occur
 void setValid(boolean parm)
          Method to set flag that indicates if the state of the object is valid.
 void setValueString(java.lang.String parm)
          set the data value for string attribute threshold events
 java.lang.String toString()
          Returns string'ed version of instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

V12GA_THRESHOLD_EVENT_VERSION

public static final int V12GA_THRESHOLD_EVENT_VERSION
See Also:
Constant Field Values

CURRENT_THRESHOLD_EVENT_VERSION

public static final int CURRENT_THRESHOLD_EVENT_VERSION
See Also:
Constant Field Values
Constructor Detail

TWGMonThresholdEvent

public TWGMonThresholdEvent()
This is the constructor for building an event to be sent from the subsystem to the Event Sink object in the monitor server.

Method Detail

setValid

public void setValid(boolean parm)
Method to set flag that indicates if the state of the object is valid. This should be set to true by the creator of the object after all event attributes have been set.

Parameters:
parm - flag indicating if the object's state should be considered valid

setThreshIDandCTAD

public void setThreshIDandCTAD(int id,
                               long ctad)
creates and sets the threshold id object with the information describing the threshold that occurred

Parameters:
id - unique id of the threshold
ctad - creation time and date in seconds

setDataType

public void setDataType(byte parm)
sets the flag that indicates the type of data the event contains

Parameters:
parm - data type of the data being reported with the event

setAlertType

public void setAlertType(byte parm)
sets the alert type that the event is reflecting to the server The possible settings for the alert Type byte are:
numeric attributes:
TWGMonThreshold.HIGH_ERROR_THRESHOLD
Indicates the measured value is above the High Error set point
TWGMonThreshold.LOW_ERROR_THRESHOLD
Indicates the measured value is below the Low Error set point
TWGMonThreshold.HIGH_WARNING_THRESHOLD
Indicates that the measured value is above the High Warning set point and below the High Error setting, if set.
TWGMonThreshold.LOW_WARNING_THRESHOLD
Indicates that the measured value is below the Low Warning set point and above the Low Error setting, if set.
TWGMonThreshold.NORMAL_STATE_THRESHOLD
Indicates that the measured value is not in one of the out of normal range states listed above
string attributes:
TWGMonThreshold.ERROR_THRESHOLD
Indicates that the string matched one of the strings that was set as an Error string or that the string did not match any of the strings and that the default level for the string threshold was the error state.
TWGMonThreshold.WARNING_THRESHOLD
Indicates that the string matched one of the strings that was set as an Warning string or that the string did not match any of the strings and that the default level for the string threshold was the warning state.
TWGMonThreshold.NORMAL_STATE_THRESHOLD
Indicates that the measured value is not in one of the out of normal range states listed above

Parameters:
parm - alert type of this event

setManagedObjID

public void setManagedObjID(long parm)
sets the managed object id that represents the source of this event

Parameters:
parm - managed object id of the source

setActualValue

public void setActualValue(double parm)
sets the numeric value for an event from a numeric attribute type

Parameters:
parm - value that the attribute is reporting as the cause of the event

setTime

public void setTime(int parm)
sets the time condition started to occur

Parameters:
parm - time the condition started to occur

setEventTime

public void setEventTime(int parm)
sets the time when the event was generated on the Agent

Parameters:
parm - UTC time in secs when the event was created

setDuration

public void setDuration(int parm)
sets the duration in seconds that the condition has existed

Parameters:
parm - time in seconds the condition existed

setValueString

public void setValueString(java.lang.String parm)
set the data value for string attribute threshold events

Parameters:
parm - string object with the value causing the event for string attributes

getThreshIDClass

public TWGMonThresholdId getThreshIDClass()
gets the threshold id object that describes what threshold is popping

Returns:
TWGMonThresholdId containing the intensification information for the threshold that this object refers to

getThreshID

public int getThreshID()
gets the id portion of the TWGMonThresholdId object contained in this object

Returns:
int containing the id portion of the threshold id

getThreshCTAD

public long getThreshCTAD()
gets the creation time and data portion of the threshold id object contained herein

Returns:
long containing the creation time and date in a format acceptable to the java.util.Date class

getDataType

public byte getDataType()
gets a flag byte that indicates via set bits the type of data being returned with the event

Returns:
byte containing the flags indicating the data type contained in the event

getAlertType

public byte getAlertType()
returns a bit mask indicating the type of alert that this object is reflecting. TWGMonThreshold contains a set of constants that may be used to test the value returned.

Returns:
byte containing bits indicating the type of event being presented by this object

getManagedObjID

public long getManagedObjID()
returns the managed object id of the system that is the source of the event

Returns:
long containing the managed object id

getActualValue

public double getActualValue()

getTime

public int getTime()
returns the time that the system first detected the state being reflected in the event

Returns:
int containing the time in seconds since 1/1/1970

getEventTime

public int getEventTime()
returns the time in secs when the event was generated on the Agent

Returns:
int containing the event creation time in UTC seconds since 1/1/1970

getEventTimeMSecs

public long getEventTimeMSecs()
returns the time in msecs when the event was generated on the Agent

Returns:
long containing the event creation time in UTC msecs since 1/1/1970

getDuration

public int getDuration()
returns a value indicating the number of seconds that we were in the state

Returns:
int containing the duration in seconds

getValueString

public java.lang.String getValueString()
returns a string for events from string based attributes

Returns:
String containing the value being reported as the cause of the event

isValid

public boolean isValid()
Gets whether this object contains valid data

Returns:
boolean indicating if data is valid

isQueuedEvent

public boolean isQueuedEvent()
Gets whether this event was queued on the agent before is could be sent

Returns:
boolean indicating if the event has been queued

isChangedEvent

public boolean isChangedEvent()
Gets whether this event is a change event

Returns:
boolean indicating if this is a change event

toString

public java.lang.String toString()
Returns string'ed version of instance.

Returns:
String containing Printable debug string.

getAlertSeverity

public short getAlertSeverity()
It uses the alert severities as defined by the EVENT_SEVERITY_xxx constants in the Alert Manager class: TWGBaseEvent.

This method maps the alert that is being reported to a Director event severity level. The mapping is that all 'error' items are mapped to EVENT_SEVERITY_CRITICAL, all 'warning' items are mapped to EVENT_SEVERITY_WARNING and all 'normal' items are mapped to EVENT_SEVERITY_HARMLESS. This is done by first checking for error alerts then looking for warning and normal alerts. if none of those alert bits are set, then the severity level of EVENT_SEVERITY_UNKNOWN is returned.

This method is used by the monitor server when processing a threshold event and preparing to send it to the alert manager.

Returns:
short containing event severity value as described above.
See Also:
TWGPartialEvent.EVENT_SEVERITY_WARNING, TWGPartialEvent.EVENT_SEVERITY_CRITICAL, TWGPartialEvent.EVENT_SEVERITY_HARMLESS, TWGPartialEvent.EVENT_SEVERITY_UNKNOWN