org.firebirdsql.management

Class FBBackupManager

Implemented Interfaces:
BackupManager, ServiceManager

public class FBBackupManager
extends FBServiceManager
implements BackupManager

Implements the backup and restore functionality of Firebird Services API.
Author:
Roman Rokytskyy

Field Summary

Fields inherited from class org.firebirdsql.management.FBServiceManager

BUFFER_SIZE

Fields inherited from interface org.firebirdsql.management.BackupManager

BACKUP_CONVERT, BACKUP_EXPAND, BACKUP_IGNORE_CHECKSUMS, BACKUP_IGNORE_LIMBO, BACKUP_METADATA_ONLY, BACKUP_NON_TRANSPORTABLE, BACKUP_NO_GARBAGE_COLLECT, BACKUP_OLD_DESCRIPTIONS, RESTORE_DEACTIVATE_INDEX, RESTORE_NO_SHADOW, RESTORE_NO_VALIDITY, RESTORE_ONE_AT_A_TIME, RESTORE_USE_ALL_SPACE

Constructor Summary

FBBackupManager()
Create a new instance of FBBackupManager based on the default GDSType.
FBBackupManager(String gdsType)
Create a new instance of FBBackupManager based on a given GDSType.
FBBackupManager(org.firebirdsql.gds.impl.GDSType gdsType)
Create a new instance of FBBackupManager based on a given GDSType.

Method Summary

void
addBackupPath(String path)
void
addBackupPath(String path, int size)
void
addRestorePath(String path, int size)
void
backupDatabase()
void
backupDatabase(int options)
void
backupMetadata()
void
clearBackupPaths()
void
clearRestorePaths()
void
restoreDatabase()
void
restoreDatabase(int options)
void
setBackupPath(String backupPath)
void
setDatabase(String database)
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.

Methods inherited from class org.firebirdsql.management.FBServiceManager

attachServiceManager, createRequestBuffer, detachServiceManager, executeServicesOperation, getDatabase, getGds, getHost, getLogger, getPassword, getPort, getServiceName, getUser, queueService, setDatabase, setHost, setLogger, setPassword, setPort, setUser

Constructor Details

FBBackupManager

public FBBackupManager()
Create a new instance of FBBackupManager based on the default GDSType.

FBBackupManager

public FBBackupManager(String gdsType)
Create a new instance of FBBackupManager based on a given GDSType.
Parameters:
gdsType - type must be PURE_JAVA, EMBEDDED, or NATIVE

FBBackupManager

public FBBackupManager(org.firebirdsql.gds.impl.GDSType gdsType)
Create a new instance of FBBackupManager based on a given GDSType.
Parameters:
gdsType - type must be PURE_JAVA, EMBEDDED, or NATIVE

Method Details

addBackupPath

public void addBackupPath(String path)
Specified by:
addBackupPath in interface BackupManager

addBackupPath

public void addBackupPath(String path,
                          int size)
Specified by:
addBackupPath in interface BackupManager

addRestorePath

public void addRestorePath(String path,
                           int size)
Specified by:
addRestorePath in interface BackupManager

backupDatabase

public void backupDatabase()
            throws SQLException
Specified by:
backupDatabase in interface BackupManager

backupDatabase

public void backupDatabase(int options)
            throws SQLException
Specified by:
backupDatabase in interface BackupManager

backupMetadata

public void backupMetadata()
            throws SQLException
Specified by:
backupMetadata in interface BackupManager

clearBackupPaths

public void clearBackupPaths()
Specified by:
clearBackupPaths in interface BackupManager

clearRestorePaths

public void clearRestorePaths()
Specified by:
clearRestorePaths in interface BackupManager

restoreDatabase

public void restoreDatabase()
            throws SQLException
Specified by:
restoreDatabase in interface BackupManager

restoreDatabase

public void restoreDatabase(int options)
            throws SQLException
Specified by:
restoreDatabase in interface BackupManager

setBackupPath

public void setBackupPath(String backupPath)
Specified by:
setBackupPath in interface BackupManager
See Also:
org.firebirdsql.management.BackupManager.setBackupPath(java.lang.String)

setDatabase

public void setDatabase(String database)
Specified by:
setDatabase in interface BackupManager
setDatabase in interface ServiceManager
Overrides:
setDatabase in interface FBServiceManager

setRestorePageBufferCount

public void setRestorePageBufferCount(int bufferCount)
Set the default number of pages to be buffered (cached) by default in a restored database.
Specified by:
setRestorePageBufferCount in interface BackupManager
Parameters:
bufferCount - The page-buffer size to be used, a positive value

setRestorePageSize

public void setRestorePageSize(int pageSize)
Set the page size that will be used for a restored database. The value for pageSize must be one of: 1024, 2048, 4096, or 8192. The default value is 1024.
Specified by:
setRestorePageSize in interface BackupManager
Parameters:
pageSize - The page size to be used in a restored database, one of 1024, 2048, 4196 or 8192

setRestoreReadOnly

public void setRestoreReadOnly(boolean readOnly)
Set the read-only attribute on a restored database.
Specified by:
setRestoreReadOnly in interface BackupManager
Parameters:
readOnly - If true, a restored database will be read-only, otherwise it will be read-write.

setRestoreReplace

public 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:
setRestoreReplace in 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

setVerbose

public void setVerbose(boolean verbose)
Set whether the operations of this BackupManager will result in verbose logging to the configured logger.
Specified by:
setVerbose in interface BackupManager
Parameters:
verbose - If true, operations will be logged verbosely, otherwise they will not be logged verbosely

Copyright B) 2001 David Jencks and other authors. All rights reserved.