Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * $Id: BackupManager.java 56977 2012-06-08 14:24:15Z mrotteveel $
   * 
   * Firebird Open Source J2EE Connector - JDBC Driver
   * 
   * Copyright (C) All Rights Reserved.
   * 
   * This file was created by members of the firebird development team.
   * All individual contributions remain the Copyright (C) of those
  * individuals.  Contributors to this file are either listed here or
  * can be obtained from a CVS history command.
  * 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *  
  *   - Redistributions of source code must retain the above copyright 
  *     notice, this list of conditions and the following disclaimer.
  *   - Redistributions in binary form must reproduce the above 
  *     copyright notice, this list of conditions and the following 
  *     disclaimer in the documentation and/or other materials provided 
  *     with the distribution.
  *   - Neither the name of the firebird development team nor the names
  *     of its contributors may be used to endorse or promote products 
  *     derived from this software without specific prior written 
  *     permission.
  * 
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
  * SUCH DAMAGE.
  */
 package org.firebirdsql.management;
 
 
Implements the backup and restore functionality of Firebird Services API.

Author(s):
Roman Rokytskyy
Steven Jardine
 
 public interface BackupManager extends ServiceManager {

    
Ignore checksums.
 
     public static final int BACKUP_IGNORE_CHECKSUMS = .;

    
Ignore in-limbo transactions.
 
     public static final int BACKUP_IGNORE_LIMBO = .;

    
Backup metadata only.
 
     public static final int BACKUP_METADATA_ONLY = .;

    
Do not collect garbage during backup.
 
     public static final int BACKUP_NO_GARBAGE_COLLECT = .;

    
Save old style metadata descriptions.
 
     public static final int BACKUP_OLD_DESCRIPTIONS = .;

    
Use non-transportable backup format.
 
     public static final int BACKUP_NON_TRANSPORTABLE = .;

    
Backup external files as tables.
 
     public static final int BACKUP_CONVERT = .;

    
No data compression.
 
     public static final int BACKUP_EXPAND = .;

    
Deactivate indices during restore.
 
     public static final int RESTORE_DEACTIVATE_INDEX = .;

    
Do not restore shadow database.
    public static final int RESTORE_NO_SHADOW = .;

    
Do not restore validity constraints.
    public static final int RESTORE_NO_VALIDITY = .;

    
Commit after completing restore of each table.
    public static final int RESTORE_ONE_AT_A_TIME = .;

    
Do not reserve 20% on each page for the future versions, useful for read-only databases.
    public static final int RESTORE_USE_ALL_SPACE = .;

    
    
Sets 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 call addBackupPath(java.lang.String,int) method after calling this one.

Parameters:
backupPath the location of the backup file.
See also:
addBackupPath(java.lang.String,int) for multi-file backups.
    void setBackupPath(String backupPath);
    
    
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.

Parameters:
path path to the backup file.
size max size of the file in bytes.
    void addBackupPath(String pathint size);
    
    
Add 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 to addBackupPath(java.lang.String,int) call.

If application invokes backup operation, an error is generated in that call.

Parameters:
path path to the backup file.
    void addBackupPath(String path);
    
    
Clear the information about backup paths. This method undoes all parameters set in the addBackupPath(java.lang.String,int) or addBackupPath(java.lang.String) methods.
    void clearBackupPaths();
    
    
Set the path to the database. This method is used both for backup and restore operation.

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 single-file database where the backup will be restored to.

    void setDatabase(String path);
    
    
Add the file to the multi-file database of the specified size for restore operation.

Parameters:
path path to the backup file.
size max size of the database file in pages.
    void addRestorePath(String pathint size);
    
    
Clear the information about restore paths. This method undoes all parameters set in the addRestorePath(java.lang.String,int) or setDatabase(java.lang.String) methods.
    void clearRestorePaths();

    
Perform the backup operation.

Throws:
java.sql.SQLException if a database error occurs during the backup
    public void backupDatabase() throws SQLException;

    
Perform the backup operation, metadata only.

Throws:
java.sql.SQLException if a database error occurs during the backup
    public void backupMetadata() throws SQLException;

    
Perform the backup operation.

Parameters:
options a bitmask combination of the BACKUP_* static final fields for the backup operation
Throws:
java.sql.SQLException if a database error occurs during the backup
    public void backupDatabase(int optionsthrows SQLException;

    
Set whether the operations of this BackupManager will result in verbose logging to the configured logger.

Parameters:
verbose If true, operations will be logged verbosely, otherwise they will not be logged verbosely
    public void setVerbose(boolean verbose);
      
    
Set the default number of pages to be buffered (cached) by default in a restored database.

Parameters:
bufferCount The page-buffer size to be used, a positive value
    public void setRestorePageBufferCount(int bufferCount);

    
Set the page size that will be used for a restored database. The value for pageSize must be one of: 1024, 2048, 4096, 8192 or 16384. The default value depends on the Firebird version.

Parameters:
pageSize The page size to be used in a restored database, one of 1024, 2048, 4196, 8192 or 16384
    public void setRestorePageSize(int pageSize);

    
Set the restore operation to create a new database, as opposed to overwriting an existing database.

Parameters:
replace If true, the restore operation will attempt to create a new database if it does not exit or overwrite an existing one when it exists, false when restore should fail if database already exist (if it doesn't, a database will be successfully created).
    public void setRestoreReplace(boolean replace);

    
Set the read-only attribute on a restored database.

Parameters:
readOnly If true, a restored database will be read-only, otherwise it will be read-write.
    public void setRestoreReadOnly(boolean readOnly);

    
Perform the restore operation.

Throws:
java.sql.SQLException if a database error occurs during the restore
    public void restoreDatabase() throws SQLException;

    
Perform the restore operation.

Parameters:
options A bitmask combination of RESTORE_* static final fields
Throws:
java.sql.SQLException if a database error occurs during the restore
    public void restoreDatabase(int optionsthrows SQLException;
New to GrepCode? Check out our FAQ X