public interface Database
Modifier and Type | Field and Description |
---|---|
static String |
DB_TYPE_HSQLDB
The default HyperSQL Db: http://hsqldb.org/
|
Modifier and Type | Method and Description |
---|---|
void |
addDatabaseListener(DatabaseListener listener) |
void |
close(boolean compact)
Closes the database.
|
void |
close(boolean compact,
boolean cleanup)
Closes the database.
|
void |
deleteSession(String sessionName)
Permanently delete the specified session
|
void |
discardSession(long sessionId)
Discards the history associated with the given session ID, called when a session is not to be
saved (and a new one is about to be created).
|
DatabaseServer |
getDatabaseServer() |
TableAlert |
getTableAlert() |
TableAlertTag |
getTableAlertTag() |
TableContext |
getTableContext() |
TableHistory |
getTableHistory() |
TableParam |
getTableParam() |
TableScan |
getTableScan() |
TableSession |
getTableSession() |
TableSessionUrl |
getTableSessionUrl() |
TableStructure |
getTableStructure() |
TableTag |
getTableTag() |
String |
getType()
The type of the database - e.g.
|
void |
open(String path) |
void |
removeDatabaseListener(DatabaseListener listener) |
void |
setTableAlert(TableAlert tableAlert) |
void |
setTableAlertTag(TableAlertTag tableAlertTag) |
void |
setTableScan(TableScan tableScan) |
void |
setTableSessionUrl(TableSessionUrl tableSessionUrl) |
void |
setTableTag(TableTag tableTag) |
static final String DB_TYPE_HSQLDB
DatabaseServer getDatabaseServer()
TableHistory getTableHistory()
TableSession getTableSession()
void addDatabaseListener(DatabaseListener listener)
void removeDatabaseListener(DatabaseListener listener)
void open(String path) throws ClassNotFoundException, Exception
ClassNotFoundException
Exception
void close(boolean compact)
compact
is true
, the database will be
compacted, compacting the database ensures a minimal space disk usage but it will also take
longer to close. Any necessary cleanups are performed prior to closing the database (the
cleanup removes the temporary HistoryReference
s).
Note: Calling this method has the same effects as calling the method close(boolean, boolean)
with the parameter cleanup
as true
.
compact
- true
if the database should be compacted, false
otherwise.HistoryReference
void deleteSession(String sessionName)
sessionName
- void close(boolean compact, boolean cleanup)
compact
is true
, the database will be
compacted, compacting the database ensures a minimal space disk usage but it will also take
longer to close. If the parameter cleanup
is true
any necessary cleanups are
performed prior to closing the database (the cleanup removes the temporary HistoryReference
s.)compact
- true
if the database should be compacted, false
otherwise.cleanup
- true
if any necessary cleanups should be performed, false
otherwise.HistoryReference
TableAlert getTableAlert()
void setTableAlert(TableAlert tableAlert)
tableAlert
- The tableAlert to set.TableAlertTag getTableAlertTag()
void setTableAlertTag(TableAlertTag tableAlertTag)
TableScan getTableScan()
void setTableScan(TableScan tableScan)
tableScan
- The tableScan to set.TableTag getTableTag()
void setTableTag(TableTag tableTag)
TableSessionUrl getTableSessionUrl()
void setTableSessionUrl(TableSessionUrl tableSessionUrl)
TableParam getTableParam()
TableContext getTableContext()
TableStructure getTableStructure()
void discardSession(long sessionId) throws DatabaseException
Implementations might opt to do nothing, for example, if the database is file based (HSQLDB) and those files are deleted if the session is not saved.
sessionId
- the ID of the sessionDatabaseException
- If an error occurred while discarding the history of the session.