public abstract class AbstractJDBCConfigurationStore extends Object implements MessageStoreProvider, DurableConfigurationStore
Modifier and Type | Field and Description |
---|---|
static Set<String> |
CONFIGURATION_STORE_TABLE_NAMES |
Constructor and Description |
---|
AbstractJDBCConfigurationStore() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
checkConfigurationStoreOpen() |
void |
create(ConfiguredObjectRecord object)
Makes the specified object persistent.
|
protected void |
createOrOpenConfigurationStoreDatabase(boolean clear) |
protected abstract String |
getBlobAsString(ResultSet rs,
int col) |
protected abstract Connection |
getConnection() |
protected abstract org.slf4j.Logger |
getLogger() |
protected abstract String |
getSqlBigIntType() |
protected abstract String |
getSqlBlobType() |
protected abstract String |
getSqlVarBinaryType(int size) |
protected boolean |
hasNoConfigurationEntries() |
protected Connection |
newAutoCommitConnection()
Convenience method to create a new Connection configured for TRANSACTION_READ_COMMITED
isolation and with auto-commit transactions enabled.
|
protected Connection |
newConnection()
Convenience method to create a new Connection configured for TRANSACTION_READ_COMMITED
isolation and with auto-commit transactions disabled.
|
void |
onDelete(ConfiguredObject<?> parent)
Deletes the configuration store from its underlying storage.
|
UUID[] |
remove(ConfiguredObjectRecord... objects)
Removes the specified persistent configured objects.
|
protected boolean |
tableExists(String tableName,
Connection conn) |
void |
update(boolean createIfNecessary,
ConfiguredObjectRecord... records)
Updates the specified objects in the persistent store, IF it is already present.
|
protected void |
upgradeIfNecessary(ConfiguredObject<?> parent) |
void |
visitConfiguredObjectRecords(ConfiguredObjectRecordHandler handler)
Visit all configured object records with given handler.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMessageStore
closeConfigurationStore, openConfigurationStore, upgradeStoreStructure
public void visitConfiguredObjectRecords(ConfiguredObjectRecordHandler handler)
DurableConfigurationStore
visitConfiguredObjectRecords
in interface DurableConfigurationStore
handler
- a handler to invoke on each configured object recordprotected abstract void checkConfigurationStoreOpen()
protected void upgradeIfNecessary(ConfiguredObject<?> parent) throws StoreException
StoreException
protected abstract org.slf4j.Logger getLogger()
protected abstract String getSqlBlobType()
protected abstract String getSqlVarBinaryType(int size)
protected abstract String getSqlBigIntType()
protected void createOrOpenConfigurationStoreDatabase(boolean clear) throws StoreException
StoreException
protected boolean tableExists(String tableName, Connection conn) throws SQLException
SQLException
public void create(ConfiguredObjectRecord object) throws StoreException
DurableConfigurationStore
create
in interface DurableConfigurationStore
object
- The object to persist.StoreException
- If the operation fails for any reason.protected Connection newAutoCommitConnection() throws SQLException
SQLException
protected Connection newConnection() throws SQLException
SQLException
protected boolean hasNoConfigurationEntries()
protected abstract Connection getConnection() throws SQLException
SQLException
public UUID[] remove(ConfiguredObjectRecord... objects) throws StoreException
DurableConfigurationStore
remove
in interface DurableConfigurationStore
objects
- The objects to remove.StoreException
- If the operation fails for any reason.public void update(boolean createIfNecessary, ConfiguredObjectRecord... records) throws StoreException
DurableConfigurationStore
update
in interface DurableConfigurationStore
createIfNecessary
- if false then will fail if the object does not exist.records
- the records to updateStoreException
- If the operation fails for any reason.protected abstract String getBlobAsString(ResultSet rs, int col) throws SQLException
SQLException
public void onDelete(ConfiguredObject<?> parent)
DurableConfigurationStore
onDelete
in interface DurableConfigurationStore
Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.