|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.cjdbc.controller.backup.AbstractPostgreSQLBackuper org.objectweb.cjdbc.controller.backup.PostgreSQLBinaryBackuper
This class defines a Backuper for PostgreSQL databases. This backuper creates dumps in a binary formatu, using the "--format=c" switch on pg_dump.
Supported URLs are jdbc:postgresql://host:port/dbname?param1=foo,param2=bar
Currently the Backuper only takes 1 parameter, the encoding of the database that is created upon restore. More options can be easily added. This class makes calls to the pg_dump, createdb, dropdb and pg_restore commands.
Field Summary | |
(package private) static Trace |
logger
|
Fields inherited from class org.objectweb.cjdbc.controller.backup.AbstractPostgreSQLBackuper |
optionsMap, optionsString |
Constructor Summary | |
PostgreSQLBinaryBackuper()
Creates a new PostgreSQLBinaryBackuper object |
Method Summary | |
java.util.Date |
backup(DatabaseBackend backend,
java.lang.String login,
java.lang.String password,
java.lang.String dumpName,
java.lang.String path,
java.util.ArrayList tables)
Create a backup from the content of a backend. |
java.lang.String |
getDumpFormat()
Returns a String representing the format handled by this Backuper. |
void |
restore(DatabaseBackend backend,
java.lang.String login,
java.lang.String password,
java.lang.String dumpName,
java.lang.String path,
java.util.ArrayList tables)
Restore a dump on a specific backend. |
Methods inherited from class org.objectweb.cjdbc.controller.backup.AbstractPostgreSQLBackuper |
deleteDump, fetchDump, getBackupManager, getDatabaseNameFromURL, getDumpPhysicalPath, getHostFromURL, getOptions, getPortFromURL, setOptions, setupServer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static Trace logger
Constructor Detail |
public PostgreSQLBinaryBackuper()
PostgreSQLBinaryBackuper
object
Method Detail |
public java.lang.String getDumpFormat()
Backuper
Backuper.getDumpFormat()
public java.util.Date backup(DatabaseBackend backend, java.lang.String login, java.lang.String password, java.lang.String dumpName, java.lang.String path, java.util.ArrayList tables) throws BackupException
Backuper
backend
- the target backend to backuplogin
- the login to use to connect to the database for the backup
operationpassword
- the password to use to connect to the database for the
backup operationdumpName
- the name of the dump to createpath
- the path where to store the dumptables
- the list of tables to backup, null means all tables
BackupException
- if the backup operation failsBackuper.backup(org.objectweb.cjdbc.controller.backend.DatabaseBackend,
java.lang.String, java.lang.String, java.lang.String,
java.lang.String, java.util.ArrayList)
public void restore(DatabaseBackend backend, java.lang.String login, java.lang.String password, java.lang.String dumpName, java.lang.String path, java.util.ArrayList tables) throws BackupException
Backuper
backend
- the target backend to restore tologin
- the login to use to connect to the database for the restore
operationpassword
- the password to use to connect to the database for the
restore operationdumpName
- the name of the dump to restorepath
- the path where to retrieve the dumptables
- the list of tables to restore, null means all tables
BackupException
- if the restore operation failedBackuper.restore(org.objectweb.cjdbc.controller.backend.DatabaseBackend,
java.lang.String, java.lang.String, java.lang.String,
java.lang.String, java.util.ArrayList)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |