//******************************************************************************************************
// IaonSession.cs - Gbtc
//
// Copyright © 2010, 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 Eclipse Public License -v 1.0 (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/eclipse-1.0.php
//
// 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:
// ----------------------------------------------------------------------------------------------------
// 08/23/2011 - J. Ritchie Carroll
// Generated original version of source code.
//
//******************************************************************************************************
using GSF.Collections;
using GSF.Configuration;
using System;
using System.Collections.Concurrent;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading;
namespace GSF.TimeSeries.Adapters
{
///
/// Represents a new Input, Action, Output interface session.
///
public class IaonSession : IProvideStatus, IDisposable
{
#region [ Members ]
// Constants
///
/// Default value for property.
///
public const bool DefaultUseMeasurementRouting = true;
// Events
///
/// Provides status messages to consumer.
///
///
/// is the new status message.
/// is the message .
///
public event EventHandler> StatusMessage;
///
/// Event is raised when there is an exception encountered while processing.
///
///
/// is the exception that was thrown.
///
public event EventHandler> ProcessException;
///
/// Event is raised when are updated.
///
public event EventHandler InputMeasurementKeysUpdated;
///
/// Event is raised when are updated.
///
public event EventHandler OutputMeasurementsUpdated;
///
/// Event is raised every five seconds allowing consumer to track current number of unpublished seconds of data in the queue.
///
///
/// is the total number of unpublished seconds of data.
///
public event EventHandler> UnpublishedSamples;
///
/// Event is raised every five seconds allowing host to track total number of unprocessed measurements.
///
///
///
/// Each implementation reports its current queue size of unprocessed
/// measurements so that if queue size reaches an unhealthy threshold, host can take evasive action.
///
///
/// is total number of unprocessed measurements.
///
///
public event EventHandler> UnprocessedMeasurements;
///
/// Indicates to the host that processing for one of the input adapters has completed.
///
///
/// This event is expected to only be raised when an input adapter has been designed to process
/// a finite amount of data, e.g., reading a historical range of data during temporal procesing.
///
public event EventHandler ProcessingComplete;
///
/// Event is raised when this is disposed or an in the collection is disposed.
///
public event EventHandler Disposed;
// Fields
private Guid m_nodeID;
private RoutingTables m_routingTables;
private AllAdaptersCollection m_allAdapters;
private InputAdapterCollection m_inputAdapters;
private ActionAdapterCollection m_actionAdapters;
private OutputAdapterCollection m_outputAdapters;
private ConcurrentDictionary m_waitHandles;
private ConcurrentDictionary