Class AbstractJDBCConfigurationStore
- java.lang.Object
-
- org.apache.qpid.server.store.jdbc.AbstractJDBCConfigurationStore
-
- All Implemented Interfaces:
org.apache.qpid.server.store.DurableConfigurationStore,org.apache.qpid.server.store.MessageStoreProvider
- Direct Known Subclasses:
GenericJDBCConfigurationStore
public abstract class AbstractJDBCConfigurationStore extends java.lang.Object implements org.apache.qpid.server.store.MessageStoreProvider, org.apache.qpid.server.store.DurableConfigurationStore
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractJDBCConfigurationStore.State
-
Constructor Summary
Constructors Constructor Description AbstractJDBCConfigurationStore()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddDeleteAction(org.apache.qpid.server.util.Action<java.sql.Connection> action)protected voidassertState(AbstractJDBCConfigurationStore.State state)protected voidchangeState(AbstractJDBCConfigurationStore.State oldState, AbstractJDBCConfigurationStore.State newState)voidcreate(org.apache.qpid.server.store.ConfiguredObjectRecord object)protected voidcreateOrOpenConfigurationStoreDatabase()protected voiddoIfNotState(AbstractJDBCConfigurationStore.State state, java.lang.Runnable action)protected abstract java.lang.StringgetBlobAsString(java.sql.ResultSet rs, int col)protected abstract java.sql.ConnectiongetConnection()protected abstract org.slf4j.LoggergetLogger()protected abstract java.lang.StringgetSqlBigIntType()protected abstract java.lang.StringgetSqlBlobStorage(java.lang.String columnName)protected abstract java.lang.StringgetSqlBlobType()protected abstract java.lang.StringgetSqlVarBinaryType(int size)protected java.sql.ConnectionnewAutoCommitConnection()Convenience method to create a new Connection configured for TRANSACTION_READ_COMMITED isolation and with auto-commit transactions enabled.protected java.sql.ConnectionnewConnection()Convenience method to create a new Connection configured for TRANSACTION_READ_COMMITED isolation and with auto-commit transactions disabled.booleanopenConfigurationStore(org.apache.qpid.server.store.handler.ConfiguredObjectRecordHandler handler, org.apache.qpid.server.store.ConfiguredObjectRecord... initialRecords)voidreload(org.apache.qpid.server.store.handler.ConfiguredObjectRecordHandler handler)java.util.UUID[]remove(org.apache.qpid.server.store.ConfiguredObjectRecord... objects)voidremoveDeleteAction(org.apache.qpid.server.util.Action<java.sql.Connection> action)protected voidsetState(AbstractJDBCConfigurationStore.State newState)protected voidsetTableNamePrefix(java.lang.String tableNamePrefix)protected booleantableExists(java.lang.String tableName, java.sql.Connection conn)voidupdate(boolean createIfNecessary, org.apache.qpid.server.store.ConfiguredObjectRecord... records)protected voidupgradeIfNecessary(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
-
-
-
-
Method Detail
-
setTableNamePrefix
protected void setTableNamePrefix(java.lang.String tableNamePrefix)
-
openConfigurationStore
public boolean openConfigurationStore(org.apache.qpid.server.store.handler.ConfiguredObjectRecordHandler handler, org.apache.qpid.server.store.ConfiguredObjectRecord... initialRecords)- Specified by:
openConfigurationStorein interfaceorg.apache.qpid.server.store.DurableConfigurationStore
-
reload
public void reload(org.apache.qpid.server.store.handler.ConfiguredObjectRecordHandler handler) throws org.apache.qpid.server.store.StoreException- Specified by:
reloadin interfaceorg.apache.qpid.server.store.DurableConfigurationStore- Throws:
org.apache.qpid.server.store.StoreException
-
upgradeIfNecessary
protected void upgradeIfNecessary(org.apache.qpid.server.model.ConfiguredObject<?> parent) throws org.apache.qpid.server.store.StoreException- Throws:
org.apache.qpid.server.store.StoreException
-
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()
-
createOrOpenConfigurationStoreDatabase
protected void createOrOpenConfigurationStoreDatabase() 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
-
create
public void create(org.apache.qpid.server.store.ConfiguredObjectRecord object) throws org.apache.qpid.server.store.StoreException- Specified by:
createin interfaceorg.apache.qpid.server.store.DurableConfigurationStore- Throws:
org.apache.qpid.server.store.StoreException
-
newAutoCommitConnection
protected java.sql.Connection newAutoCommitConnection() throws java.sql.SQLExceptionConvenience 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.SQLExceptionConvenience method to create a new Connection configured for TRANSACTION_READ_COMMITED isolation and with auto-commit transactions disabled.- Throws:
java.sql.SQLException
-
getConnection
protected abstract java.sql.Connection getConnection() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
remove
public java.util.UUID[] remove(org.apache.qpid.server.store.ConfiguredObjectRecord... objects) throws org.apache.qpid.server.store.StoreException- Specified by:
removein interfaceorg.apache.qpid.server.store.DurableConfigurationStore- Throws:
org.apache.qpid.server.store.StoreException
-
update
public void update(boolean createIfNecessary, org.apache.qpid.server.store.ConfiguredObjectRecord... records) throws org.apache.qpid.server.store.StoreException- Specified by:
updatein interfaceorg.apache.qpid.server.store.DurableConfigurationStore- Throws:
org.apache.qpid.server.store.StoreException
-
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)
-
getBlobAsString
protected abstract java.lang.String getBlobAsString(java.sql.ResultSet rs, int col) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
assertState
protected final void assertState(AbstractJDBCConfigurationStore.State state)
-
changeState
protected final void changeState(AbstractJDBCConfigurationStore.State oldState, AbstractJDBCConfigurationStore.State newState)
-
setState
protected final void setState(AbstractJDBCConfigurationStore.State newState)
-
doIfNotState
protected final void doIfNotState(AbstractJDBCConfigurationStore.State state, java.lang.Runnable action)
-
-