dk.netarkivet.archive.arcrepositoryadmin
Class DBSpecifics

java.lang.Object
  extended by dk.netarkivet.common.utils.SettingsFactory<DBSpecifics>
      extended by dk.netarkivet.archive.arcrepositoryadmin.DBSpecifics
Direct Known Subclasses:
DerbySpecifics

public abstract class DBSpecifics
extends SettingsFactory<DBSpecifics>

Abstract collection of DB methods that are not standard SQL. This class is a singleton class whose actual implementation is provided by a subclass as determined by the DB_SPECIFICS_CLASS setting.


Field Summary
protected  org.apache.commons.logging.Log log
          The log of this class.
 
Constructor Summary
DBSpecifics()
           
 
Method Summary
abstract  void backupDatabase(java.sql.Connection c, java.io.File backupDir)
          Backup the database.
abstract  java.lang.String getDriverClassName()
          Get the name of the JDBC driver class that handles interfacing to this server.
static DBSpecifics getInstance()
          Get the singleton instance of the DBSpecifics implementation class.
abstract  void shutdownDatabase()
          Shutdown the database system, if running embeddedly.
 
Methods inherited from class dk.netarkivet.common.utils.SettingsFactory
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log
The log of this class.

Constructor Detail

DBSpecifics

public DBSpecifics()
Method Detail

getInstance

public static DBSpecifics getInstance()
Get the singleton instance of the DBSpecifics implementation class.

Returns:
An instance of DBSpecifics with implementations for a given DB.

shutdownDatabase

public abstract void shutdownDatabase()
Shutdown the database system, if running embeddedly. Otherwise, this is ignored. Will log a warning on errors, but otherwise ignore them.


backupDatabase

public abstract void backupDatabase(java.sql.Connection c,
                                    java.io.File backupDir)
                             throws java.sql.SQLException,
                                    PermissionDenied
Backup the database. For server-based databases, where the administrator is expected to perform the backups, this method should do nothing. This method gets called within one hour of the hour-of-day indicated by the DB_BACKUP_INIT_HOUR settings.

Parameters:
backupDir - Directory to which the database should be backed up
c - The connection to the database.
Throws:
java.sql.SQLException - On SQL trouble backing up database
PermissionDenied - if the directory cannot be created.

getDriverClassName

public abstract java.lang.String getDriverClassName()
Get the name of the JDBC driver class that handles interfacing to this server.

Returns:
The name of a JDBC driver class