Class DBSpecifics
- java.lang.Object
-
- dk.netarkivet.common.utils.SettingsFactory<DBSpecifics>
-
- dk.netarkivet.archive.arcrepositoryadmin.DBSpecifics
-
- Direct Known Subclasses:
DerbySpecifics
,MySQLSpecifics
,PostgreSQLSpecifics
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.
-
-
Constructor Summary
Constructors Constructor Description DBSpecifics()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
backupDatabase(Connection c, File backupDir)
Backup the database.abstract 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 in embedded mode.-
Methods inherited from class dk.netarkivet.common.utils.SettingsFactory
getInstance
-
-
-
-
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 in embedded mode. Otherwise, this is ignored.Will log a warning on errors, but otherwise ignore them.
-
backupDatabase
public abstract void backupDatabase(Connection c, File backupDir) throws 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 upc
- The connection to the database.- Throws:
SQLException
- On SQL trouble backing up databasePermissionDenied
- if the directory cannot be created.
-
getDriverClassName
public abstract String getDriverClassName()
Get the name of the JDBC driver class that handles interfacing to this server.- Returns:
- The name of a JDBC driver class
-
-