|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.axiondb.engine.BaseDatabase
Abstract base Databaseimplementation.
| Field Summary | |
static String |
SYSTABLE_DB_LINKS
|
static String |
SYSTABLE_INDEX_INFO
|
| Fields inherited from interface org.axiondb.Database |
COMMIT_SIZE |
| Constructor Summary | |
BaseDatabase(String name)
|
|
| Method Summary | |
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. |
boolean |
canResolveSelectable(Selectable selectable,
TableIdentifier[] tables)
|
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(String name)
|
void |
dropDatabaseLink(String name)
|
void |
dropIndex(String name)
Drop the given Indexfrom this database. |
void |
dropSequence(String name)
Drop the specified Sequencefrom this database. |
void |
dropTable(String name)
Drop the specified Tablefrom this database. |
protected static Properties |
getBaseProperties()
Callers should treat the returned Properties as immutable. |
DatabaseLink |
getDatabaseLink(String name)
|
List |
getDatabaseModificationListeners()
Returns all listeners set to receive events on this database |
DataType |
getDataType(String name)
Get the DataTypecurrently registered for the given name, or null. |
Object |
getGlobalVariable(String key)
|
IndexFactory |
getIndexFactory(String name)
Get the IndexFactorycurrently registered for the given name, or
null. |
String |
getName()
Returns the name of this Database. |
Sequence |
getSequence(String name)
Get the specified Sequence, or null if no such sequence can be
found. |
protected int |
getSequenceCount()
|
protected Iterator |
getSequences()
|
Table |
getTable(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(String name)
Get the TableFactorycurrently registered for the given name, or
null. |
protected Iterator |
getTables()
|
TransactionManager |
getTransactionManager()
Get the TransactionManagerfor this database. |
boolean |
hasDatabaseLink(String name)
|
boolean |
hasIndex(String name)
Returns true iff the given Indexexists. |
boolean |
hasSequence(String name)
|
boolean |
hasTable(String name)
|
boolean |
hasTable(TableIdentifier id)
|
boolean |
isReadOnly()
Is this database read-only? |
protected void |
loadProperties(Properties props)
|
void |
remount(File newdir)
Notify this database that its root directory has been moved to the given location. |
void |
removeDatabaseModificationListener(DatabaseModificationListener l)
|
void |
renameTable(String oldName,
String newName)
|
void |
resolveFromNode(FromNode node,
List aliasList)
|
Selectable |
resolveSelectable(Selectable selectable,
List aliasList,
TableIdentifier[] tables)
|
Selectable |
resolveSelectable(Selectable selectable,
TableIdentifier[] tables)
"Resolve" the given Selectablerelative to the given list of
tables, converting aliased or relative references into
absolute ones. |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.axiondb.Database |
getDBDirectory |
| Field Detail |
public static final String SYSTABLE_DB_LINKS
public static final String SYSTABLE_INDEX_INFO
| Constructor Detail |
public BaseDatabase(String name)
| Method Detail |
public String getName()
DatabaseDatabase.
getName in interface Databasepublic boolean isReadOnly()
Database
isReadOnly in interface Databasepublic IndexFactory getIndexFactory(String name)
DatabaseIndexFactorycurrently registered for the given name, or
null.
getIndexFactory in interface Databasepublic TableFactory getTableFactory(String name)
DatabaseTableFactorycurrently registered for the given name, or
null.
getTableFactory in interface Databasepublic DataType getDataType(String name)
DatabaseDataTypecurrently registered for the given name, or null.
getDataType in interface Database
public Table getTable(String name)
throws AxionException
DatabaseTable, or null if no such table can be found.
Table name matching is case-insensitive.
getTable in interface DatabaseAxionException
public 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 DatabaseAxionException
public boolean hasTable(String name)
throws AxionException
hasTable in interface DatabaseAxionException
public boolean hasTable(TableIdentifier id)
throws AxionException
hasTable in interface DatabaseAxionException
public void dropTable(String name)
throws AxionException
DatabaseTablefrom this database.
Table name matching is case-insensitive.
dropTable in interface DatabaseAxionException
public void addIndex(Index index,
Table table)
throws AxionException
DatabaseIndexto this database, associated with the given table.
addIndex in interface DatabaseAxionException
public 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
index
public void dropIndex(String name)
throws AxionException
DatabaseIndexfrom this database.
dropIndex in interface DatabaseAxionException
public boolean hasIndex(String name)
throws AxionException
Databasetrue iff the given Indexexists.
hasIndex in interface DatabaseAxionException
public void tableAltered(Table t)
throws AxionException
Database
tableAltered in interface DatabaseAxionException
public void addTable(Table t)
throws AxionException
DatabaseTableto this database.
addTable in interface DatabaseAxionException
public void shutdown()
throws AxionException
Database
shutdown in interface DatabaseAxionException
public void remount(File newdir)
throws AxionException
Database
remount in interface DatabaseAxionException
public void renameTable(String oldName,
String newName)
throws AxionException
renameTable in interface DatabaseAxionException
public void resolveFromNode(FromNode node,
List aliasList)
throws AxionException
resolveFromNode in interface DatabaseAxionException
public Selectable resolveSelectable(Selectable selectable,
TableIdentifier[] tables)
throws AxionException
DatabaseSelectablerelative to the given list of
tables, converting aliased or relative references into
absolute ones.
resolveSelectable in interface DatabaseAxionException
public boolean canResolveSelectable(Selectable selectable,
TableIdentifier[] tables)
canResolveSelectable in interface Database
public Selectable resolveSelectSelectable(SubSelectCommand select,
TableIdentifier[] tables)
public Selectable resolveSelectable(Selectable selectable,
List aliasList,
TableIdentifier[] tables)
throws AxionException
resolveSelectable in interface DatabaseAxionException
public void checkpoint()
throws AxionException
Database
checkpoint in interface DatabaseAxionException
public void createSequence(Sequence seq)
throws AxionException
Database
createSequence in interface DatabaseAxionException
public void createDatabaseLink(DatabaseLink dblink)
throws AxionException
createDatabaseLink in interface DatabaseAxionException
public void dropDatabaseLink(String name)
throws AxionException
dropDatabaseLink in interface DatabaseAxionException
public void dropSequence(String name)
throws AxionException
DatabaseSequencefrom this database.
Sequence name matching is case-insensitive.
dropSequence in interface DatabaseAxionExceptionpublic Object getGlobalVariable(String key)
getGlobalVariable in interface Databasepublic Sequence getSequence(String name)
DatabaseSequence, or null if no such sequence can be
found.
Sequence name matching is case-insensitive.
getSequence in interface Databasepublic DatabaseLink getDatabaseLink(String name)
getDatabaseLink in interface Database
public boolean hasSequence(String name)
throws AxionException
hasSequence in interface DatabaseAxionException
public boolean hasDatabaseLink(String name)
throws AxionException
hasDatabaseLink in interface DatabaseAxionExceptionpublic TransactionManager getTransactionManager()
DatabaseTransactionManagerfor this database.
getTransactionManager in interface Databasepublic void addDatabaseModificationListener(DatabaseModificationListener l)
Database
addDatabaseModificationListener in interface Databasepublic void removeDatabaseModificationListener(DatabaseModificationListener l)
public List getDatabaseModificationListeners()
Database
getDatabaseModificationListeners in interface Databaseprotected Iterator getSequences()
protected int getSequenceCount()
protected Iterator getTables()
protected void loadProperties(Properties props)
throws AxionException
AxionExceptionprotected static Properties getBaseProperties()
protected abstract Table createSystemTable(String name)
protected void createMetaDataTables()
throws AxionException
AxionException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||