Package org.firebirdsql.management
Class FBStreamingBackupManager
- java.lang.Object
- 
- org.firebirdsql.management.FBServiceManager
- 
- org.firebirdsql.management.FBBackupManagerBase
- 
- org.firebirdsql.management.FBStreamingBackupManager
 
 
 
- 
- All Implemented Interfaces:
- AttachmentProperties,- BaseProperties,- ServiceConnectionProperties,- BackupManager,- ServiceManager
 
 public class FBStreamingBackupManager extends FBBackupManagerBase implements BackupManager Implements the streaming version of 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.FBBackupManagerBaseFBBackupManagerBase.PathSizeStruct
 
- 
 - 
Field Summary- 
Fields inherited from class org.firebirdsql.management.FBBackupManagerBasenoLimitRestore, restorePaths, verbose
 - 
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 FBStreamingBackupManager()Create a new instance ofFBStreamingBackupManagerbased on the default GDSType.FBStreamingBackupManager(java.lang.String gdsType)Create a new instance ofFBStreamingBackupManagerbased on a given GDSType.FBStreamingBackupManager(GDSType gdsType)Create a new instance ofFBStreamingBackupManagerbased on a given GDSType.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBackupPath(java.lang.String path, int size)Add the file to the backup of the specified size.protected voidaddBackupsToBackupRequestBuffer(FbService service, ServiceRequestBuffer backupSPB)Adds stdout as a source for the backup operationprotected voidaddBackupsToRestoreRequestBuffer(FbService service, ServiceRequestBuffer restoreSPB)Adds stdin as a source for the restore operationvoidbackupDatabase(int options)Perform the backup operation.voidclearBackupPaths()Clear the information about backup paths.voidrestoreDatabase(int options)Perform the restore operation.voidsetBackupBufferSize(int bufferSize)Set the local buffer size to be used when doing a backup.voidsetBackupOutputStream(java.io.OutputStream backupStream)voidsetBackupPath(java.lang.String backupPath)Sets the location of the backup file.voidsetRestoreInputStream(java.io.InputStream restoreStream)voidsetRestorePageSize(int pageSize)Set the page size that will be used for a restored database.protected booleanverboseBackup()Streaming backups are currently not capable of verbose output- 
Methods inherited from class org.firebirdsql.management.FBBackupManagerBaseaddBackupPath, addRestorePath, backupDatabase, backupMetadata, clearRestorePaths, getBackupSRB, getRestoreSRB, restoreDatabase, setDatabase, setRestorePageBufferCount, setRestoreReadOnly, setRestoreReplace, setVerbose
 - 
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, addRestorePath, backupDatabase, backupMetadata, clearRestorePaths, restoreDatabase, setDatabase, setRestorePageBufferCount, setRestoreReadOnly, setRestoreReplace, setVerbose
 - 
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
 
- 
 
- 
- 
- 
Constructor Detail- 
FBStreamingBackupManagerpublic FBStreamingBackupManager() Create a new instance ofFBStreamingBackupManagerbased on the default GDSType.
 - 
FBStreamingBackupManagerpublic FBStreamingBackupManager(java.lang.String gdsType) Create a new instance ofFBStreamingBackupManagerbased on a given GDSType.- Parameters:
- gdsType- type must be PURE_JAVA, EMBEDDED, or NATIVE
 
 - 
FBStreamingBackupManagerpublic FBStreamingBackupManager(GDSType gdsType) Create a new instance ofFBStreamingBackupManagerbased on a given GDSType.- Parameters:
- gdsType- type must be PURE_JAVA, EMBEDDED, or NATIVE
 
 
- 
 - 
Method Detail- 
setBackupBufferSizepublic void setBackupBufferSize(int bufferSize) Set the local buffer size to be used when doing a backup. Default is 30720- Parameters:
- bufferSize- The buffer size to be used, a positive value
 
 - 
setBackupPathpublic void setBackupPath(java.lang.String backupPath) 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 interface- BackupManager
- Parameters:
- backupPath- the location of the backup file.
- See Also:
- for multi-file backups.
 
 - 
addBackupPathpublic void addBackupPath(java.lang.String path, int size)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 interface- BackupManager
- Parameters:
- path- path to the backup file.
- size- max size of the file in bytes.
 
 - 
setBackupOutputStreampublic void setBackupOutputStream(java.io.OutputStream backupStream) 
 - 
setRestoreInputStreampublic void setRestoreInputStream(java.io.InputStream restoreStream) 
 - 
clearBackupPathspublic 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 interface- BackupManager
 
 - 
backupDatabasepublic void backupDatabase(int options) throws java.sql.SQLExceptionDescription copied from interface:BackupManagerPerform the backup operation.- Specified by:
- backupDatabasein interface- BackupManager
- 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
 
 - 
restoreDatabasepublic void restoreDatabase(int options) throws java.sql.SQLExceptionDescription copied from interface:BackupManagerPerform the restore operation.- Specified by:
- restoreDatabasein interface- BackupManager
- Parameters:
- options- A bitmask combination of- RESTORE_*constants
- Throws:
- java.sql.SQLException- if a database error occurs during the restore
 
 - 
verboseBackupprotected boolean verboseBackup() Streaming backups are currently not capable of verbose output- Specified by:
- verboseBackupin class- FBBackupManagerBase
 
 - 
setRestorePageSizepublic void setRestorePageSize(int pageSize) Set the page size that will be used for a restored database. The value forpageSizemust be one at least 4096, see alsPageSizeConstants. The default value depends on the Firebird version. Pages smaller than 4096 were dropped in 2006 and are by definition unavailable with the streaming functionality of the Services API- Specified by:
- setRestorePageSizein interface- BackupManager
- Overrides:
- setRestorePageSizein class- FBBackupManagerBase
- Parameters:
- pageSize- The page size to be used in a restored database, see- PageSizeConstantswith a minimum of 4096
- See Also:
- PageSizeConstants
 
 - 
addBackupsToBackupRequestBufferprotected void addBackupsToBackupRequestBuffer(FbService service, ServiceRequestBuffer backupSPB) Adds stdout as a source for the backup operation- Specified by:
- addBackupsToBackupRequestBufferin class- FBBackupManagerBase
- Parameters:
- backupSPB- The buffer to be used during the backup operation
 
 - 
addBackupsToRestoreRequestBufferprotected void addBackupsToRestoreRequestBuffer(FbService service, ServiceRequestBuffer restoreSPB) Adds stdin as a source for the restore operation- Specified by:
- addBackupsToRestoreRequestBufferin class- FBBackupManagerBase
- Parameters:
- restoreSPB- The buffer to be used during the restore operation
 
 
- 
 
-