Interface NBackupManager
- 
- All Superinterfaces:
- AttachmentProperties,- BaseProperties,- ServiceConnectionProperties,- ServiceManager
 - All Known Implementing Classes:
- FBNBackupManager
 
 public interface NBackupManager extends ServiceManager Implements the incremental backup and restore functionality of NBackup via the Firebird Services API.- Author:
- Thomas Steinmaurer, Mark Rotteveel
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddBackupFile(java.lang.String backupFile)Add additional backup files.voidbackupDatabase()Perform the backup operation.voidclearBackupFiles()Clear the information about backup files.voidfixupDatabase()Perform the nbackup fixup operation.voidrestoreDatabase()Perform the restore operation.voidsetBackupFile(java.lang.String backupFile)Sets the location of the backup file.voidsetBackupGuid(java.lang.String guid)Sets the backup GUID (Firebird 4 and higher only).voidsetBackupLevel(int level)Sets the backup level (0 = full, 1..n = incremental)voidsetCleanHistory(boolean cleanHistory)Enables clean history on backup.voidsetDatabase(java.lang.String path)Set the path to the database.voidsetInPlaceRestore(boolean inPlaceRestore)Enables in-place restore.voidsetKeepDays(int days)Sets the number of days of backup history to keep.voidsetKeepRows(int rows)Sets the number of rows of backup history to keep (this includes the row created by the backup).voidsetNoDBTriggers(boolean noDBTriggers)Sets the option no database triggers when connecting at backup or in-place restore.voidsetPreserveSequence(boolean preserveSequence)Enables preserve sequence (for fixup or restore).- 
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.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
 
- 
 
- 
- 
- 
Method Detail- 
setBackupFilevoid setBackupFile(java.lang.String backupFile) Sets the location of the backup file.Warning: this method behaves identical to addBackupFile(String).- Parameters:
- backupFile- the location of the backup file.
 
 - 
addBackupFilevoid addBackupFile(java.lang.String backupFile) Add additional backup files.Specifying multiple backup files is only valid for restore, for backup only the first file is used. Use clearBackupFiles()to clear earlier backup files.- Parameters:
- backupFile- the location of the backup file.
 
 - 
clearBackupFilesvoid clearBackupFiles() Clear the information about backup files. This method undoes all parameters set in theaddBackupFile(String)method.
 - 
setDatabasevoid setDatabase(java.lang.String path) Set the path to the database. This method is used both for backup and restore operation.- Specified by:
- setDatabasein interface- ServiceManager
- Parameters:
- path- path to the database file.- In case of backup, value specifies the path of the existing database on the server that will be backed up. - In case of restore, value specifies the path of the database where the backup will be restored to. 
 
 - 
backupDatabasevoid backupDatabase() throws java.sql.SQLExceptionPerform the backup operation.- Throws:
- java.sql.SQLException- if a database error occurs during the backup
 
 - 
restoreDatabasevoid restoreDatabase() throws java.sql.SQLExceptionPerform the restore operation.Set setPreserveSequence(boolean)to preserve the original database GUID and replication sequence.- Throws:
- java.sql.SQLException- if a database error occurs during the restore
 
 - 
fixupDatabasevoid fixupDatabase() throws java.sql.SQLExceptionPerform the nbackup fixup operation.A fixup will switch a locked database to 'normal' state without merging the delta, so this is a potentially destructive action. The normal use-case of this option is to unlock a copy of a database file where the source database file was locked with nbackup -LorALTER DATABASE BEGIN BACKUP.Set setPreserveSequence(boolean)to preserve the original database GUID and replication sequence.- Throws:
- java.sql.SQLException- if a database error occurs during the fixup
- Since:
- 5
 
 - 
setBackupLevelvoid setBackupLevel(int level) Sets the backup level (0 = full, 1..n = incremental)- Parameters:
- level- backup level (e.g. 0 = full backup, 1 = level 1 incremental backup based on level 0 backup
 
 - 
setBackupGuidvoid setBackupGuid(java.lang.String guid) Sets the backup GUID (Firebird 4 and higher only).The backup GUID is the GUID of a previous backup of the (source) database. This is used by Firebird to backup the pages modified since that backup. This setting is mutually exclusive with setBackupLevel(int), but this is only checked server-side.- Parameters:
- guid- A GUID string of a previous backup, enclosed in braces.
- Since:
- 4.0.4
 
 - 
setNoDBTriggersvoid setNoDBTriggers(boolean noDBTriggers) Sets the option no database triggers when connecting at backup or in-place restore.- Parameters:
- noDBTriggers-- truedisable db triggers during backup or in-place restore.
 
 - 
setInPlaceRestorevoid setInPlaceRestore(boolean inPlaceRestore) Enables in-place restore.- Parameters:
- inPlaceRestore-- trueto enable in-place restore
- Since:
- 4.0.4
 
 - 
setPreserveSequencevoid setPreserveSequence(boolean preserveSequence) Enables preserve sequence (for fixup or restore).This preserves the existing GUID and replication sequence of the original database (they are reset otherwise). - Parameters:
- preserveSequence-- trueto enable preserve sequence
- Since:
- 5
 
 - 
setCleanHistoryvoid setCleanHistory(boolean cleanHistory) Enables clean history on backup.The backup will fail if setKeepDays(int)orsetKeepRows(int)has not been called.- Parameters:
- cleanHistory-- trueto enable clean history
- Since:
- 4.0.7
 
 - 
setKeepDaysvoid setKeepDays(int days) Sets the number of days of backup history to keep.Server-side, this option is mutually exclusive with setKeepRows(int), this is not enforced by the Java code.This option only has effect when setCleanHistory(true)has been called.- Parameters:
- days- number of days to keep history when cleaning, or- -1to clear current value
- Since:
- 4.0.7
- See Also:
- setCleanHistory(boolean),- setKeepRows(int)
 
 - 
setKeepRowsvoid setKeepRows(int rows) Sets the number of rows of backup history to keep (this includes the row created by the backup).Server-side, this option is mutually exclusive with setKeepDays(int), this is not enforced by the Java code.This option only has effect when setCleanHistory(true)has been called.- Parameters:
- rows- number of rows to keep history when cleaning, or- -1to clear current value
- Since:
- 4.0.7
- See Also:
- setCleanHistory(boolean),- setKeepDays(int)
 
 
- 
 
-