Class HsqldbDaqAbstractReader<T extends java.io.Serializable>

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.marid.db.dao.DaqMXBean, org.marid.db.dao.DaqReader<T>
    Direct Known Subclasses:
    HsqldbDaqNumericReader, HsqldbDaqNumericWriter

    public abstract class HsqldbDaqAbstractReader<T extends java.io.Serializable>
    extends java.lang.Object
    implements org.marid.db.dao.DaqReader<T>
    Author:
    Dmitry Ovchinnikov.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected HsqldbDaqAbstractReader​(javax.sql.DataSource dataSource, java.lang.String table)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      org.marid.db.data.DataRecord<T> fetchRecord​(long tag, long instant)  
      java.util.List<org.marid.db.data.DataRecord<T>> fetchRecords​(long[] tags, long from, long to)  
      long getRecordCount()  
      protected abstract java.lang.String getSqlTypeName()  
      protected abstract T getValue​(java.sql.ResultSet resultSet, int index)  
      java.util.Map<java.lang.Long,​java.lang.String> hash​(long from, long to, boolean includeData, java.lang.String algorithm)  
      protected abstract void setValue​(java.sql.PreparedStatement statement, int index, T value)  
      long tagCount​(long from, long to)  
      long[] tags​(long from, long to)  
      protected abstract byte[] toByteArray​(T value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HsqldbDaqAbstractReader

        protected HsqldbDaqAbstractReader​(javax.sql.DataSource dataSource,
                                          java.lang.String table)
    • Method Detail

      • tags

        public long[] tags​(long from,
                           long to)
        Specified by:
        tags in interface org.marid.db.dao.DaqReader<T extends java.io.Serializable>
      • tagCount

        public long tagCount​(long from,
                             long to)
        Specified by:
        tagCount in interface org.marid.db.dao.DaqReader<T extends java.io.Serializable>
      • fetchRecord

        public org.marid.db.data.DataRecord<T> fetchRecord​(long tag,
                                                           long instant)
        Specified by:
        fetchRecord in interface org.marid.db.dao.DaqReader<T extends java.io.Serializable>
      • fetchRecords

        public java.util.List<org.marid.db.data.DataRecord<T>> fetchRecords​(long[] tags,
                                                                            long from,
                                                                            long to)
        Specified by:
        fetchRecords in interface org.marid.db.dao.DaqReader<T extends java.io.Serializable>
      • hash

        public java.util.Map<java.lang.Long,​java.lang.String> hash​(long from,
                                                                         long to,
                                                                         boolean includeData,
                                                                         java.lang.String algorithm)
        Specified by:
        hash in interface org.marid.db.dao.DaqReader<T extends java.io.Serializable>
      • getRecordCount

        public long getRecordCount()
        Specified by:
        getRecordCount in interface org.marid.db.dao.DaqMXBean
      • setValue

        protected abstract void setValue​(java.sql.PreparedStatement statement,
                                         int index,
                                         T value)
                                  throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getValue

        protected abstract T getValue​(java.sql.ResultSet resultSet,
                                      int index)
                               throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • toByteArray

        protected abstract byte[] toByteArray​(@NotNull
                                              T value)
      • getSqlTypeName

        protected abstract java.lang.String getSqlTypeName()
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception