//****************************************************************************************************** // IArchive.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/21/2009 - Pinal C. Patel // Generated original version of source code. // 09/02/2009 - Pinal C. Patel // Modified ReadData() to take start and end times as strings for flexibility. // 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 System.Collections.Generic; namespace GSF.Historian { /// /// Defines a repository where time-series data is warehoused by a historian. /// /// public interface IArchive { /// /// Occurs when associated Metadata file is updated. /// event EventHandler MetadataUpdated; /// /// Opens the repository. /// void Open(); /// /// Closes the repository. /// void Close(); /// /// Writes time-series data to the repository. /// /// to be written. void WriteData(IDataPoint dataPoint); /// /// Writes meta information for the specified to the repository. /// /// Historian identifier. /// Binary image of the meta information. void WriteMetaData(int historianID, byte[] metaData); /// /// Writes state information for the specified to the repository. /// /// Historian identifier. /// Binary image of the state information. void WriteStateData(int historianID, byte[] stateData); /// /// Reads time-series data from the repository. /// /// Historian identifier for which s are to be read. /// representation of the start time (in UTC) of the timespan for which s are to be read. /// representation of the end time (in UTC) of the timespan for which s are to be read. /// Indicates whether the data retrieved from the archive should be time sorted. /// object containing zero or more s. IEnumerable ReadData(int historianID, string startTime, string endTime, bool timeSorted = true); /// /// Reads time-series data from the repository. /// /// Historian identifier for which time-series data are to be retrieved. /// Start (in UTC) for the time-series data to be retrieved. /// End (in UTC) for the time-series data to be retrieved. /// Indicates whether the data retrieved from the archive should be time sorted. /// object containing zero or more time-series data. IEnumerable ReadData(int historianID, DateTime startTime, DateTime endTime, bool timeSorted = true); /// /// Reads time-series data from the repository. /// /// Historian identifiers for which s are to be read. /// representation of the start time (in UTC) of the timespan for which s are to be read. /// representation of the end time (in UTC) of the timespan for which s are to be read. /// Indicates whether the data retrieved from the archive should be time sorted. /// object containing zero or more s. IEnumerable ReadData(IEnumerable historianIDs, string startTime, string endTime, bool timeSorted = true); /// /// Reads time-series data from the repository. /// /// Historian identifiers for which s are to be read. /// Start (in UTC) for the time-series data to be retrieved. /// End (in UTC) for the time-series data to be retrieved. /// Indicates whether the data retrieved from the archive should be time sorted. /// object containing zero or more s. IEnumerable ReadData(IEnumerable historianIDs, DateTime startTime, DateTime endTime, bool timeSorted = true); /// /// Read meta information for the specified . /// /// Historian identifier. /// A array containing meta information. byte[] ReadMetaData(int historianID); /// /// Reads state information for the specified . /// /// Historian identifier. /// A array containing state information. byte[] ReadStateData(int historianID); /// /// Reads meta information summary for the specified . /// /// Historian identifier. /// A array containing meta information summary. byte[] ReadMetaDataSummary(int historianID); /// /// Read state information summary for the specified . /// /// Historian identifier. /// A array containing state information summary. byte[] ReadStateDataSummary(int historianID); } }