Class AlertHandler
Represents an alert handler assignment to particular alert type or alert group. The entity contains configuration of that alert handler.
Inherited Members
Namespace: Nevatech.Vsb.Repository.Entities
Assembly: Nevatech.Vsb.Repository.dll
Syntax
[DataContract(Namespace = "http://schemas.nevatech.com/sentinet/2011/02")]
[KnownType(typeof(SmtpAlertHandlerConfiguration))]
[KnownType(typeof(CommandAlertHandlerConfiguration))]
[KnownType(typeof(EventLogAlertHandlerConfiguration))]
public sealed class AlertHandler : DomainObjectBase, IValidator, IExtensibleDataObject, IEquatable<AlertHandler>
Constructors
AlertHandler()
Initializes an empty instance.
Declaration
public AlertHandler()
AlertHandler(AlertHandler)
Initializes a new instance by copying all properties from the provided alert handler.
Declaration
public AlertHandler(AlertHandler alertHandler)
Parameters
| Type | Name | Description |
|---|---|---|
| AlertHandler | alertHandler | Alert handler to be initialized from. |
Properties
AlertGroupId
Gets or sets the identifier of alert group that handler must process. AlertGroupId and AlertTypeId are mutually exclusive, but AlertSubtype can be used with both.
Declaration
[DataMember(EmitDefaultValue = false)]
public int? AlertGroupId { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
AlertHandlerTypeId
Gets or sets the identifier of the alert handler type that needs to be instantiated.
Declaration
[DataMember]
public int AlertHandlerTypeId { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
AlertSubtype
Gets or sets the identifier of alert type subtype that handler must process. AlertGroupId and AlertTypeId are mutually exclusive, but AlertSubtype can be used with both.
Declaration
[DataMember(EmitDefaultValue = false)]
public string AlertSubtype { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
AlertTypeId
Gets or sets the identifier of alert type that handler must process. AlertGroupId and AlertTypeId are mutually exclusive, but AlertSubtype can be used with both.
Declaration
[DataMember(EmitDefaultValue = false)]
public int? AlertTypeId { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
Configuration
Gets or sets the handler's private configuration.
Declaration
[DataMember(EmitDefaultValue = false)]
public string Configuration { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ExecutionTimeInterval
Gets or sets the minimum time interval length between two subsequent handler executions. Handler is provided with alerts generated since its last execution.
Declaration
[DataMember(Name = "Interval", EmitDefaultValue = false)]
public int ExecutionTimeInterval { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
ExecutionTimeUnit
Gets or sets the measure units of the minimum time interval between two subsequent handler executions. Handler is provided with alerts generated since its last execution.
Declaration
[DataMember(Name = "IntervalUnit", EmitDefaultValue = false)]
public TimeUnit ExecutionTimeUnit { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeUnit |
IsEnabled
Gets or sets flag indicating that handler is currently enabled and can process alerts.
Declaration
[DataMember(EmitDefaultValue = false)]
public bool IsEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
LastExecutionTime
Gets date and time of the handler's last execution.
Declaration
[DataMember(EmitDefaultValue = false)]
public DateTime? LastExecutionTime { get; }
Property Value
| Type | Description |
|---|---|
| DateTime? |
ObjectType
Gets object type identifier.
Declaration
public override EntityType ObjectType { get; }
Property Value
| Type | Description |
|---|---|
| EntityType |
Overrides
Methods
Equals(AlertHandler)
Determines whether the specified object is equal to the current object.
Declaration
public bool Equals(AlertHandler other)
Parameters
| Type | Name | Description |
|---|---|---|
| AlertHandler | other | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | True, if objects are equal. False, if objects are not equal. |
Equals(AlertHandler, bool)
Determines whether the specified object is equal to the current object.
Declaration
public bool Equals(AlertHandler other, bool useXmlComparison)
Parameters
| Type | Name | Description |
|---|---|---|
| AlertHandler | other | The object to compare with the current object. |
| bool | useXmlComparison | Flag indicating that Configuration property contains XML, so XML-based comparison should be used. If False then simple string comparison is used. |
Returns
| Type | Description |
|---|---|
| bool | True, if objects are equal. False, if objects are not equal. |
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | True, if objects are equal. False, if objects are not equal. |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | Hash code of the current instance. |
Overrides
Validate()
Evaluates the state of this object.
Declaration
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
public override bool Validate()
Returns
| Type | Description |
|---|---|
| bool | True if state is valid; otherwise, false. |