Click or drag to resize

OutageLog Class

Represents a persisted log of outages as a list of start and stop times.
Inheritance Hierarchy
SystemObject
  GSF.IOOutageLog

Namespace: GSF.IO
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.181-beta
Syntax
public class OutageLog : IProvideStatus, IDisposable
View Source

The OutageLog type exposes the following members.

Constructors
 NameDescription
Public methodOutageLog Creates a new OutageLog.
Top
Properties
 NameDescription
Public propertyCount Gets the number of outages in the log.
Public propertyFileName Gets or sets the file name for the outage log; file name can be set with a relative path.
Public propertyIsDisposed Gets a flag that indicates whether the object has been disposed.
Public propertyOutages Gets the full list of outages in the log.
Public propertyStatus Gets the current status details about OutageLog.
Top
Methods
 NameDescription
Public methodAdd(Outage) Adds an outage to the OutageLog.
Public methodAdd(DateTimeOffset, DateTimeOffset) Adds an outage to the OutageLog.
Public methodDispose Releases all the resources used by the OutageLog object.
Protected methodDispose(Boolean) Releases the unmanaged resources used by the OutageLog object and optionally releases the managed resources.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalize Releases the unmanaged resources before the OutageLog object is reclaimed by GC.
(Overrides ObjectFinalize)
Public methodFirst Gets the first outage in the list of outages.
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodInitialize Initialize the outage log.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodRemove Removes the given outage from the outage log.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Events
 NameDescription
Public eventDisposed Raised after the outage log has been properly disposed.
Public eventLogModified Event is raised when the outage log is modified.
Public eventProcessException Event is raised when there is an exception encountered while processing outage log.
Top
Fields
 NameDescription
Public fieldStatic memberDateTimeFormat Date-time format used by OutageLog.
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Remarks

This class serializes a list of outages (e.g., a connection outage or data loss) where each outage consists of a start and end time. The outages are persisted in a log file so that the log can be operated on even through host application restarts until the outages are processed.

All members in the OutageLog are guaranteed to be thread safe. File locks are used to provide synchronization so that the file can stay up-to-date with changes made in the application.

See Also