Class AbstractJDBCMessageStore

  • All Implemented Interfaces:
    org.apache.qpid.server.store.MessageStore
    Direct Known Subclasses:
    GenericAbstractJDBCMessageStore

    public abstract class AbstractJDBCMessageStore
    extends java.lang.Object
    implements org.apache.qpid.server.store.MessageStore
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  AbstractJDBCMessageStore.JDBCTransaction  
      • Nested classes/interfaces inherited from interface org.apache.qpid.server.store.MessageStore

        org.apache.qpid.server.store.MessageStore.MessageDeleteListener, org.apache.qpid.server.store.MessageStore.MessageStoreReader
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.qpid.server.store.EventManager _eventManager  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addDeleteAction​(org.apache.qpid.server.util.Action<java.sql.Connection> action)  
      void addEventListener​(org.apache.qpid.server.store.EventListener eventListener, org.apache.qpid.server.store.Event... events)  
      <T extends org.apache.qpid.server.store.StorableMessageMetaData>
      org.apache.qpid.server.store.MessageHandle<T>
      addMessage​(T metaData)  
      void addMessageDeleteListener​(org.apache.qpid.server.store.MessageStore.MessageDeleteListener listener)  
      protected abstract void checkMessageStoreOpen()  
      void closeMessageStore()  
      protected void createOrOpenMessageStoreDatabase()  
      <T extends org.apache.qpid.server.store.StorableMessageMetaData>
      org.apache.qpid.server.store.jdbc.AbstractJDBCMessageStore.StoredJDBCMessage<T>
      createStoredJDBCMessage​(long newMessageId, T metaData, boolean recovered)  
      protected abstract java.io.InputStream getBlobAsInputStream​(java.sql.ResultSet rs, int col)  
      long getBytesEvacuatedFromMemory()  
      abstract java.sql.Connection getConnection()  
      long getInMemorySize()  
      protected abstract org.slf4j.Logger getLogger()  
      long getNextMessageId()  
      protected abstract java.lang.String getSqlBigIntType()  
      protected abstract java.lang.String getSqlBlobStorage​(java.lang.String columnName)  
      protected abstract java.lang.String getSqlBlobType()  
      protected abstract java.lang.String getSqlVarBinaryType​(int size)  
      java.util.List<java.lang.String> getTableNames()  
      protected void initMessageStore​(org.apache.qpid.server.model.ConfiguredObject<?> parent)  
      protected abstract boolean isMessageStoreOpen()  
      boolean isPersistent()  
      protected java.sql.Connection newAutoCommitConnection()
      Convenience method to create a new Connection configured for TRANSACTION_READ_COMMITED isolation and with auto-commit transactions enabled.
      protected java.sql.Connection newConnection()
      Convenience method to create a new Connection configured for TRANSACTION_READ_COMMITED isolation and with auto-commit transactions disabled.
      org.apache.qpid.server.store.MessageStore.MessageStoreReader newMessageStoreReader()  
      org.apache.qpid.server.store.Transaction newTransaction()  
      protected void onDelete​(java.sql.Connection conn)  
      void removeDeleteAction​(org.apache.qpid.server.util.Action<java.sql.Connection> action)  
      void removeMessageDeleteListener​(org.apache.qpid.server.store.MessageStore.MessageDeleteListener listener)  
      void resetStatistics()  
      protected void setMaximumMessageId()  
      protected void setTablePrefix​(java.lang.String tablePrefix)  
      protected abstract void storedSizeChange​(int storeSizeIncrease)  
      protected boolean tableExists​(java.lang.String tableName, java.sql.Connection conn)  
      protected void upgrade​(org.apache.qpid.server.model.ConfiguredObject<?> parent)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.qpid.server.store.MessageStore

        getStoreLocation, getStoreLocationAsFile, onDelete, openMessageStore, upgradeStoreStructure
    • Field Detail

      • _eventManager

        protected final org.apache.qpid.server.store.EventManager _eventManager
    • Constructor Detail

      • AbstractJDBCMessageStore

        public AbstractJDBCMessageStore()
    • Method Detail

      • isMessageStoreOpen

        protected abstract boolean isMessageStoreOpen()
      • checkMessageStoreOpen

        protected abstract void checkMessageStoreOpen()
      • setMaximumMessageId

        protected void setMaximumMessageId()
      • upgrade

        protected void upgrade​(org.apache.qpid.server.model.ConfiguredObject<?> parent)
                        throws org.apache.qpid.server.store.StoreException
        Throws:
        org.apache.qpid.server.store.StoreException
      • initMessageStore

        protected void initMessageStore​(org.apache.qpid.server.model.ConfiguredObject<?> parent)
      • closeMessageStore

        public void closeMessageStore()
        Specified by:
        closeMessageStore in interface org.apache.qpid.server.store.MessageStore
      • getLogger

        protected abstract org.slf4j.Logger getLogger()
      • getSqlBlobType

        protected abstract java.lang.String getSqlBlobType()
      • getSqlBlobStorage

        protected abstract java.lang.String getSqlBlobStorage​(java.lang.String columnName)
      • getSqlVarBinaryType

        protected abstract java.lang.String getSqlVarBinaryType​(int size)
      • getSqlBigIntType

        protected abstract java.lang.String getSqlBigIntType()
      • createOrOpenMessageStoreDatabase

        protected void createOrOpenMessageStoreDatabase()
                                                 throws org.apache.qpid.server.store.StoreException
        Throws:
        org.apache.qpid.server.store.StoreException
      • tableExists

        protected boolean tableExists​(java.lang.String tableName,
                                      java.sql.Connection conn)
                               throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • addMessage

        public <T extends org.apache.qpid.server.store.StorableMessageMetaData> org.apache.qpid.server.store.MessageHandle<T> addMessage​(T metaData)
        Specified by:
        addMessage in interface org.apache.qpid.server.store.MessageStore
      • createStoredJDBCMessage

        public <T extends org.apache.qpid.server.store.StorableMessageMetaData> org.apache.qpid.server.store.jdbc.AbstractJDBCMessageStore.StoredJDBCMessage<T> createStoredJDBCMessage​(long newMessageId,
                                                                                                                                                                                        T metaData,
                                                                                                                                                                                        boolean recovered)
      • getNextMessageId

        public long getNextMessageId()
        Specified by:
        getNextMessageId in interface org.apache.qpid.server.store.MessageStore
      • newAutoCommitConnection

        protected java.sql.Connection newAutoCommitConnection()
                                                       throws java.sql.SQLException
        Convenience method to create a new Connection configured for TRANSACTION_READ_COMMITED isolation and with auto-commit transactions enabled.
        Throws:
        java.sql.SQLException
      • newConnection

        protected java.sql.Connection newConnection()
                                             throws java.sql.SQLException
        Convenience method to create a new Connection configured for TRANSACTION_READ_COMMITED isolation and with auto-commit transactions disabled.
        Throws:
        java.sql.SQLException
      • getConnection

        public abstract java.sql.Connection getConnection()
                                                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • newTransaction

        public org.apache.qpid.server.store.Transaction newTransaction()
        Specified by:
        newTransaction in interface org.apache.qpid.server.store.MessageStore
      • setTablePrefix

        protected void setTablePrefix​(java.lang.String tablePrefix)
      • addDeleteAction

        public void addDeleteAction​(org.apache.qpid.server.util.Action<java.sql.Connection> action)
      • removeDeleteAction

        public void removeDeleteAction​(org.apache.qpid.server.util.Action<java.sql.Connection> action)
      • getBlobAsInputStream

        protected abstract java.io.InputStream getBlobAsInputStream​(java.sql.ResultSet rs,
                                                                    int col)
                                                             throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • isPersistent

        public boolean isPersistent()
        Specified by:
        isPersistent in interface org.apache.qpid.server.store.MessageStore
      • getInMemorySize

        public long getInMemorySize()
        Specified by:
        getInMemorySize in interface org.apache.qpid.server.store.MessageStore
      • getBytesEvacuatedFromMemory

        public long getBytesEvacuatedFromMemory()
        Specified by:
        getBytesEvacuatedFromMemory in interface org.apache.qpid.server.store.MessageStore
      • resetStatistics

        public void resetStatistics()
        Specified by:
        resetStatistics in interface org.apache.qpid.server.store.MessageStore
      • addMessageDeleteListener

        public void addMessageDeleteListener​(org.apache.qpid.server.store.MessageStore.MessageDeleteListener listener)
        Specified by:
        addMessageDeleteListener in interface org.apache.qpid.server.store.MessageStore
      • removeMessageDeleteListener

        public void removeMessageDeleteListener​(org.apache.qpid.server.store.MessageStore.MessageDeleteListener listener)
        Specified by:
        removeMessageDeleteListener in interface org.apache.qpid.server.store.MessageStore
      • addEventListener

        public void addEventListener​(org.apache.qpid.server.store.EventListener eventListener,
                                     org.apache.qpid.server.store.Event... events)
        Specified by:
        addEventListener in interface org.apache.qpid.server.store.MessageStore
      • newMessageStoreReader

        public org.apache.qpid.server.store.MessageStore.MessageStoreReader newMessageStoreReader()
        Specified by:
        newMessageStoreReader in interface org.apache.qpid.server.store.MessageStore
      • storedSizeChange

        protected abstract void storedSizeChange​(int storeSizeIncrease)
      • onDelete

        protected void onDelete​(java.sql.Connection conn)
      • getTableNames

        public java.util.List<java.lang.String> getTableNames()