public abstract class FBBackupManagerBase extends FBServiceManager implements BackupManager
Modifier and Type | Class and Description |
---|---|
protected static class |
FBBackupManagerBase.PathSizeStruct
Structure that holds path to the database and corresponding size of the file (in case of backup - that is
size of the file in megabytes, in case of restore - size of the database file in pages).
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
noLimitRestore |
protected java.util.List<FBBackupManagerBase.PathSizeStruct> |
restorePaths |
protected boolean |
verbose |
BUFFER_SIZE
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 and Description |
---|
FBBackupManagerBase()
Create a new instance of
FBBackupManagerBase based on the default GDSType. |
FBBackupManagerBase(GDSType gdsType)
Create a new instance of
FBBackupManagerBase based on a given GDSType. |
FBBackupManagerBase(java.lang.String gdsType)
Create a new instance of
FBBackupManagerBase based on a given GDSType. |
Modifier and Type | Method and Description |
---|---|
void |
addBackupPath(java.lang.String path)
Add backup file to the list.
|
protected abstract void |
addBackupsToBackupRequestBuffer(FbService service,
ServiceRequestBuffer backupSPB)
Adds the backup source for the backup opration, depending on the manager used
|
protected abstract void |
addBackupsToRestoreRequestBuffer(FbService service,
ServiceRequestBuffer restoreSPB)
Adds the backup files to be used during restore
|
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 |
backupMetadata()
Perform the backup operation, metadata only.
|
void |
clearRestorePaths()
Clear the information about restore paths.
|
protected ServiceRequestBuffer |
getBackupSRB(FbService service,
int options)
Creates and returns the "backup" service request buffer for the Service Manager.
|
protected ServiceRequestBuffer |
getRestoreSRB(FbService service,
int options)
Creates and returns the "backup" service request buffer for the Service Manager.
|
void |
restoreDatabase()
Perform the restore operation.
|
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. |
protected abstract boolean |
verboseBackup()
Whether the backup will produce verbose output
|
attachDatabase, attachServiceManager, createRequestBuffer, executeServicesOperation, executeServicesOperation, getCharSet, getDatabase, getDbCryptConfig, getHost, getLogger, getPassword, getPort, getServerVersion, getServiceName, getUser, getWireCrypt, queueService, setCharSet, setDbCryptConfig, setHost, setLogger, setPassword, setPort, setUser, setWireCrypt
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBackupPath, backupDatabase, clearBackupPaths, restoreDatabase, setBackupPath
getCharSet, getDatabase, getDbCryptConfig, getHost, getLogger, getPassword, getPort, getServerVersion, getUser, getWireCrypt, setCharSet, setDbCryptConfig, setHost, setLogger, setPassword, setPort, setUser, setWireCrypt
protected boolean noLimitRestore
protected java.util.List<FBBackupManagerBase.PathSizeStruct> restorePaths
protected boolean verbose
public FBBackupManagerBase()
FBBackupManagerBase
based on the default GDSType.public FBBackupManagerBase(java.lang.String gdsType)
FBBackupManagerBase
based on a given GDSType.gdsType
- type must be PURE_JAVA, EMBEDDED, or NATIVEpublic FBBackupManagerBase(GDSType gdsType)
FBBackupManagerBase
based on a given GDSType.gdsType
- type must be PURE_JAVA, EMBEDDED, or NATIVEpublic void addBackupPath(java.lang.String path)
BackupManager
BackupManager.addBackupPath(String, int)
call.
If application invokes backup operation, an error is generated in that call.
addBackupPath
in interface BackupManager
path
- path to the backup file.public void setDatabase(java.lang.String database)
ServiceManager
setDatabase
in interface BackupManager
setDatabase
in interface ServiceManager
setDatabase
in class FBServiceManager
database
- path for the connection to the service manager.public void addRestorePath(java.lang.String path, int size)
BackupManager
addRestorePath
in interface BackupManager
path
- path to the backup file.size
- max size of the database file in pages.public void clearRestorePaths()
BackupManager
BackupManager.addRestorePath(String, int)
or
BackupManager.setDatabase(String)
methods.clearRestorePaths
in interface BackupManager
public void backupDatabase() throws java.sql.SQLException
BackupManager
backupDatabase
in interface BackupManager
java.sql.SQLException
- if a database error occurs during the backuppublic void backupMetadata() throws java.sql.SQLException
BackupManager
backupMetadata
in interface BackupManager
java.sql.SQLException
- if a database error occurs during the backupprotected ServiceRequestBuffer getBackupSRB(FbService service, int options) throws java.sql.SQLException
service
- Service handleoptions
- The isc_spb_bkp_* parameters options to be usedjava.sql.SQLException
public void restoreDatabase() throws java.sql.SQLException
BackupManager
restoreDatabase
in interface BackupManager
java.sql.SQLException
- if a database error occurs during the restorepublic void setVerbose(boolean verbose)
BackupManager
will result in verbose logging to the configured logger.setVerbose
in interface BackupManager
verbose
- If true
, operations will be logged verbosely, otherwise they will not be logged verboselypublic void setRestorePageBufferCount(int bufferCount)
setRestorePageBufferCount
in interface BackupManager
bufferCount
- The page-buffer size to be used, a positive valuepublic void setRestorePageSize(int pageSize)
pageSize
must be
one of PageSizeConstants
. The default value depends on the Firebird version.
Be aware that not all page sizes are supported by all Firebird versions.
setRestorePageSize
in interface BackupManager
pageSize
- The page size to be used in a restored database, see PageSizeConstants
PageSizeConstants
public void setRestoreReplace(boolean replace)
setRestoreReplace
in interface BackupManager
replace
- 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 BackupManager
readOnly
- If true
, a restored database will be read-only, otherwise it will be read-write.protected ServiceRequestBuffer getRestoreSRB(FbService service, int options)
service
- Service handleoptions
- The options to be used for the backup operationprotected abstract void addBackupsToBackupRequestBuffer(FbService service, ServiceRequestBuffer backupSPB) throws java.sql.SQLException
backupSPB
- The buffer to be used during the backup operationjava.sql.SQLException
protected abstract void addBackupsToRestoreRequestBuffer(FbService service, ServiceRequestBuffer restoreSPB)
protected abstract boolean verboseBackup()
Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.