org.axiondb
Interface Database

All Known Subinterfaces:
Transaction
All Known Implementing Classes:
BaseDatabase, DiskDatabase, SnapshotIsolationTransaction

public interface Database

An Axion database.

Version:
$Revision: 1.37 $ $Date: 2004/09/02 01:52:08 $

Field Summary
static String COMMIT_SIZE
           
 
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 table)
          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)
           
 void createSequence(Sequence seq)
          Create a numeric sequence
 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.
 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.
 File getDBDirectory()
          Get the directory into which table information is stored, 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.
 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.
 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 table)
           
 boolean isReadOnly()
          Is this database read-only?
 void remount(File newdir)
          Notify this database that its root directory has been moved to the given location.
 void renameTable(String oldName, String newName)
           
 void resolveFromNode(FromNode from, 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.
 void shutdown()
          Close this database and free any resources associated with it.
 void tableAltered(Table t)
          Update metadata tables since this table has changed.
 

Field Detail

COMMIT_SIZE

public static final String COMMIT_SIZE
See Also:
Constant Field Values
Method Detail

addDatabaseModificationListener

public void addDatabaseModificationListener(DatabaseModificationListener l)
Adds a listener to receive events on this database


addIndex

public void addIndex(Index index,
                     Table table)
              throws AxionException
Add the given Indexto this database, associated with the given table.

Throws:
AxionException

addIndex

public void addIndex(Index index,
                     Table table,
                     boolean doPopulate)
              throws AxionException
Add the given Indexto this database, associating it with the given table and (optionally) populating it.

Parameters:
index - Index to be added and (optionally) populated
table - Table to be indexed
doPopulate - true if index should be populated by the appropriate column in table; false if index should be left as-is.
Throws:
AxionException - if error occurs during addition and/or population of index

addTable

public void addTable(Table table)
              throws AxionException
Add the given Tableto this database.

Throws:
AxionException

canResolveSelectable

public boolean canResolveSelectable(Selectable selectable,
                                    TableIdentifier[] tables)

checkpoint

public void checkpoint()
                throws AxionException
Make sure any modified state or data has been written to disk.

Throws:
AxionException

createDatabaseLink

public void createDatabaseLink(DatabaseLink dblink)
                        throws AxionException
Throws:
AxionException

createSequence

public void createSequence(Sequence seq)
                    throws AxionException
Create a numeric sequence

Throws:
AxionException

dropDatabaseLink

public void dropDatabaseLink(String name)
                      throws AxionException
Throws:
AxionException

dropIndex

public void dropIndex(String name)
               throws AxionException
Drop the given Indexfrom this database.

Throws:
AxionException

dropSequence

public void dropSequence(String name)
                  throws AxionException
Drop the specified Sequencefrom this database.

Sequence name matching is case-insensitive.

Throws:
AxionException

dropTable

public void dropTable(String name)
               throws AxionException
Drop the specified Tablefrom this database.

Table name matching is case-insensitive.

Throws:
AxionException

getDatabaseModificationListeners

public List getDatabaseModificationListeners()
Returns all listeners set to receive events on this database


getDataType

public DataType getDataType(String name)
Get the DataTypecurrently registered for the given name, or null.


getDBDirectory

public File getDBDirectory()
Get the directory into which table information is stored, or null.


getDatabaseLink

public DatabaseLink getDatabaseLink(String name)

getGlobalVariable

public Object getGlobalVariable(String key)

getIndexFactory

public IndexFactory getIndexFactory(String name)
Get the IndexFactorycurrently registered for the given name, or null.


getName

public String getName()
Returns the name of this Database.


getSequence

public Sequence getSequence(String name)
Get the specified Sequence, or null if no such sequence can be found.

Sequence name matching is case-insensitive.


getTable

public Table getTable(String name)
               throws AxionException
Get the specified Table, or null if no such table can be found.

Table name matching is case-insensitive.

Throws:
AxionException

getTable

public Table getTable(TableIdentifier table)
               throws AxionException
Get the specified Table, or null if no such table can be found.

Table name matching is case-insensitive.

Throws:
AxionException

getTableFactory

public TableFactory getTableFactory(String name)
Get the TableFactorycurrently registered for the given name, or null.


getTransactionManager

public TransactionManager getTransactionManager()
Get the TransactionManagerfor this database.


hasDatabaseLink

public boolean hasDatabaseLink(String name)
                        throws AxionException
Throws:
AxionException

hasIndex

public boolean hasIndex(String name)
                 throws AxionException
Returns true iff the given Indexexists.

Throws:
AxionException

hasSequence

public boolean hasSequence(String name)
                    throws AxionException
Throws:
AxionException

hasTable

public boolean hasTable(String name)
                 throws AxionException
Throws:
AxionException

hasTable

public boolean hasTable(TableIdentifier table)
                 throws AxionException
Throws:
AxionException

isReadOnly

public boolean isReadOnly()
Is this database read-only?


remount

public void remount(File newdir)
             throws AxionException
Notify this database that its root directory has been moved to the given location. (E.g., the CD containing the data for a CD-resident database has changed drives.)

Throws:
AxionException

renameTable

public void renameTable(String oldName,
                        String newName)
                 throws AxionException
Throws:
AxionException

resolveFromNode

public void resolveFromNode(FromNode from,
                            List aliasList)
                     throws AxionException
Throws:
AxionException

resolveSelectable

public Selectable resolveSelectable(Selectable selectable,
                                    List aliasList,
                                    TableIdentifier[] tables)
                             throws AxionException
Throws:
AxionException

resolveSelectable

public Selectable resolveSelectable(Selectable selectable,
                                    TableIdentifier[] tables)
                             throws AxionException
"Resolve" the given Selectablerelative to the given list of tables, converting aliased or relative references into absolute ones.

Throws:
AxionException

shutdown

public void shutdown()
              throws AxionException
Close this database and free any resources associated with it.

Throws:
AxionException

tableAltered

public void tableAltered(Table t)
                  throws AxionException
Update metadata tables since this table has changed.

Throws:
AxionException