Package org.firebirdsql.management
Class FBBackupManagerBase
- java.lang.Object
- 
- org.firebirdsql.management.FBServiceManager
- 
- org.firebirdsql.management.FBBackupManagerBase
 
 
- 
- All Implemented Interfaces:
- AttachmentProperties,- BaseProperties,- ServiceConnectionProperties,- BackupManager,- ServiceManager
 - Direct Known Subclasses:
- FBBackupManager,- FBStreamingBackupManager
 
 public abstract class FBBackupManagerBase extends FBServiceManager implements BackupManager Implements the common functionality between regular and streaming backup/restore- Author:
- Roman Rokytskyy, Mark Rotteveel
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classFBBackupManagerBase.PathSizeStructStructure 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).
 - 
Field SummaryFields Modifier and Type Field Description protected booleannoLimitRestoreprotected java.util.List<FBBackupManagerBase.PathSizeStruct>restorePathsprotected booleanverbose- 
Fields inherited from class org.firebirdsql.management.FBServiceManagerBUFFER_SIZE
 - 
Fields inherited from interface org.firebirdsql.management.BackupManagerBACKUP_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 SummaryConstructors Constructor Description FBBackupManagerBase()Create a new instance ofFBBackupManagerBasebased on the default GDSType.FBBackupManagerBase(java.lang.String gdsType)Create a new instance ofFBBackupManagerBasebased on a given GDSType.FBBackupManagerBase(GDSType gdsType)Create a new instance ofFBBackupManagerBasebased on a given GDSType.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddBackupPath(java.lang.String path)Add backup file to the list.protected abstract voidaddBackupsToBackupRequestBuffer(FbService service, ServiceRequestBuffer backupSPB)Adds the backup source for the backup opration, depending on the manager usedprotected abstract voidaddBackupsToRestoreRequestBuffer(FbService service, ServiceRequestBuffer restoreSPB)Adds the backup files to be used during restorevoidaddRestorePath(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.voidbackupMetadata()Perform the backup operation, metadata only.voidclearRestorePaths()Clear the information about restore paths.protected ServiceRequestBuffergetBackupSRB(FbService service, int options)Creates and returns the "backup" service request buffer for the Service Manager.protected ServiceRequestBuffergetRestoreSRB(FbService service, int options)Creates and returns the "backup" service request buffer for the Service Manager.voidrestoreDatabase()Perform the restore operation.voidsetDatabase(java.lang.String database)Sets the database path for the connection to the service manager.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.protected abstract booleanverboseBackup()Whether the backup will produce verbose output- 
Methods inherited from class org.firebirdsql.management.FBServiceManagerattachDatabase, attachServiceManager, connectionPropertyValues, createRequestBuffer, executeServicesOperation, 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, setWireCryptAsEnum
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.firebirdsql.jaybird.props.AttachmentPropertiesgetAuthPlugins, getCharSet, getConnectTimeout, getDbCryptConfig, getEncoding, getParallelWorkers, getPassword, getPortNumber, getProcessId, getProcessName, getRoleName, getServerName, getSocketBufferSize, getSoTimeout, getType, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setConnectTimeout, setDbCryptConfig, setEncoding, setParallelWorkers, setPassword, setPortNumber, setProcessId, setProcessName, setRoleName, setServerName, setSocketBufferSize, setSoTimeout, setType, setUser, setWireCompression, setWireCrypt
 - 
Methods inherited from interface org.firebirdsql.management.BackupManageraddBackupPath, backupDatabase, clearBackupPaths, restoreDatabase, setBackupPath
 - 
Methods inherited from interface org.firebirdsql.jaybird.props.BasePropertiesconnectionPropertyValues, getBooleanProperty, getBooleanProperty, getIntProperty, getIntProperty, getProperty, getProperty, setBooleanProperty, setIntProperty, setProperty
 - 
Methods inherited from interface org.firebirdsql.jaybird.props.ServiceConnectionPropertiesgetExpectedDb, getServiceName, setExpectedDb, setServiceName
 - 
Methods inherited from interface org.firebirdsql.management.ServiceManagergetDatabase, getHost, getLogger, getPort, getServerVersion, getWireCryptAsEnum, setHost, setLogger, setPort, setWireCryptAsEnum
 
- 
 
- 
- 
- 
Field Detail- 
noLimitRestoreprotected boolean noLimitRestore 
 - 
restorePathsprotected final java.util.List<FBBackupManagerBase.PathSizeStruct> restorePaths 
 - 
verboseprotected boolean verbose 
 
- 
 - 
Constructor Detail- 
FBBackupManagerBasepublic FBBackupManagerBase() Create a new instance ofFBBackupManagerBasebased on the default GDSType.
 - 
FBBackupManagerBasepublic FBBackupManagerBase(java.lang.String gdsType) Create a new instance ofFBBackupManagerBasebased on a given GDSType.- Parameters:
- gdsType- type must be PURE_JAVA, EMBEDDED, or NATIVE
 
 - 
FBBackupManagerBasepublic FBBackupManagerBase(GDSType gdsType) Create a new instance ofFBBackupManagerBasebased on a given GDSType.- Parameters:
- gdsType- type must be PURE_JAVA, EMBEDDED, or NATIVE
 
 
- 
 - 
Method Detail- 
addBackupPathpublic void addBackupPath(java.lang.String path) Description copied from interface:BackupManagerAdd 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 toBackupManager.addBackupPath(String, int)call.If application invokes backup operation, an error is generated in that call. - Specified by:
- addBackupPathin interface- BackupManager
- Parameters:
- path- path to the backup file.
 
 - 
setDatabasepublic void setDatabase(java.lang.String database) Description copied from interface:ServiceManagerSets the database path for the connection to the service manager.Will also set the expectedDbproperty. If a different value must be used, it must be set after calling this method.- Specified by:
- setDatabasein interface- BackupManager
- Specified by:
- setDatabasein interface- ServiceManager
- Overrides:
- setDatabasein class- FBServiceManager
- Parameters:
- database- path for the connection to the service manager.
 
 - 
addRestorePathpublic void addRestorePath(java.lang.String path, int size)Description copied from interface:BackupManagerAdd the file to the multi-file database of the specified size for restore operation.- Specified by:
- addRestorePathin interface- BackupManager
- Parameters:
- path- path to the backup file.
- size- max size of the database file in pages.
 
 - 
clearRestorePathspublic void clearRestorePaths() Description copied from interface:BackupManagerClear the information about restore paths. This method undoes all parameters set in theBackupManager.addRestorePath(String, int)orBackupManager.setDatabase(String)methods.- Specified by:
- clearRestorePathsin interface- BackupManager
 
 - 
backupDatabasepublic void backupDatabase() throws java.sql.SQLExceptionDescription copied from interface:BackupManagerPerform the backup operation.- Specified by:
- backupDatabasein interface- BackupManager
- Throws:
- java.sql.SQLException- if a database error occurs during the backup
 
 - 
backupMetadatapublic void backupMetadata() throws java.sql.SQLExceptionDescription copied from interface:BackupManagerPerform the backup operation, metadata only.- Specified by:
- backupMetadatain interface- BackupManager
- Throws:
- java.sql.SQLException- if a database error occurs during the backup
 
 - 
getBackupSRBprotected ServiceRequestBuffer getBackupSRB(FbService service, int options) throws java.sql.SQLException Creates and returns the "backup" service request buffer for the Service Manager.- Parameters:
- service- Service handle
- options- The isc_spb_bkp_* parameters options to be used
- Returns:
- the "backup" service request buffer for the Service Manager.
- Throws:
- java.sql.SQLException
 
 - 
restoreDatabasepublic void restoreDatabase() throws java.sql.SQLExceptionDescription copied from interface:BackupManagerPerform the restore operation.- Specified by:
- restoreDatabasein interface- BackupManager
- Throws:
- java.sql.SQLException- if a database error occurs during the restore
 
 - 
setVerbosepublic void setVerbose(boolean verbose) Set whether the operations of thisBackupManagerwill result in verbose logging to the configured logger.- Specified by:
- setVerbosein interface- BackupManager
- Parameters:
- verbose- If- true, operations will be logged verbosely, otherwise they will not be logged verbosely
 
 - 
setRestorePageBufferCountpublic void setRestorePageBufferCount(int bufferCount) Set the default number of pages to be buffered (cached) by default in a restored database.- Specified by:
- setRestorePageBufferCountin interface- BackupManager
- Parameters:
- bufferCount- The page-buffer size to be used, a positive value
 
 - 
setRestorePageSizepublic void setRestorePageSize(int pageSize) Set the page size that will be used for a restored database. The value forpageSizemust be one ofPageSizeConstants. The default value depends on the Firebird version.Be aware that not all page sizes are supported by all Firebird versions. - Specified by:
- setRestorePageSizein interface- BackupManager
- Parameters:
- pageSize- The page size to be used in a restored database, see- PageSizeConstants
- See Also:
- PageSizeConstants
 
 - 
setRestoreReplacepublic void setRestoreReplace(boolean replace) Set the restore operation to create a new database, as opposed to overwriting an existing database. This is true by default.- Specified by:
- setRestoreReplacein interface- BackupManager
- Parameters:
- replace- If- true, the restore operation will attempt to create a new database, otherwise the restore operation will overwrite an existing database
 
 - 
setRestoreReadOnlypublic void setRestoreReadOnly(boolean readOnly) Set the read-only attribute on a restored database.- Specified by:
- setRestoreReadOnlyin interface- BackupManager
- Parameters:
- readOnly- If- true, a restored database will be read-only, otherwise it will be read-write.
 
 - 
getRestoreSRBprotected ServiceRequestBuffer getRestoreSRB(FbService service, int options) Creates and returns the "backup" service request buffer for the Service Manager.- Parameters:
- service- Service handle
- options- The options to be used for the backup operation
- Returns:
- the "backup" service request buffer for the Service Manager.
 
 - 
addBackupsToBackupRequestBufferprotected abstract void addBackupsToBackupRequestBuffer(FbService service, ServiceRequestBuffer backupSPB) throws java.sql.SQLException Adds the backup source for the backup opration, depending on the manager used- Parameters:
- backupSPB- The buffer to be used during the backup operation
- Throws:
- java.sql.SQLException
 
 - 
addBackupsToRestoreRequestBufferprotected abstract void addBackupsToRestoreRequestBuffer(FbService service, ServiceRequestBuffer restoreSPB) Adds the backup files to be used during restore
 - 
verboseBackupprotected abstract boolean verboseBackup() Whether the backup will produce verbose output
 
- 
 
-