java.lang.Object
org.firebirdsql.management.FBServiceManager
org.firebirdsql.management.FBBackupManagerBase
org.firebirdsql.management.FBBackupManager
- All Implemented Interfaces:
AttachmentProperties,BaseProperties,ServiceConnectionProperties,BackupManager,ServiceManager
Implements the backup and restore functionality of Firebird Services API.
- Author:
- Roman Rokytskyy, Mark Rotteveel
-
Nested Class Summary
Nested classes/interfaces inherited from class org.firebirdsql.management.FBBackupManagerBase
FBBackupManagerBase.PathSizeStruct -
Field Summary
Fields inherited from class org.firebirdsql.management.FBBackupManagerBase
noLimitRestore, restorePaths, verboseFields inherited from class org.firebirdsql.management.FBServiceManager
BUFFER_SIZEFields inherited from interface org.firebirdsql.management.BackupManager
BACKUP_CONVERT, BACKUP_EXPAND, BACKUP_IGNORE_CHECKSUMS, BACKUP_IGNORE_LIMBO, BACKUP_METADATA_ONLY, BACKUP_NO_GARBAGE_COLLECT, BACKUP_NON_TRANSPORTABLE, BACKUP_OLD_DESCRIPTIONS, RESTORE_DEACTIVATE_INDEX, RESTORE_NO_SHADOW, RESTORE_NO_VALIDITY, RESTORE_ONE_AT_A_TIME, RESTORE_USE_ALL_SPACE -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance ofFBBackupManagerbased on the default GDSType.FBBackupManager(String gdsType) Create a new instance ofFBBackupManagerbased on a given GDSType.FBBackupManager(GDSType gdsType) Create a new instance ofFBBackupManagerbased on a given GDSType. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBackupPath(String path, int size) Add the file to the backup of the specified size.protected voidaddBackupsToBackupRequestBuffer(FbService service, ServiceRequestBuffer backupSPB) Adds the currentDatabase as a source for the backup operationprotected voidaddBackupsToRestoreRequestBuffer(FbService service, ServiceRequestBuffer restoreSPB) Adds the list of backups to be used for the restore operationvoidbackupDatabase(int options) Perform the backup operation.voidClear the information about backup paths.voidrestoreDatabase(int options) Perform the restore operation.voidsetBackupPath(String backupPath) Sets the location of the backup file.protected booleanWhether backing up will produce verbose outputMethods inherited from class org.firebirdsql.management.FBBackupManagerBase
addBackupPath, addRestorePath, backupDatabase, backupMetadata, clearRestorePaths, getBackupSRB, getRestoreSRB, restoreDatabase, setDatabase, setRestorePageBufferCount, setRestorePageSize, setRestoreReadOnly, setRestoreReplace, setVerboseMethods inherited from class org.firebirdsql.management.FBServiceManager
attachDatabase, attachServiceManager, connectionPropertyValues, createRequestBuffer, executeServicesOperation, getAuthPlugins, getBooleanProperty, getCharSet, getDatabase, getDbCryptConfig, getExpectedDb, getHost, getIntProperty, getLogger, getPassword, getPort, getPortNumber, getProperty, getServerName, getServerVersion, getServiceName, getUser, getWireCrypt, getWireCryptAsEnum, isWireCompression, queueService, setAuthPlugins, setBooleanProperty, setCharSet, setDbCryptConfig, setExpectedDb, setHost, setIntProperty, setLogger, setPassword, setPort, setPortNumber, setProperty, setServerName, setServiceName, setType, setUser, setWireCompression, setWireCryptAsEnumMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.firebirdsql.jaybird.props.AttachmentProperties
getAuthPlugins, getCharSet, getConnectTimeout, getDbCryptConfig, getEnableProtocol, getEncoding, getParallelWorkers, getPassword, getPortNumber, getProcessId, getProcessName, getRoleName, getServerName, getSocketBufferSize, getSocketFactory, getSoTimeout, getType, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setConnectTimeout, setDbCryptConfig, setEnableProtocol, setEncoding, setParallelWorkers, setPassword, setPortNumber, setProcessId, setProcessName, setRoleName, setServerName, setSocketBufferSize, setSocketFactory, setSoTimeout, setType, setUser, setWireCompression, setWireCryptMethods inherited from interface org.firebirdsql.management.BackupManager
addBackupPath, addRestorePath, backupDatabase, backupMetadata, clearRestorePaths, restoreDatabase, setDatabase, setRestorePageBufferCount, setRestorePageSize, setRestoreReadOnly, setRestoreReplace, setVerboseMethods inherited from interface org.firebirdsql.jaybird.props.BaseProperties
connectionPropertyValues, getBooleanProperty, getBooleanProperty, getIntProperty, getIntProperty, getProperty, getProperty, setBooleanProperty, setIntProperty, setPropertyMethods inherited from interface org.firebirdsql.jaybird.props.ServiceConnectionProperties
getExpectedDb, getServiceName, setExpectedDb, setServiceNameMethods inherited from interface org.firebirdsql.management.ServiceManager
getDatabase, getHost, getLogger, getPort, getServerVersion, getWireCryptAsEnum, setHost, setLogger, setPort, setWireCryptAsEnum
-
Constructor Details
-
FBBackupManager
public FBBackupManager()Create a new instance ofFBBackupManagerbased on the default GDSType. -
FBBackupManager
Create a new instance ofFBBackupManagerbased on a given GDSType.- Parameters:
gdsType- type must be PURE_JAVA, EMBEDDED, or NATIVE
-
FBBackupManager
Create a new instance ofFBBackupManagerbased on a given GDSType.- Parameters:
gdsType- type must be PURE_JAVA, EMBEDDED, or NATIVE
-
-
Method Details
-
verboseBackup
protected boolean verboseBackup()Whether backing up will produce verbose output- Specified by:
verboseBackupin classFBBackupManagerBase
-
setBackupPath
Description copied from interface:BackupManagerSets 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 callBackupManager.addBackupPath(String, int)method after calling this one.- Specified by:
setBackupPathin interfaceBackupManager- Parameters:
backupPath- the location of the backup file.- See Also:
-
addBackupPath
Description copied from interface:BackupManagerAdd 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.- Specified by:
addBackupPathin interfaceBackupManager- Parameters:
path- path to the backup file.size- max size of the file in bytes.
-
clearBackupPaths
public void clearBackupPaths()Description copied from interface:BackupManagerClear the information about backup paths. This method undoes all parameters set in theBackupManager.addBackupPath(String, int)orBackupManager.addBackupPath(String)methods.- Specified by:
clearBackupPathsin interfaceBackupManager
-
backupDatabase
Description copied from interface:BackupManagerPerform the backup operation.- Specified by:
backupDatabasein interfaceBackupManager- Parameters:
options- a bitmask combination of theBACKUP_*constants for the backup operation- Throws:
SQLException- if a database error occurs during the backup
-
restoreDatabase
Description copied from interface:BackupManagerPerform the restore operation.- Specified by:
restoreDatabasein interfaceBackupManager- Parameters:
options- A bitmask combination ofRESTORE_*constants- Throws:
SQLException- if a database error occurs during the restore
-
addBackupsToBackupRequestBuffer
protected void addBackupsToBackupRequestBuffer(FbService service, ServiceRequestBuffer backupSPB) throws SQLException Adds the currentDatabase as a source for the backup operation- Specified by:
addBackupsToBackupRequestBufferin classFBBackupManagerBase- Parameters:
backupSPB- The buffer to be used during the backup operation- Throws:
SQLException
-
addBackupsToRestoreRequestBuffer
Adds the list of backups to be used for the restore operation- Specified by:
addBackupsToRestoreRequestBufferin classFBBackupManagerBase- Parameters:
restoreSPB- The buffer to be used during the restore operation
-