AP&C API Reference
Public Member Functions | Protected Member Functions | Properties | List of all members
Apac.Monitoring.Alert Class Reference

The construct that tracks state for system conditions such as threshold crossings or breakages. More...

Inheritance diagram for Apac.Monitoring.Alert:
Apac.Monitoring.Persistable Apac.Monitoring.ITimeStamped

Public Member Functions

 Alert (uint id, ManagedElement element, EventDef eventDef, EventDef clearEventDef, string description, DateTime created, DateTime cleared, string clearedBy, uint count)
 Initializes a new instance of the Alert class from storage. More...
 
 Alert (ManagedElement element, EventDef eventDef, EventDef clearEventDef, string description)
 Initializes a new instance of the Alert class. More...
 
void Clear (string clearedBy)
 Clears this instance by setting the ClearTime. This is a one-time operation.

Parameters
clearedByA string describing the clearing agent ('user', 'system', etc).
More...
 
bool Increment ()
 Increments the count and sets the timestamp if the alert is cleared, otherwise it does nothing. More...
 
int CompareTo (object obj)
 Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. More...
 
- Public Member Functions inherited from Apac.Monitoring.Persistable
System.Xml.Schema.XmlSchema GetSchema ()
 This property is reserved, apply the T:System.Xml.Serialization.XmlSchemaProviderAttribute to the class instead. More...
 
void ReadXml (System.Xml.XmlReader reader)
 Generates an object from its XML representation. More...
 
void WriteXml (System.Xml.XmlWriter writer)
 Converts an object into its XML representation. More...
 

Protected Member Functions

override void OnReadXml (System.Xml.XmlReader reader)
 Called when deserializing via XML. More...
 
override void OnWriteXml (System.Xml.XmlWriter writer)
 Called when serializing via XML. More...
 
- Protected Member Functions inherited from Apac.Monitoring.Persistable
virtual void OnPropertyChanged (string name)
 Called when [property changed]. More...
 

Properties

uint Id [get, set]
 Gets or sets the id. More...
 
ManagedElement Element [get]
 Gets the element to which the alert applies. More...
 
string ElementName [get]
 Gets the name of the element. More...
 
uint ElementId [get]
 Gets the element id. More...
 
EventDef Event [get]
 Gets the event that caused the alert. More...
 
EventDef ClearEvent [get]
 Gets the event def to fire when the alert clears. More...
 
string Description [get, set]
 Gets or sets the description. More...
 
DateTime ClearTime [get]
 Gets the time the alert was cleared. More...
 
DateTime LastTime [get]
 Gets the last time the alert was in force. More...
 
string ClearedBy [get]
 Gets the agent that cleared the alert ('user', 'system', etc). More...
 
TimeSpan Duration [get]
 Gets the duration that the alert was active. If it is still active (ie: not cleared) then duration will be TimeSpan.Zero. More...
 
bool IsCleared [get]
 Gets a value indicating whether this instance is cleared. More...
 
uint Count [get]
 Gets the number of times this alert has been triggered before it cleared. More...
 
DateTime Timestamp [get]
 Gets the timestamp. More...
 
int Bucket [get]
 Gets the bucket, which is a five minute period. There are 12 buckets in an hour and 288 buckets in a day. More...
 
int Offset [get]
 Gets the offset into the bucket in seconds. More...
 
- Properties inherited from Apac.Monitoring.Persistable
bool IsNew [get, set]
 Gets or sets a value indicating whether this instance is new. More...
 
bool IsDirty [get, set]
 Gets or sets a value indicating whether this instance is dirty. More...
 
bool IsDeleted [get, set]
 Gets or sets a value indicating whether this instance is deleted. More...
 
object Tag [get, set]
 Gets or sets an arbitrary value that application code can use to track application specific data on an instance of this type. More...
 
- Properties inherited from Apac.Monitoring.ITimeStamped
DateTime Timestamp [get]
 Gets the timestamp. More...
 
int Bucket [get]
 Gets the bucket, which is a five minute period. There are 12 buckets in an hour and 288 buckets in a day. More...
 
int Offset [get]
 Gets the offset into the bucket in seconds. More...
 

Additional Inherited Members

- Events inherited from Apac.Monitoring.Persistable
PropertyChangedEventHandler PropertyChanged
 Occurs when a property value changes. More...
 

Detailed Description

The construct that tracks state for system conditions such as threshold crossings or breakages.

Constructor & Destructor Documentation

◆ Alert() [1/2]

Apac.Monitoring.Alert.Alert ( uint  id,
ManagedElement  element,
EventDef  eventDef,
EventDef  clearEventDef,
string  description,
DateTime  created,
DateTime  cleared,
string  clearedBy,
uint  count 
)
inline

Initializes a new instance of the Alert class from storage.

Parameters
idThe ID of the alert.
elementThe element.
eventDefThe event def to fire when the alert occurs.
clearEventDefThe event def to fire when the alert clears.
descriptionThe description.
createdThe time the alert was created.
clearedThe time the alert was cleared.
clearedByThe agent that cleared the alert.
countThe number of times this alert was triggered before it cleared.

◆ Alert() [2/2]

Apac.Monitoring.Alert.Alert ( ManagedElement  element,
EventDef  eventDef,
EventDef  clearEventDef,
string  description 
)
inline

Initializes a new instance of the Alert class.

Parameters
elementThe element.
eventDefThe event def.
clearEventDefThe clear event def.
descriptionThe description.

Member Function Documentation

◆ Clear()

void Apac.Monitoring.Alert.Clear ( string  clearedBy)
inline

Clears this instance by setting the ClearTime. This is a one-time operation.

Parameters
clearedByA string describing the clearing agent ('user', 'system', etc).

◆ CompareTo()

int Apac.Monitoring.Alert.CompareTo ( object  obj)
inline

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Parameters
objAn object to compare with this instance.
Returns
A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than obj . Zero This instance is equal to obj . Greater than zero This instance is greater than obj .
Exceptions
T:System.ArgumentExceptionobj is not the same type as this instance.

◆ Increment()

bool Apac.Monitoring.Alert.Increment ( )
inline

Increments the count and sets the timestamp if the alert is cleared, otherwise it does nothing.

◆ OnReadXml()

override void Apac.Monitoring.Alert.OnReadXml ( System.Xml.XmlReader  reader)
inlineprotectedvirtual

Called when deserializing via XML.

Parameters
readerThe reader.

Implements Apac.Monitoring.Persistable.

◆ OnWriteXml()

override void Apac.Monitoring.Alert.OnWriteXml ( System.Xml.XmlWriter  writer)
inlineprotectedvirtual

Called when serializing via XML.

Parameters
writerThe writer.

Implements Apac.Monitoring.Persistable.

Property Documentation

◆ Bucket

int Apac.Monitoring.Alert.Bucket
get

Gets the bucket, which is a five minute period. There are 12 buckets in an hour and 288 buckets in a day.

◆ ClearedBy

string Apac.Monitoring.Alert.ClearedBy
get

Gets the agent that cleared the alert ('user', 'system', etc).

The cleared by.

◆ ClearEvent

EventDef Apac.Monitoring.Alert.ClearEvent
get

Gets the event def to fire when the alert clears.

The event.

◆ ClearTime

DateTime Apac.Monitoring.Alert.ClearTime
get

Gets the time the alert was cleared.

The clear time.

◆ Count

uint Apac.Monitoring.Alert.Count
get

Gets the number of times this alert has been triggered before it cleared.

The count.

◆ Description

string Apac.Monitoring.Alert.Description
getset

Gets or sets the description.

The description.

◆ Duration

TimeSpan Apac.Monitoring.Alert.Duration
get

Gets the duration that the alert was active. If it is still active (ie: not cleared) then duration will be TimeSpan.Zero.

◆ Element

ManagedElement Apac.Monitoring.Alert.Element
get

Gets the element to which the alert applies.

The element.

◆ ElementId

uint Apac.Monitoring.Alert.ElementId
get

Gets the element id.

◆ ElementName

string Apac.Monitoring.Alert.ElementName
get

Gets the name of the element.

The name of the element.

◆ Event

EventDef Apac.Monitoring.Alert.Event
get

Gets the event that caused the alert.

The event.

◆ Id

uint Apac.Monitoring.Alert.Id
getset

Gets or sets the id.

The id.

◆ IsCleared

bool Apac.Monitoring.Alert.IsCleared
get

Gets a value indicating whether this instance is cleared.

true if this instance is cleared; otherwise, false.

◆ LastTime

DateTime Apac.Monitoring.Alert.LastTime
get

Gets the last time the alert was in force.

◆ Offset

int Apac.Monitoring.Alert.Offset
get

Gets the offset into the bucket in seconds.

◆ Timestamp

DateTime Apac.Monitoring.Alert.Timestamp
get

Gets the timestamp.


The documentation for this class was generated from the following file: