|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.cjdbc.controller.backup.OctopusBackuper
This class defines a Backuper based on Octopus v2.8.
The only option supported by this Backuper is 'zip=[true,false]' which defines if the dump directory must be compressed in a zip file.
Nested Class Summary | |
(package private) class |
OctopusBackuper.DumpTransferServerThread
|
Field Summary | |
private static java.lang.String |
COPY_MODE
|
private static java.lang.String[] |
CSV
|
private static int |
DB_NAME
|
private static int |
DRIVER
|
private static int |
FULL_NAME
|
private static java.lang.String[] |
HSQL
|
private static java.lang.String[] |
JTURBO
|
(package private) static Trace |
logger
|
private static java.lang.String[] |
MSSQL
|
private static java.lang.String[] |
MYSQL
|
private static java.lang.String |
OCTOPUS_INCLUDE_HREF
|
private static java.lang.String[] |
ORACLE
|
private static java.lang.String[] |
POSTGRESQL
|
private static int |
PREFIX_URL
|
private static java.lang.String |
TYPE_CSV
|
(package private) static java.util.Hashtable |
TYPES
|
private boolean |
zipBackupFiles
|
Constructor Summary | |
OctopusBackuper()
Creates a new OctopusBackuper 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. |
private void |
callOctopusLoader(java.lang.String sourceType,
java.lang.String sourceUrl,
java.lang.String sourceDriver,
java.lang.String sourceUser,
java.lang.String sourcePassword,
java.lang.String targetType,
java.lang.String targetDriver,
java.lang.String targetUrl,
java.lang.String targetUser,
java.lang.String targetPassword,
boolean backup,
boolean generateAllVendors,
java.lang.String octopusDir)
|
private void |
cleanUp(java.lang.String octopusDir)
|
private java.lang.String[] |
convertTablesToArray(java.util.ArrayList tablesList)
|
private java.lang.String |
createCsvDir(java.lang.String octopusDir)
|
private java.lang.String |
createOctopusDir(java.lang.String path,
java.lang.String dumpName)
|
void |
deleteDump(java.lang.String path,
java.lang.String dumpName)
Delete the specified dump. |
void |
fetchDump(DumpTransferInfo dumpTransferInfo,
java.lang.String path,
java.lang.String dumpName)
Client side: Fetch a remote dump from specified dump server. |
BackupManager |
getBackupManager()
Return the BackupManager this Backuper belongs to. |
private java.lang.String |
getDatabaseType(java.lang.String url)
|
java.lang.String |
getDumpFormat()
Returns a String representing the format handled by this Backuper. |
private java.lang.String |
getLoaderJobFile(java.lang.String octopusDir)
|
private java.lang.String |
getOctopusDriver(java.lang.String type)
Get octopus driver. |
private java.lang.String |
getOctopusType(java.lang.String type)
Get octopus type. |
java.lang.String |
getOptions()
Retrieve the backuper options that were used to initialize the backuper. |
private java.lang.String |
getUrlPrefix(java.lang.String type)
Get Octopus url prefix |
private void |
launchOctopus(java.lang.String octopusDir,
java.lang.String dumpName,
java.util.ArrayList tables)
This start octopus with previously generated LoaderJob file |
private void |
redirectOutputStream()
|
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. |
private void |
setOctopusLoaderJob(java.lang.String octopusDir,
java.lang.String sourceType)
|
void |
setOptions(java.lang.String options)
Options that can be set at backuper initialization. |
DumpTransferInfo |
setupServer()
Server side: setup a server and returns a DumpTransferInfo suitable for authenticated communication by a client using fetchDump(). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static Trace logger
private boolean zipBackupFiles
private static final int DB_NAME
private static final int DRIVER
private static final int FULL_NAME
private static final int PREFIX_URL
private static final java.lang.String[] HSQL
private static final java.lang.String[] CSV
private static final java.lang.String[] MYSQL
private static final java.lang.String[] POSTGRESQL
private static final java.lang.String[] ORACLE
private static final java.lang.String[] JTURBO
private static final java.lang.String[] MSSQL
static final java.util.Hashtable TYPES
private static final java.lang.String TYPE_CSV
private static final java.lang.String COPY_MODE
private static final java.lang.String OCTOPUS_INCLUDE_HREF
Constructor Detail |
public OctopusBackuper()
OctopusBackuper
object
Method Detail |
public java.lang.String getDumpFormat()
Backuper
getDumpFormat
in interface 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
backup
in interface 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
restore
in interface 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)
public void deleteDump(java.lang.String path, java.lang.String dumpName) throws BackupException
Backuper
deleteDump
in interface Backuper
path
- the path where to retrieve the dumpdumpName
- the dump to delete
BackupException
- if we failed to delete the dumpBackuper.deleteDump(java.lang.String,
java.lang.String)
private void callOctopusLoader(java.lang.String sourceType, java.lang.String sourceUrl, java.lang.String sourceDriver, java.lang.String sourceUser, java.lang.String sourcePassword, java.lang.String targetType, java.lang.String targetDriver, java.lang.String targetUrl, java.lang.String targetUser, java.lang.String targetPassword, boolean backup, boolean generateAllVendors, java.lang.String octopusDir) throws OctopusException
OctopusException
private void launchOctopus(java.lang.String octopusDir, java.lang.String dumpName, java.util.ArrayList tables) throws OctopusException
octopusDir
- the working directorytables
- the list of tables to backup, null means all tables
OctopusException
- if octopus failsprivate void cleanUp(java.lang.String octopusDir)
private java.lang.String[] convertTablesToArray(java.util.ArrayList tablesList)
private java.lang.String createOctopusDir(java.lang.String path, java.lang.String dumpName) throws BackupException
BackupException
private java.lang.String createCsvDir(java.lang.String octopusDir) throws BackupException
BackupException
private java.lang.String getDatabaseType(java.lang.String url) throws BackupException
BackupException
private java.lang.String getLoaderJobFile(java.lang.String octopusDir)
private void redirectOutputStream()
private void setOctopusLoaderJob(java.lang.String octopusDir, java.lang.String sourceType) throws OctopusException
OctopusException
private java.lang.String getOctopusType(java.lang.String type)
type
- from url
private java.lang.String getOctopusDriver(java.lang.String type)
type
- from url
private java.lang.String getUrlPrefix(java.lang.String type)
type
- from url
public java.lang.String getOptions()
Backuper
getOptions
in interface Backuper
Backuper.getOptions()
public void setOptions(java.lang.String options)
Backuper
setOptions
in interface Backuper
options
- Backuper specific optionsBackuper.setOptions(java.lang.String)
public BackupManager getBackupManager()
Backuper
getBackupManager
in interface Backuper
Backuper.getBackupManager()
public void fetchDump(DumpTransferInfo dumpTransferInfo, java.lang.String path, java.lang.String dumpName) throws BackupException, java.io.IOException
Backuper
fetchDump
in interface Backuper
dumpTransferInfo
- the address and session key of the dump server to
contact for fetching.path
- the path part of the remote dump spec (interpreted by server)dumpName
- the name part of the remote dump spec (interpreted by
server)
BackupException
- in any error case: authentication error, transfer
error, else.
java.io.IOException
- if an error occurs during the transferBackuper.fetchDump(org.objectweb.cjdbc.controller.backup.DumpTransferInfo,
java.lang.String, java.lang.String)
public DumpTransferInfo setupServer() throws java.io.IOException
Backuper
setupServer
in interface Backuper
java.io.IOException
- if an error occurs during the transferBackuper.setupServer()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |