Top Description Fields Constructors Methods
org.apache.derby.impl.db

public Class BasicDatabase

extends Object
implements ModuleControl, ModuleSupportable, PropertySetCallback, Database, JarReader
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.loader.JarReader, org.apache.derby.iapi.db.Database, org.apache.derby.shared.common.i18n.LocaleFinder, org.apache.derby.database.Database, org.apache.derby.iapi.services.property.PropertySetCallback, org.apache.derby.iapi.services.monitor.ModuleSupportable, org.apache.derby.iapi.services.monitor.ModuleControl
Known Direct Subclasses
org.apache.derby.impl.db.SlaveDatabase
Imports
org.apache.derby.shared.common.error.PublicAPI, .StandardException, org.apache.derby.shared.common.reference.Property, .EngineType, .SQLState, org.apache.derby.iapi.util.DoubleProperties, .IdUtil, .StringUtil, org.apache.derby.iapi.services.property.PropertyUtil, .PropertyFactory, .PropertySetCallback, org.apache.derby.iapi.services.loader.ClassFactory, .JarReader, org.apache.derby.iapi.services.context.ContextManager, .ContextService, org.apache.derby.iapi.services.daemon.Serviceable, org.apache.derby.iapi.services.monitor.ModuleControl, .ModuleSupportable, .Monitor, .ModuleFactory, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.db.Database, .DatabaseContext, org.apache.derby.iapi.sql.execute.ExecutionFactory, org.apache.derby.iapi.store.raw.data.DataFactory, org.apache.derby.iapi.types.DataValueFactory, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, .LanguageConnectionFactory, org.apache.derby.iapi.sql.dictionary.DataDictionary, .FileInfoDescriptor, .SchemaDescriptor, org.apache.derby.iapi.sql.LanguageFactory, org.apache.derby.iapi.store.access.AccessFactory, .FileResource, .TransactionController, org.apache.derby.iapi.jdbc.AuthenticationService, org.apache.derby.iapi.services.uuid.UUIDFactory, org.apache.derby.impl.sql.execute.JarUtil, org.apache.derby.iapi.services.io.FileUtil, org.apache.derby.io.StorageFile, .StorageFactory, org.apache.derby.catalog.UUID, org.apache.derby.iapi.store.replication.slave.SlaveFactory, java.io.File, .IOException, .Serializable, java.sql.SQLException, java.util.Properties, .Dictionary, .Locale, java.text.DateFormat

The Database interface provides control over the physical database (that is, the stored data and the files the data are stored in), connections to the database, operations on the database such as backup and recovery, and all other things that are associated with the database itself.

The Database interface does not provide control over things that are part of the Domain, such as users.

I'm not sure what this will hold in a real system, for now it simply provides connection-creation for us. Perhaps when it boots, it creates the datadictionary object for the database, which all users will then interact with?

Field Summary

Modifier and TypeField and Description
protected boolean
protected AccessFactory
private AuthenticationService
protected ClassFactory
private Locale
private DateFormat
private DataDictionary
dd

DataDictionary for this database.

protected boolean
protected LanguageConnectionFactory
protected LanguageFactory
private UUID
protected PropertyFactory
protected Object
private DateFormat
private DateFormat

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Serviceable
apply(String
Property key for the property being set
key
,
Serializable
proposed new value for the property being set or null if the property is being dropped.
value
,
Dictionary<K, V>
Property set before the change. SettingProperty may read but must never change p.
p
)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.apply.

Apply a property change.

public void
backup(String
the directory name where the database backup should go. This directory will be created if not it does not exist.
backupDir
,
boolean
if true, waits for all the backup blocking operations in progress to finish.
wait
)

Implements org.apache.derby.database.Database.backup.

Backup the database to a backup directory.

public void
backupAndEnableLogArchiveMode(String
The directory name where the database backup should go. This directory will be created if it does not exist.
backupDir
,
boolean
If true deletes online archived log files that exist before this backup; otherwise they will not be deleted. Deletion will occur only after backup is complete.
deleteOnlineArchivedLogFiles
,
boolean
if true, waits for all the backup blocking operations in progress to finish.
wait
)

Implements org.apache.derby.database.Database.backupAndEnableLogArchiveMode.

Backup the database to a backup directory and enable the log archive mode that will keep the archived log files required for roll-forward from this version backup.

private void
backupLucene(String backupDir)

Backup Lucene indexes to the backup directory.

public void
boot(boolean
True if the database should be created
create
,
Properties
Configuration properties
startParams
)

Implements org.apache.derby.iapi.services.monitor.ModuleControl.boot.

Boot this module with the given properties.

protected AuthenticationService
bootAuthenticationService(boolean create, Properties props)

protected void
bootClassFactory(boolean create, Properties startParams)

protected void
bootResourceAdapter(boolean create, Properties allParams)

private static Object
bootServiceModule(final boolean create, final Object serviceModule, final String factoryInterface, final Properties properties)

Must be private so that user code can't call this entry point.

protected void
bootStore(boolean create, Properties startParams)

protected void
bootValidation(boolean create, Properties startParams)

public boolean
canSupport(Properties startParams)

Implements org.apache.derby.iapi.services.monitor.ModuleSupportable.canSupport.

See if this implementation can support any attributes that are listed in properties.

public void
checkpoint()

Implements org.apache.derby.database.Database.checkpoint.

Checkpoints the database, that is, flushes all dirty data to disk.

protected void
public void
disableLogArchiveMode(boolean
If true deletes all online archived log files that exist before this call immediately; otherwise they will not be deleted.
deleteOnlineArchivedLogFiles
)

Implements org.apache.derby.database.Database.disableLogArchiveMode.

Disables the log archival process, i.e No old log files will be kept around for a roll-forward recovery.

public void
failover(String
the replication database that is being failed over.
dbname
)

Implements org.apache.derby.iapi.db.Database.failover.

Start failover for the given database.

private static Object
findServiceModule(final Object serviceModule, final String factoryInterface)

Must be private so that user code can't call this entry point.

public void
freeze()

Implements org.apache.derby.database.Database.freeze.

Freeze the database temporarily so a backup can be taken.

protected Properties
getAllDatabaseProperties()

Get the set of database properties from the set stored on disk outside of service.properties.

public AuthenticationService
getAuthenticationService()

Implements org.apache.derby.iapi.db.Database.getAuthenticationService.

This method returns the authentication service handle for the database.

protected String
getClasspath(Properties startParams)

protected TransactionController
private static ContextService
getContextService()

Must be private so that user code can't call this entry point.

public Locale
public final DataDictionary
getDataDictionary()

Implements org.apache.derby.iapi.db.Database.getDataDictionary.

Return the DataDictionary for this database, set up at boot time.

public DateFormat
getDateFormat()

Implements org.apache.derby.shared.common.i18n.LocaleFinder.getDateFormat.

Get a formatter for formatting dates.

public int
getEngineType()

Implements org.apache.derby.iapi.db.Database.getEngineType.

Return the engine type that this Database implementation supports.

public final UUID
getId()

Implements org.apache.derby.database.Database.getId.

Deprecated

Return the UUID of this database.

public StorageFile
getJarFile(String
The schema where the jar lives
schemaName
,
String
The unqualified name of the jar
sqlName
)

Implements org.apache.derby.iapi.services.loader.JarReader.getJarFile.

Get the StorageFile for an installed jar file.

public Locale
getLocale()

Implements org.apache.derby.database.Database.getLocale.

Get the Locale for this database.

private StorageFile
getLuceneDir()

Get the location of the Lucene indexes

private static ModuleFactory
getMonitor()

Must be private so that user code can't call this entry point.

public Object
getResourceAdapter()

Implements org.apache.derby.iapi.db.Database.getResourceAdapter.

Get a Resource Adapter - only used by XA system.

private StorageFactory
getStorageFactory()

Get the database StorageFactory.

public DateFormat
getTimeFormat()

Implements org.apache.derby.shared.common.i18n.LocaleFinder.getTimeFormat.

Get a formatter for formatting times.

public DateFormat
getTimestampFormat()

Implements org.apache.derby.shared.common.i18n.LocaleFinder.getTimestampFormat.

Get a formatter for formatting timestamps.

public void
init(boolean
true if only per-database properties are to be looked at
dbOnly
,
Dictionary<K, V>
the complete set of per-database properties.
p
)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.init.

Initialize the properties for this callback.

public boolean
isActive()

Implements org.apache.derby.iapi.db.Database.isActive.

Is the database active (open).

public boolean
isInSlaveMode()

Implements org.apache.derby.iapi.db.Database.isInSlaveMode.

Used to indicated whether the database is in the replication slave mode.

public boolean
isReadOnly()

Implements org.apache.derby.database.Database.isReadOnly.

Tells whether the Database is configured as read-only, or the Database was started in read-only mode.

private boolean
luceneLoaded()

Return true if the Lucene plugin is loaded.

protected UUID
makeDatabaseID(boolean create, Properties startParams)

public Serializable
map(String
Property key for the property being set
key
,
Serializable
proposed new value for the property being set or null if the property is being dropped.
value
,
Dictionary<K, V>
Property set before the change. SettingProperty may read but must never change p.
p
)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.map.

Map a proposed new value for a property to an official value.

private static StandardException
protected void
public void
pushDbContext(ContextManager
The context manager
cm
)

Implements org.apache.derby.iapi.db.Database.pushDbContext.

Push a DbContext onto the provided context stack.

public void
setLocale(Locale
The locale to set
locale
)

Implements org.apache.derby.iapi.db.Database.setLocale.

Set the Locale that is returned by this LocaleFinder

public LanguageConnectionContext
setupConnection(ContextManager
The context manager
cm
,
String
The UserID of the user getting the connection
user
,
String
The drda id of the connection (from network server)
drdaID
,
String
The database name
dbname
)

Implements org.apache.derby.iapi.db.Database.setupConnection.

Sets up a connection to the Database, owned by the given user.

public void
startReplicationMaster(String
The master database that is being replicated.
dbmaster
,
String
The hostname for the slave
host
,
int
The port the slave is listening on
port
,
String
The type of replication contract. Currently only asynchronous replication is supported, but 1-safe/2-safe/very-safe modes may be added later.
replicationMode
)

Implements org.apache.derby.iapi.db.Database.startReplicationMaster.

Start the replication master role for this database

public void
public void
stopReplicationMaster()

Implements org.apache.derby.iapi.db.Database.stopReplicationMaster.

Stop the replication master role for this database.

public void
stopReplicationSlave()

Implements org.apache.derby.iapi.db.Database.stopReplicationSlave.

Only a SlaveDatabase can be in replication slave mode.

public void
unfreeze()

Implements org.apache.derby.database.Database.unfreeze.

Unfreeze the database after a backup has been taken.

public boolean
validate(String
Property key for the property being set
key
,
Serializable
proposed new value for the property being set or null if the property is being dropped.
value
,
Dictionary<K, V>
Property set before the change. SettingProperty may read but must never change p.
p
)

Implements org.apache.derby.iapi.services.property.PropertySetCallback.validate.

Validate a property change.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait