public class FBBackupManager extends FBServiceManager implements BackupManager
BUFFER_SIZEBACKUP_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 and Description |
|---|
FBBackupManager()
Create a new instance of
FBBackupManager based on
the default GDSType. |
FBBackupManager(org.firebirdsql.gds.impl.GDSType gdsType)
Create a new instance of
FBBackupManager based on
a given GDSType. |
FBBackupManager(java.lang.String gdsType)
Create a new instance of
FBBackupManager based on
a given GDSType. |
| Modifier and Type | Method and Description |
|---|---|
void |
addBackupPath(java.lang.String path)
Add backup file to the list.
|
void |
addBackupPath(java.lang.String path,
int size)
Add the file to the backup of the specified size.
|
void |
addRestorePath(java.lang.String path,
int size)
Add the file to the multi-file database of the specified size for restore
operation.
|
void |
backupDatabase()
Perform the backup operation.
|
void |
backupDatabase(int options)
Perform the backup operation.
|
void |
backupMetadata()
Perform the backup operation, metadata only.
|
void |
clearBackupPaths()
Clear the information about backup paths.
|
void |
clearRestorePaths()
Clear the information about restore paths.
|
void |
restoreDatabase()
Perform the restore operation.
|
void |
restoreDatabase(int options)
Perform the restore operation.
|
void |
setBackupPath(java.lang.String backupPath)
Sets the location of the backup file.
|
void |
setDatabase(java.lang.String database)
Sets the database path for the connection to the service manager.
|
void |
setRestorePageBufferCount(int bufferCount)
Set the default number of pages to be buffered (cached) by default in a
restored database.
|
void |
setRestorePageSize(int pageSize)
Set the page size that will be used for a restored database.
|
void |
setRestoreReadOnly(boolean readOnly)
Set the read-only attribute on a restored database.
|
void |
setRestoreReplace(boolean replace)
Set the restore operation to create a new database, as opposed to
overwriting an existing database.
|
void |
setVerbose(boolean verbose)
Set whether the operations of this
BackupManager will
result in verbose logging to the configured logger. |
attachServiceManager, createRequestBuffer, detachServiceManager, executeServicesOperation, getDatabase, getGds, getHost, getLogger, getPassword, getPort, getServiceName, getUser, queueService, setHost, setLogger, setPassword, setPort, setUserclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDatabase, getHost, getLogger, getPassword, getPort, getUser, setHost, setLogger, setPassword, setPort, setUserpublic FBBackupManager()
FBBackupManager based on
the default GDSType.public FBBackupManager(java.lang.String gdsType)
FBBackupManager based on
a given GDSType.gdsType - type must be PURE_JAVA, EMBEDDED, or NATIVEpublic FBBackupManager(org.firebirdsql.gds.impl.GDSType gdsType)
FBBackupManager based on
a given GDSType.gdsType - type must be PURE_JAVA, EMBEDDED, or NATIVEpublic void setBackupPath(java.lang.String backupPath)
BackupManagerBackupManager.addBackupPath(String, int)
method after calling this one.setBackupPath in interface BackupManagerbackupPath - the location of the backup file.BackupManager.setBackupPath(java.lang.String)public void addBackupPath(java.lang.String path)
BackupManagerBackupManager.addBackupPath(String, int) call.
If application invokes backup operation, an error is generated in that call.
addBackupPath in interface BackupManagerpath - path to the backup file.public void addBackupPath(java.lang.String path,
int size)
BackupManageraddBackupPath in interface BackupManagerpath - path to the backup file.size - max size of the file in bytes.public void clearBackupPaths()
BackupManagerBackupManager.addBackupPath(String, int) or
BackupManager.addBackupPath(String) methods.clearBackupPaths in interface BackupManagerpublic void setDatabase(java.lang.String database)
ServiceManagersetDatabase in interface BackupManagersetDatabase in interface ServiceManagersetDatabase in class FBServiceManagerdatabase - path for the connection to the service manager.public void addRestorePath(java.lang.String path,
int size)
BackupManageraddRestorePath in interface BackupManagerpath - path to the backup file.size - max size of the database file in pages.public void clearRestorePaths()
BackupManagerBackupManager.addRestorePath(String, int) or
BackupManager.setDatabase(String) methods.clearRestorePaths in interface BackupManagerpublic void backupDatabase()
throws java.sql.SQLException
BackupManagerbackupDatabase in interface BackupManagerjava.sql.SQLException - if a database error occurs during the backupBackupManager.backupDatabase()public void backupMetadata()
throws java.sql.SQLException
BackupManagerbackupMetadata in interface BackupManagerjava.sql.SQLException - if a database error occurs during the backupBackupManager.backupMetadata()public void backupDatabase(int options)
throws java.sql.SQLException
BackupManagerbackupDatabase in interface BackupManageroptions - a bitmask combination of the BACKUP_*
static final fields for the backup operationjava.sql.SQLException - if a database error occurs during the backupBackupManager.backupDatabase(int)public void restoreDatabase()
throws java.sql.SQLException
BackupManagerrestoreDatabase in interface BackupManagerjava.sql.SQLException - if a database error occurs during the restoreBackupManager.restoreDatabase()public void restoreDatabase(int options)
throws java.sql.SQLException
BackupManagerrestoreDatabase in interface BackupManageroptions - A bitmask combination of RESTORE_* static
final fieldsjava.sql.SQLException - if a database error occurs during the restoreBackupManager.restoreDatabase(int)public void setVerbose(boolean verbose)
BackupManager will
result in verbose logging to the configured logger.setVerbose in interface BackupManagerverbose - If true, operations will be logged
verbosely, otherwise they will not be logged verboselypublic void setRestorePageBufferCount(int bufferCount)
setRestorePageBufferCount in interface BackupManagerbufferCount - The page-buffer size to be used, a positive valuepublic void setRestorePageSize(int pageSize)
pageSize must be one of: 1024, 2048, 4096, 8192 or 16384. The
default value depends on the Firebird version.setRestorePageSize in interface BackupManagerpageSize - The page size to be used in a restored database,
one of 1024, 2048, 4196, 8192 or 16384public void setRestoreReplace(boolean replace)
setRestoreReplace in interface BackupManagerreplace - If true, the restore operation will attempt
to create a new database, otherwise the restore operation will
overwrite an existing databasepublic void setRestoreReadOnly(boolean readOnly)
setRestoreReadOnly in interface BackupManagerreadOnly - If true, a restored database will be
read-only, otherwise it will be read-write.Copyright © 2001-2019 Jaybird (Firebird JDBC/JCA) team. All rights reserved.