org.objectweb.cjdbc.controller.backup
Interface Backuper

All Known Implementing Classes:
AbstractPostgreSQLBackuper, DerbyEmbeddedBackuper, OctopusBackuper

public interface Backuper

This interface defines a Backuper that is in charge of doing backup/restore operations and manage dumps according to its own internal format. The user will manipulate logical names and the Backuper is responsible to maintain the logical name/physical name mapping.

Version:
1.0
Author:
Emmanuel Cecchet

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.
 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.
 java.lang.String getDumpFormat()
          Returns a String representing the format handled by this Backuper.
 java.lang.String getOptions()
          Retrieve the backuper options that were used to initialize the 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.
 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().
 

Method Detail

getDumpFormat

public java.lang.String getDumpFormat()
Returns a String representing the format handled by this Backuper. This field should be human readable and as detailed as possible so that no confusion can be made by the administrator.

Returns:
the Backuper specific format

getOptions

public java.lang.String getOptions()
Retrieve the backuper options that were used to initialize the backuper.

Returns:
the backuper options
See Also:
setOptions(String)

setOptions

public void setOptions(java.lang.String options)
Options that can be set at backuper initialization. These options are provided in the definition of the Backuper element (see dtd).

Parameters:
options - Backuper specific options

backup

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
Create a backup from the content of a backend.

Parameters:
backend - the target backend to backup
login - the login to use to connect to the database for the backup operation
password - the password to use to connect to the database for the backup operation
dumpName - the name of the dump to create
path - the path where to store the dump
tables - the list of tables to backup, null means all tables
Returns:
the timestamp for the dump if the backup was sucessful, null otherwise
Throws:
BackupException - if the backup operation fails

restore

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
Restore a dump on a specific backend.

Parameters:
backend - the target backend to restore to
login - the login to use to connect to the database for the restore operation
password - the password to use to connect to the database for the restore operation
dumpName - the name of the dump to restore
path - the path where to retrieve the dump
tables - the list of tables to restore, null means all tables
Throws:
BackupException - if the restore operation failed

deleteDump

public void deleteDump(java.lang.String path,
                       java.lang.String dumpName)
                throws BackupException
Delete the specified dump.

Parameters:
path - the path where to retrieve the dump
dumpName - the dump to delete
Throws:
BackupException - if we failed to delete the dump

fetchDump

public void fetchDump(DumpTransferInfo dumpTransferInfo,
                      java.lang.String path,
                      java.lang.String dumpName)
               throws BackupException,
                      java.io.IOException
Client side: Fetch a remote dump from specified dump server.

Parameters:
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)
Throws:
BackupException - in any error case: authentication error, transfer error, else.
java.io.IOException - if an error occurs during the transfer

setupServer

public DumpTransferInfo setupServer()
                             throws java.io.IOException
Server side: setup a server and returns a DumpTransferInfo suitable for authenticated communication by a client using fetchDump().

Returns:
a DumpTransferInfo to be used by a client for authenticated communication upon fetchDump invocation.
Throws:
java.io.IOException - if an error occurs during the transfer

getBackupManager

public BackupManager getBackupManager()
Return the BackupManager this Backuper belongs to.

Returns:
the BackupManager this Backuper belongs to.


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.