Package org.firebirdsql.management
Class FBNBackupManager
- java.lang.Object
-
- org.firebirdsql.management.FBServiceManager
-
- org.firebirdsql.management.FBNBackupManager
-
- All Implemented Interfaces:
NBackupManager
,ServiceManager
public class FBNBackupManager extends FBServiceManager implements NBackupManager
Implements the incremental backup and restore functionality of NBackup via the Firebird Services API.- Author:
- Thomas Steinmaurer, Mark Rotteveel
-
-
Field Summary
-
Fields inherited from class org.firebirdsql.management.FBServiceManager
BUFFER_SIZE
-
-
Constructor Summary
Constructors Constructor Description FBNBackupManager()
Create a new instance ofFBNBackupManager
based on the default GDSType.FBNBackupManager(java.lang.String gdsType)
Create a new instance ofFBNBackupManager
based on a given GDSType.FBNBackupManager(GDSType gdsType)
Create a new instance ofFBNBackupManager
based on a given GDSType.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBackupFile(java.lang.String backupFile)
Add the file to the backup of the specified size.void
backupDatabase()
Perform the backup operation.void
clearBackupFiles()
Clear the information about backup files.void
restoreDatabase()
Perform the restore operation.void
setBackupFile(java.lang.String backupFile)
Sets the location of the backup file.void
setBackupLevel(int backupLevel)
Sets the backup level (0 = full, 1..n = incremental)void
setDatabase(java.lang.String database)
Sets the database path for the connection to the service manager.void
setNoDBTriggers(boolean noDBTriggers)
Sets the backup option no database triggers when connecting at backup.-
Methods inherited from class org.firebirdsql.management.FBServiceManager
attachDatabase, attachServiceManager, createRequestBuffer, executeServicesOperation, executeServicesOperation, getAuthPlugins, getCharSet, getDatabase, getDbCryptConfig, getHost, getLogger, getPassword, getPort, getServerVersion, getServiceName, getUser, getWireCrypt, isWireCompression, queueService, setAuthPlugins, setCharSet, setDbCryptConfig, setHost, setLogger, setPassword, setPort, setUser, setWireCompression, setWireCrypt
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.firebirdsql.management.ServiceManager
getAuthPlugins, getCharSet, getDatabase, getDbCryptConfig, getHost, getLogger, getPassword, getPort, getServerVersion, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setDbCryptConfig, setHost, setLogger, setPassword, setPort, setUser, setWireCompression, setWireCrypt
-
-
-
-
Constructor Detail
-
FBNBackupManager
public FBNBackupManager()
Create a new instance ofFBNBackupManager
based on the default GDSType.
-
FBNBackupManager
public FBNBackupManager(java.lang.String gdsType)
Create a new instance ofFBNBackupManager
based on a given GDSType.- Parameters:
gdsType
- type must be PURE_JAVA, EMBEDDED, or NATIVE
-
FBNBackupManager
public FBNBackupManager(GDSType gdsType)
Create a new instance ofFBNBackupManager
based on a given GDSType.- Parameters:
gdsType
- type must be PURE_JAVA, EMBEDDED, or NATIVE
-
-
Method Detail
-
setBackupFile
public void setBackupFile(java.lang.String backupFile)
Description copied from interface:NBackupManager
Sets the location of the backup file.- Specified by:
setBackupFile
in interfaceNBackupManager
- Parameters:
backupFile
- the location of the backup file.
-
addBackupFile
public void addBackupFile(java.lang.String backupFile)
Description copied from interface:NBackupManager
Add 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:
addBackupFile
in interfaceNBackupManager
- Parameters:
backupFile
- the location of the backup file.
-
clearBackupFiles
public void clearBackupFiles()
Description copied from interface:NBackupManager
Clear the information about backup files. This method undoes all parameters set in theNBackupManager.addBackupFile(String)
method.- Specified by:
clearBackupFiles
in interfaceNBackupManager
-
setDatabase
public void setDatabase(java.lang.String database)
Description copied from interface:ServiceManager
Sets the database path for the connection to the service manager.- Specified by:
setDatabase
in interfaceNBackupManager
- Specified by:
setDatabase
in interfaceServiceManager
- Overrides:
setDatabase
in classFBServiceManager
- Parameters:
database
- path for the connection to the service manager.
-
backupDatabase
public void backupDatabase() throws java.sql.SQLException
Description copied from interface:NBackupManager
Perform the backup operation.- Specified by:
backupDatabase
in interfaceNBackupManager
- Throws:
java.sql.SQLException
- if a database error occurs during the backup
-
restoreDatabase
public void restoreDatabase() throws java.sql.SQLException
Description copied from interface:NBackupManager
Perform the restore operation.- Specified by:
restoreDatabase
in interfaceNBackupManager
- Throws:
java.sql.SQLException
- if a database error occurs during the restore- See Also:
NBackupManager.restoreDatabase()
-
setBackupLevel
public void setBackupLevel(int backupLevel)
Description copied from interface:NBackupManager
Sets the backup level (0 = full, 1..n = incremental)- Specified by:
setBackupLevel
in interfaceNBackupManager
- Parameters:
backupLevel
- backup level (e.g. 0 = full backup, 1 = level 1 incremental backup based on level 0 backup
-
setNoDBTriggers
public void setNoDBTriggers(boolean noDBTriggers)
Description copied from interface:NBackupManager
Sets the backup option no database triggers when connecting at backup.- Specified by:
setNoDBTriggers
in interfaceNBackupManager
-
-