public abstract class BaseDatabase extends java.lang.Object implements Database
Databaseimplementation.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SYSTABLE_DB_LINKS |
static java.lang.String |
SYSTABLE_INDEX_INFO |
COMMIT_SIZE| Constructor and Description |
|---|
BaseDatabase(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDatabaseModificationListener(DatabaseModificationListener l)
Adds a listener to receive events on this database
|
void |
addIndex(Index index,
Table table)
Add the given
Indexto this database, associated with the given table. |
void |
addIndex(Index index,
Table table,
boolean doPopulate)
Add the given
Indexto this database, associating it with the given table
and (optionally) populating it. |
void |
addTable(Table t)
Add the given
Tableto this database. |
void |
checkpoint()
Make sure any modified state or data has been written to disk.
|
void |
createDatabaseLink(DatabaseLink dblink) |
protected void |
createMetaDataTables()
Should get called by subclasses in constructors
|
void |
createSequence(Sequence seq)
Create a numeric sequence
|
protected abstract Table |
createSystemTable(java.lang.String name) |
void |
dropDatabaseLink(java.lang.String name) |
void |
dropDependentExternalDBTable(java.util.List tables) |
void |
dropDependentViews(java.util.List views) |
void |
dropIndex(java.lang.String name)
Drop the given
Indexfrom this database. |
void |
dropSequence(java.lang.String name)
Drop the specified
Sequencefrom this database. |
void |
dropTable(java.lang.String name)
Drop the specified
Tablefrom this database. |
protected static java.util.Properties |
getBaseProperties()
Callers should treat the returned Properties as immutable.
|
DatabaseLink |
getDatabaseLink(java.lang.String name) |
java.util.List |
getDatabaseModificationListeners()
Returns all listeners set to receive events on this database
|
DataType |
getDataType(java.lang.String name)
Get the
DataTypecurrently registered for the given name, or null. |
java.util.List |
getDependentExternalDBTable(java.lang.String name) |
java.util.List |
getDependentViews(java.lang.String tableName) |
ConcreteFunction |
getFunction(java.lang.String name) |
java.lang.Object |
getGlobalVariable(java.lang.String key) |
IndexFactory |
getIndexFactory(java.lang.String name)
Get the
IndexFactorycurrently registered for the given name, or
null. |
java.lang.String |
getName()
Returns the name of this
Database. |
Sequence |
getSequence(java.lang.String name)
Get the specified
Sequence, or null if no such sequence can be
found. |
protected int |
getSequenceCount() |
protected java.util.Iterator<Sequence> |
getSequences() |
Table |
getTable(java.lang.String name)
Get the specified
Table, or null if no such table can be found. |
Table |
getTable(TableIdentifier table)
Get the specified
Table, or null if no such table can be found. |
TableFactory |
getTableFactory(java.lang.String name)
Get the
TableFactorycurrently registered for the given name, or
null. |
protected java.util.Iterator<Table> |
getTables() |
TransactionManager |
getTransactionManager()
Get the
TransactionManagerfor this database. |
boolean |
hasDatabaseLink(java.lang.String name) |
boolean |
hasIndex(java.lang.String name)
Returns
true iff the given Indexexists. |
boolean |
hasSequence(java.lang.String name) |
boolean |
hasTable(java.lang.String name) |
boolean |
hasTable(TableIdentifier id) |
boolean |
isReadOnly()
Is this database read-only?
|
protected void |
loadProperties(java.util.Properties props) |
void |
migrate(int version)
Migrate from older version to newer version for this database
|
void |
remount(java.io.File newdir)
Notify this database that its root directory has been moved to the given location.
|
void |
removeDatabaseModificationListener(DatabaseModificationListener l) |
void |
renameTable(java.lang.String oldName,
java.lang.String newName) |
Selectable |
resolveSelectSelectable(SubSelectCommand select,
TableIdentifier[] tables) |
void |
shutdown()
Close this database and free any resources associated with it.
|
void |
tableAltered(Table t)
Update metadata tables since this table has changed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDBDirectorypublic static final java.lang.String SYSTABLE_DB_LINKS
public static final java.lang.String SYSTABLE_INDEX_INFO
public void addDatabaseModificationListener(DatabaseModificationListener l)
DatabaseaddDatabaseModificationListener in interface Databasepublic void addIndex(Index index, Table table) throws AxionException
DatabaseIndexto this database, associated with the given table.addIndex in interface DatabaseAxionExceptionpublic void addIndex(Index index, Table table, boolean doPopulate) throws AxionException
DatabaseIndexto this database, associating it with the given table
and (optionally) populating it.addIndex in interface Databaseindex - Index to be added and (optionally) populatedtable - Table to be indexeddoPopulate - true if index should be populated by the
appropriate column in table; false if index
should be left as-is.AxionException - if error occurs during addition and/or population of
indexpublic void addTable(Table t) throws AxionException
DatabaseTableto this database.addTable in interface DatabaseAxionExceptionpublic void checkpoint()
throws AxionException
Databasecheckpoint in interface DatabaseAxionExceptionpublic void createDatabaseLink(DatabaseLink dblink) throws AxionException
createDatabaseLink in interface DatabaseAxionExceptionpublic void createSequence(Sequence seq) throws AxionException
DatabasecreateSequence in interface DatabaseAxionExceptionpublic void dropDatabaseLink(java.lang.String name)
throws AxionException
dropDatabaseLink in interface DatabaseAxionExceptionpublic void dropDependentExternalDBTable(java.util.List tables)
throws AxionException
dropDependentExternalDBTable in interface DatabaseAxionExceptionpublic void dropDependentViews(java.util.List views)
throws AxionException
dropDependentViews in interface DatabaseAxionExceptionpublic void dropIndex(java.lang.String name)
throws AxionException
DatabaseIndexfrom this database.dropIndex in interface DatabaseAxionExceptionpublic void dropSequence(java.lang.String name)
throws AxionException
DatabaseSequencefrom this database.
Sequence name matching is case-insensitive.
dropSequence in interface DatabaseAxionExceptionpublic void dropTable(java.lang.String name)
throws AxionException
DatabaseTablefrom this database.
Table name matching is case-insensitive.
dropTable in interface DatabaseAxionExceptionpublic DatabaseLink getDatabaseLink(java.lang.String name)
getDatabaseLink in interface Databasepublic java.util.List getDatabaseModificationListeners()
DatabasegetDatabaseModificationListeners in interface Databasepublic DataType getDataType(java.lang.String name)
DatabaseDataTypecurrently registered for the given name, or null.getDataType in interface Databasepublic java.util.List getDependentExternalDBTable(java.lang.String name)
getDependentExternalDBTable in interface Databasepublic java.util.List getDependentViews(java.lang.String tableName)
getDependentViews in interface Databasepublic ConcreteFunction getFunction(java.lang.String name)
getFunction in interface Databasepublic java.lang.Object getGlobalVariable(java.lang.String key)
getGlobalVariable in interface Databasepublic IndexFactory getIndexFactory(java.lang.String name)
DatabaseIndexFactorycurrently registered for the given name, or
null.getIndexFactory in interface Databasepublic java.lang.String getName()
DatabaseDatabase.public Sequence getSequence(java.lang.String name)
DatabaseSequence, or null if no such sequence can be
found.
Sequence name matching is case-insensitive.
getSequence in interface Databasepublic Table getTable(java.lang.String name) throws AxionException
DatabaseTable, or null if no such table can be found.
Table name matching is case-insensitive.
getTable in interface DatabaseAxionExceptionpublic Table getTable(TableIdentifier table) throws AxionException
DatabaseTable, or null if no such table can be found.
Table name matching is case-insensitive.
getTable in interface DatabaseAxionExceptionpublic TableFactory getTableFactory(java.lang.String name)
DatabaseTableFactorycurrently registered for the given name, or
null.getTableFactory in interface Databasepublic TransactionManager getTransactionManager()
DatabaseTransactionManagerfor this database.getTransactionManager in interface Databasepublic boolean hasDatabaseLink(java.lang.String name)
throws AxionException
hasDatabaseLink in interface DatabaseAxionExceptionpublic boolean hasIndex(java.lang.String name)
throws AxionException
Databasetrue iff the given Indexexists.hasIndex in interface DatabaseAxionExceptionpublic boolean hasSequence(java.lang.String name)
throws AxionException
hasSequence in interface DatabaseAxionExceptionpublic boolean hasTable(java.lang.String name)
throws AxionException
hasTable in interface DatabaseAxionExceptionpublic boolean hasTable(TableIdentifier id) throws AxionException
hasTable in interface DatabaseAxionExceptionpublic boolean isReadOnly()
DatabaseisReadOnly in interface Databasepublic void migrate(int version)
throws AxionException
migrate in interface DatabaseAxionExceptionpublic void remount(java.io.File newdir)
throws AxionException
Databaseremount in interface DatabaseAxionExceptionpublic void removeDatabaseModificationListener(DatabaseModificationListener l)
public void renameTable(java.lang.String oldName,
java.lang.String newName)
throws AxionException
renameTable in interface DatabaseAxionExceptionpublic Selectable resolveSelectSelectable(SubSelectCommand select, TableIdentifier[] tables)
public void shutdown()
throws AxionException
Databaseshutdown in interface DatabaseAxionExceptionpublic void tableAltered(Table t) throws AxionException
DatabasetableAltered in interface DatabaseAxionExceptionprotected void createMetaDataTables()
throws AxionException
AxionExceptionprotected abstract Table createSystemTable(java.lang.String name)
protected int getSequenceCount()
protected java.util.Iterator<Sequence> getSequences()
protected java.util.Iterator<Table> getTables()
protected void loadProperties(java.util.Properties props)
throws AxionException
AxionExceptionprotected static java.util.Properties getBaseProperties()