Package org.firebirdsql.management
Interface BackupManager
- 
- All Superinterfaces:
- ServiceManager
 - All Known Implementing Classes:
- FBBackupManager,- FBBackupManagerBase,- FBStreamingBackupManager
 
 public interface BackupManager extends ServiceManager Implements the backup and restore functionality of Firebird Services API.- Author:
- Roman Rokytskyy, Steven Jardine
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intBACKUP_CONVERTBackup external files as tables.static intBACKUP_EXPANDNo data compression.static intBACKUP_IGNORE_CHECKSUMSIgnore checksums.static intBACKUP_IGNORE_LIMBOIgnore in-limbo transactions.static intBACKUP_METADATA_ONLYBackup metadata only.static intBACKUP_NO_GARBAGE_COLLECTDo not collect garbage during backup.static intBACKUP_NON_TRANSPORTABLEUse non-transportable backup format.static intBACKUP_OLD_DESCRIPTIONSSave old style metadata descriptions.static intRESTORE_DEACTIVATE_INDEXDeactivate indices during restore.static intRESTORE_NO_SHADOWDo not restore shadow database.static intRESTORE_NO_VALIDITYDo not restore validity constraints.static intRESTORE_ONE_AT_A_TIMECommit after completing restore of each table.static intRESTORE_USE_ALL_SPACEDo not reserve 20% on each page for the future versions, useful for read-only databases.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddBackupPath(java.lang.String path)Add backup file to the list.voidaddBackupPath(java.lang.String path, int size)Add the file to the backup of the specified size.voidaddRestorePath(java.lang.String path, int size)Add the file to the multi-file database of the specified size for restore operation.voidbackupDatabase()Perform the backup operation.voidbackupDatabase(int options)Perform the backup operation.voidbackupMetadata()Perform the backup operation, metadata only.voidclearBackupPaths()Clear the information about backup paths.voidclearRestorePaths()Clear the information about restore paths.voidrestoreDatabase()Perform the restore operation.voidrestoreDatabase(int options)Perform the restore operation.voidsetBackupPath(java.lang.String backupPath)Sets the location of the backup file.voidsetDatabase(java.lang.String path)Set the path to the database.voidsetRestorePageBufferCount(int bufferCount)Set the default number of pages to be buffered (cached) by default in a restored database.voidsetRestorePageSize(int pageSize)Set the page size that will be used for a restored database.voidsetRestoreReadOnly(boolean readOnly)Set the read-only attribute on a restored database.voidsetRestoreReplace(boolean replace)Set the restore operation to create a new database, as opposed to overwriting an existing database.voidsetVerbose(boolean verbose)Set whether the operations of thisBackupManagerwill result in verbose logging to the configured logger.- 
Methods inherited from interface org.firebirdsql.management.ServiceManagergetAuthPlugins, getCharSet, getDatabase, getDbCryptConfig, getHost, getLogger, getPassword, getPort, getServerVersion, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setDbCryptConfig, setHost, setLogger, setPassword, setPort, setUser, setWireCompression, setWireCrypt
 
- 
 
- 
- 
- 
Field Detail- 
BACKUP_IGNORE_CHECKSUMSstatic final int BACKUP_IGNORE_CHECKSUMS Ignore checksums.- See Also:
- Constant Field Values
 
 - 
BACKUP_IGNORE_LIMBOstatic final int BACKUP_IGNORE_LIMBO Ignore in-limbo transactions.- See Also:
- Constant Field Values
 
 - 
BACKUP_METADATA_ONLYstatic final int BACKUP_METADATA_ONLY Backup metadata only.- See Also:
- Constant Field Values
 
 - 
BACKUP_NO_GARBAGE_COLLECTstatic final int BACKUP_NO_GARBAGE_COLLECT Do not collect garbage during backup.- See Also:
- Constant Field Values
 
 - 
BACKUP_OLD_DESCRIPTIONSstatic final int BACKUP_OLD_DESCRIPTIONS Save old style metadata descriptions.- See Also:
- Constant Field Values
 
 - 
BACKUP_NON_TRANSPORTABLEstatic final int BACKUP_NON_TRANSPORTABLE Use non-transportable backup format.- See Also:
- Constant Field Values
 
 - 
BACKUP_CONVERTstatic final int BACKUP_CONVERT Backup external files as tables.- See Also:
- Constant Field Values
 
 - 
BACKUP_EXPANDstatic final int BACKUP_EXPAND No data compression.- See Also:
- Constant Field Values
 
 - 
RESTORE_DEACTIVATE_INDEXstatic final int RESTORE_DEACTIVATE_INDEX Deactivate indices during restore.- See Also:
- Constant Field Values
 
 - 
RESTORE_NO_SHADOWstatic final int RESTORE_NO_SHADOW Do not restore shadow database.- See Also:
- Constant Field Values
 
 - 
RESTORE_NO_VALIDITYstatic final int RESTORE_NO_VALIDITY Do not restore validity constraints.- See Also:
- Constant Field Values
 
 - 
RESTORE_ONE_AT_A_TIMEstatic final int RESTORE_ONE_AT_A_TIME Commit after completing restore of each table.- See Also:
- Constant Field Values
 
 - 
RESTORE_USE_ALL_SPACEstatic final int RESTORE_USE_ALL_SPACE Do not reserve 20% on each page for the future versions, useful for read-only databases.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
setBackupPathvoid setBackupPath(java.lang.String backupPath) Sets the location of the backup file. This method is used to set the path to the backup consisting of a single file. It is not possible to add multiple files or specify the max. size of the file using this method. It is also not possible to calladdBackupPath(String, int)method after calling this one.- Parameters:
- backupPath- the location of the backup file.
- See Also:
- for multi-file backups.
 
 - 
addBackupPathvoid addBackupPath(java.lang.String path, int size)Add the file to the backup of the specified size. Firebird allows splitting the backup into multiple files, limiting the size of the backup file. This can be useful for example for creating a backup on CD or DVD.- Parameters:
- path- path to the backup file.
- size- max size of the file in bytes.
 
 - 
addBackupPathvoid addBackupPath(java.lang.String path) Add backup file to the list. This method is used only during restoring the database to specify multi-file backups. The call is equivalent to passing the size -1 toaddBackupPath(String, int)call.If application invokes backup operation, an error is generated in that call. - Parameters:
- path- path to the backup file.
 
 - 
clearBackupPathsvoid clearBackupPaths() Clear the information about backup paths. This method undoes all parameters set in theaddBackupPath(String, int)oraddBackupPath(String)methods.
 - 
setDatabasevoid setDatabase(java.lang.String path) Set the path to the database. This method is used both for backup and restore operation.- Specified by:
- setDatabasein interface- ServiceManager
- Parameters:
- path- path to the database file.- In case of backup, value specifies the path of the existing database on the server that will be backed up. - In case of restore, value specifies the path of the single-file database where the backup will be restored to. 
 
 - 
addRestorePathvoid addRestorePath(java.lang.String path, int size)Add the file to the multi-file database of the specified size for restore operation.- Parameters:
- path- path to the backup file.
- size- max size of the database file in pages.
 
 - 
clearRestorePathsvoid clearRestorePaths() Clear the information about restore paths. This method undoes all parameters set in theaddRestorePath(String, int)orsetDatabase(String)methods.
 - 
backupDatabasevoid backupDatabase() throws java.sql.SQLExceptionPerform the backup operation.- Throws:
- java.sql.SQLException- if a database error occurs during the backup
 
 - 
backupMetadatavoid backupMetadata() throws java.sql.SQLExceptionPerform the backup operation, metadata only.- Throws:
- java.sql.SQLException- if a database error occurs during the backup
 
 - 
backupDatabasevoid backupDatabase(int options) throws java.sql.SQLExceptionPerform the backup operation.- Parameters:
- options- a bitmask combination of the- BACKUP_*constants for the backup operation
- Throws:
- java.sql.SQLException- if a database error occurs during the backup
 
 - 
setVerbosevoid setVerbose(boolean verbose) Set whether the operations of thisBackupManagerwill result in verbose logging to the configured logger.- Parameters:
- verbose- If- true, operations will be logged verbosely, otherwise they will not be logged verbosely
 
 - 
setRestorePageBufferCountvoid setRestorePageBufferCount(int bufferCount) Set the default number of pages to be buffered (cached) by default in a restored database.- Parameters:
- bufferCount- The page-buffer size to be used, a positive value
 
 - 
setRestorePageSizevoid setRestorePageSize(int pageSize) Set the page size that will be used for a restored database. The value forpageSizemust be one of: 1024, 2048, 4096, 8192 or 16384. The default value depends on the Firebird version.- Parameters:
- pageSize- The page size to be used in a restored database, one of 1024, 2048, 4196, 8192 or 16384
- See Also:
- PageSizeConstants
 
 - 
setRestoreReplacevoid setRestoreReplace(boolean replace) Set the restore operation to create a new database, as opposed to overwriting an existing database.- Parameters:
- replace- If- true, the restore operation will attempt to create a new database if it does not exit or overwrite an existing one when it exists,- falsewhen restore should fail if database already exist (if it doesn't, a database will be successfully created).
 
 - 
setRestoreReadOnlyvoid setRestoreReadOnly(boolean readOnly) Set the read-only attribute on a restored database.- Parameters:
- readOnly- If- true, a restored database will be read-only, otherwise it will be read-write.
 
 - 
restoreDatabasevoid restoreDatabase() throws java.sql.SQLExceptionPerform the restore operation.- Throws:
- java.sql.SQLException- if a database error occurs during the restore
 
 - 
restoreDatabasevoid restoreDatabase(int options) throws java.sql.SQLExceptionPerform the restore operation.- Parameters:
- options- A bitmask combination of- RESTORE_*constants
- Throws:
- java.sql.SQLException- if a database error occurs during the restore
 
 
- 
 
-