//****************************************************************************************************** // INotifier.cs - Gbtc // // Copyright © 2012, Grid Protection Alliance. All Rights Reserved. // // Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See // the NOTICE file distributed with this work for additional information regarding copyright ownership. // The GPA licenses this file to you under the MIT License (MIT), the "License"; you may // not use this file except in compliance with the License. You may obtain a copy of the License at: // // http://www.opensource.org/licenses/MIT // // Unless agreed to in writing, the subject software distributed under the License is distributed on an // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the // License for the specific language governing permissions and limitations. // // Code Modification History: // ---------------------------------------------------------------------------------------------------- // 05/26/2007 - Pinal C. Patel // Generated original version of source code. // 04/21/2009 - Pinal C. Patel // Converted to C#. // 09/15/2009 - Stephen C. Wills // Added new header and license agreement. // 10/11/2010 - Mihir Brahmbhatt // Updated header and license agreement. // 12/14/2012 - Starlynn Danyelle Gilliam // Modified Header. // //****************************************************************************************************** using System; using GSF.Adapters; namespace GSF.Historian.Notifiers { #region [ Enumerations ] /// /// Indicates the type of notification being sent using a Notifier. /// [Flags] public enum NotificationTypes { /// /// Notification is of unknown type. /// Unknown = 0, /// /// Notification is informational in nature. /// Information = 1, /// /// Notification is being sent to report a warning. /// Warning = 2, /// /// Notification is being sent to report an alarm. /// Alarm = 4, /// /// Notification is being sent to report activity. /// Heartbeat = 8 } #endregion /// /// Defines a notifier that can process notification messages. /// /// public interface INotifier : IAdapter { #region [ Members ] // Events /// /// Occurs when a notification is being sent. /// event EventHandler NotificationSendStart; /// /// Occurs when a notification has been sent. /// event EventHandler NotificationSendComplete; /// /// Occurs when a timeout is encountered while sending a notification. /// event EventHandler NotificationSendTimeout; /// /// Occurs when an is encountered while sending a notification. /// event EventHandler> NotificationSendException; #endregion #region [ Properties ] /// /// Gets or sets the number of seconds to wait for to complete. /// int NotifyTimeout { get; set; } /// /// Gets or set that can be processed by the notifier. /// NotificationTypes NotifyOptions { get; set;} #endregion #region [ Methods ] /// /// Process a notification. /// /// Subject matter for the notification. /// Brief message for the notification. /// Detailed message for the notification. /// One of the values. /// true if notification is processed successfully; otherwise false. bool Notify(string subject, string message, string details, NotificationTypes notificationType); #endregion } }