//******************************************************************************************************
// IIndependentAdapterManager.cs - Gbtc
//
// Copyright © 2020, 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://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:
// ----------------------------------------------------------------------------------------------------
// 02/16/2020 - J. Ritchie Carroll
// Generated original version of source code.
//
//******************************************************************************************************
using System;
using System.Collections.ObjectModel;
using System.Threading;
using GSF.Data;
using GSF.Diagnostics;
using GSF.Units.EE;
namespace GSF.TimeSeries.Adapters
{
///
/// Represents the interface for implementations of independent adapter collection managers.
///
public interface IIndependentAdapterManager : IAdapterCollection
{
///
/// Gets or sets the wait timeout, in milliseconds, that system wait for system configuration reload to complete.
///
int ConfigurationReloadWaitTimeout { get; set; }
///
/// Gets or sets the total number of attempts to wait for system configuration reloads when waiting for configuration updates to be available.
///
int ConfigurationReloadWaitAttempts { get; set; }
///
/// Gets or sets the connection string used for database operations. Leave blank to use local configuration database defined in "systemSettings".
///
string DatabaseConnectionString { get; set; }
///
/// Gets or sets the provider string used for database operations. Defaults to a SQL Server provider string.
///
string DatabaseProviderString { get; set; }
///
/// Gets or sets template for output measurement point tag names.
///
string PointTagTemplate { get; set; }
///
/// Gets or sets template for output measurement alternate tag names.
///
string AlternateTagTemplate { get; set; }
///
/// Gets or sets template for output measurement signal reference names.
///
string SignalReferenceTemplate { get; set; }
///
/// Gets or sets template for output measurement descriptions.
///
string DescriptionTemplate { get; set; }
///
/// Gets or sets template for the parent device acronym used to group associated output measurements.
///
string ParentDeviceAcronymTemplate { get; set; }
///
/// Gets or sets default signal type to use for all output measurements when array is not defined.
///
SignalType SignalType { get; set; }
///
/// Gets per adapter signal type for output measurements, used when each output needs to be a different type.
///
SignalType[] SignalTypes { get; }
///
/// Gets any custom adapter settings to be added to each adapter connection string. Can be used to add
/// settings that are custom per adapter.
///
string CustomAdapterSettings { get; }
///
/// Gets or sets the target historian acronym for output measurements.
///
string TargetHistorianAcronym { get; set; }
///
/// Gets or sets the source measurement table to use for configuration.
///
string SourceMeasurementTable { get; set; }
///
/// Gets routing tables used by instance.
///
RoutingTables RoutingTables { get; set; }
///
/// Gets original data member setting for instance.
///
string OriginalDataMember { get; set; }
///
/// Gets or sets flag that determines if the instance
/// should be automatically parsed every time the
/// is updated without requiring adapter to be reinitialized.
///
bool AutoReparseConnectionString { get; set; }
///
/// Gets input measurement 's for each of the , if any.
///
SignalType[] InputMeasurementKeyTypes { get; }
///
/// Gets output measurement 's for each of the , if any.
///
SignalType[] OutputMeasurementTypes { get; }
///
/// Gets or sets wait handle used by instance to
/// manage waiting for changes to be loaded in system configuration.
///
ManualResetEventSlim ConfigurationReloadedWaitHandle { get; set; }
///
/// Gets number of input measurement required by each adapter.
///
int PerAdapterInputCount { get; }
///
/// Gets or sets the index into the per adapter input measurements to use for target adapter name.
///
int InputMeasurementIndexUsedForName { get; set; }
///
/// Gets output measurement names to use for each adapter.
///
ReadOnlyCollection PerAdapterOutputNames { get; }
///
/// Gets or sets current adapter ID counter.
///
uint AdapterIDCounter { get; set; }
///
/// Gets adapter index currently being processed.
///
int CurrentAdapterIndex { get; }
///
/// Gets adapter output index currently being processed.
///
int CurrentOutputIndex { get; }
///
/// Gets associated device ID for , if any, for measurement generation.
///
int CurrentDeviceID { get; }
///
/// Parses connection string. Derived classes should override for custom connection string parsing.
///
void ParseConnectionString();
///
/// Notifies derived classes that configuration has been reloaded.
///
void ConfigurationReloaded();
///
/// Recalculates routing tables.
///
void RecalculateRoutingTables();
///
/// Gets configured database connection.
///
/// New ADO data connection based on configured settings.
AdoDataConnection GetConfiguredConnection();
///
/// Enumerates child adapters
///
void EnumerateAdapters();
///
/// Gets subscriber information for specified client connection.
///
/// Enumerated index for child adapter.
/// Status for adapter with specified .
string GetAdapterStatus(int adapterIndex);
///
/// Raises event.
///
void OnConfigurationChanged();
///
/// Raises event.
///
void OnInputMeasurementKeysUpdated();
///
/// Raises the event and sends this data to the .
///
/// The to assign to this message
/// New status message.
/// A fixed string to classify this event; defaults to null.
/// to use, if any; defaults to .
///
/// should be a constant string value associated with what type of message is being
/// generated. In general, there should only be a few dozen distinct event names per class. Exceeding this
/// threshold will cause the EventName to be replaced with a general warning that a usage issue has occurred.
///
void OnStatusMessage(MessageLevel level, string status, string eventName = null, MessageFlags flags = MessageFlags.None);
///
/// Raises the event.
///
/// The to assign to this message
/// Processing .
/// A fixed string to classify this event; defaults to null.
/// to use, if any; defaults to .
///
/// should be a constant string value associated with what type of message is being
/// generated. In general, there should only be a few dozen distinct event names per class. Exceeding this
/// threshold will cause the EventName to be replaced with a general warning that a usage issue has occurred.
///
void OnProcessException(MessageLevel level, Exception exception, string eventName = null, MessageFlags flags = MessageFlags.None);
}
}