Class DatasourceHistoryInterface


  • public class DatasourceHistoryInterface
    extends java.lang.Object
    This class is related to the datasource history loader, but stands more on its own. It provides functions for easily querying information like tag info, and scan class exec records.
    • Constructor Detail

      • DatasourceHistoryInterface

        public DatasourceHistoryInterface​(ConnectionProvider<SRConnection> connProv,
                                          java.lang.String systemName,
                                          java.lang.String providerName,
                                          java.lang.String queryId,
                                          LoggerEx logger)
    • Method Detail

      • getSystemName

        public java.lang.String getSystemName()
      • getProviderName

        public java.lang.String getProviderName()
      • getLogger

        protected LoggerEx getLogger()
      • getQueryId

        protected java.lang.String getQueryId()
      • getConnection

        protected SRConnection getConnection()
                                      throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • maybeLoadIds

        protected void maybeLoadIds()
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getSystemId

        public int getSystemId()
                        throws java.lang.Exception
        Returns the system id, or -1 if the system name cannot be found. *
        Throws:
        java.lang.Exception
      • getProviderId

        public int getProviderId()
                          throws java.lang.Exception
        Returns the provider id, or -1 if the provider is not specified or not found. *
        Throws:
        java.lang.Exception
      • getExemptSCIds

        protected java.util.Set<java.lang.Integer> getExemptSCIds()
                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isScanClassExempt

        protected boolean isScanClassExempt​(int id)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • loadTagInfo

        protected HistoricalInfoMap loadTagInfo​(java.util.Collection<java.lang.String> tagPaths,
                                                long startTime,
                                                long endTime)
                                         throws java.lang.Exception
        Returns historical tag information, broken up by tag path.

        The tag infos are sorted by In regards to old tag information, where the created and retired times weren't recorded, the retired time will be set to the created time of the subsequent record, if such a record exists.

        Throws:
        java.lang.Exception
      • loadSCExecRecords

        public SCExecMap loadSCExecRecords​(java.util.Set<java.lang.Integer> scids,
                                           long start,
                                           long end)
                                    throws java.lang.Exception
        Loads the scan class execution records between the start time and the end time. Start time is passed in, because it could be different depending on whether or not seed data is available.
        Throws:
        java.lang.Exception
      • loadDataHistogram

        public TimelineSet loadDataHistogram​(java.util.Collection<java.lang.String> tagPaths,
                                             long start,
                                             long end)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • loadTagGoodQualityTimelines

        protected java.util.Map<java.lang.String,​Timeline> loadTagGoodQualityTimelines​(java.util.Collection<java.lang.String> tagPaths,
                                                                                             long start,
                                                                                             long end)
                                                                                      throws java.lang.Exception
        Throws:
        java.lang.Exception