Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Firebird Open Source J2EE Connector - JDBC Driver
   *
   * Distributable under LGPL license.
   * You may obtain a copy of the License at http://www.gnu.org/copyleft/lgpl.html
   *
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * LGPL License for more details.
  *
  * 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.
  *
  * All rights reserved.
  */
 package org.firebirdsql.management;
 
 
Implements the incremental backup and restore functionality of NBackup via the Firebird Services API.

Author(s):
Thomas Steinmaurer
 
 public class FBNBackupManager extends FBServiceManager implements NBackupManager {
 
     private ArrayList backupFiles = new ArrayList();
     
     private int backupLevel = 0;
     private boolean noDBTriggers = false;
    
    
Create a new instance of FBNBackupManager based on the default GDSType.
 
     public FBNBackupManager()
     {
     	super();
     }

    
Create a new instance of FBNBackupManager based on a given GDSType.

Parameters:
gdsType type must be PURE_JAVA, EMBEDDED, or NATIVE
 
     public FBNBackupManager(String gdsType)
     {
     	super(gdsType);
     }

    
Create a new instance of FBNBackupManager based on a given GDSType.

Parameters:
gdsType type must be PURE_JAVA, EMBEDDED, or NATIVE
 
     public FBNBackupManager(GDSType gdsType) {
     	super(gdsType);
     }
    
    
 
     public void setBackupFile(String backupFile) {
         addBackupFile(backupFile);
     }

    
 
     public void addBackupFile(String backupFile) {
         this..add(backupFile);
     }
    
    
 
     public void clearBackupFiles() {
         this..clear();
     }
    
    
 
     public void setDatabase(String database) {
         super.setDatabase(database);
    }
    
    
    public void backupDatabase() throws SQLException {
    }

    
Creates and returns the "backup" service request buffer for the Service Manager.

Returns:
the "backup" service request buffer for the Service Manager.
    private ServiceRequestBuffer getBackupSRB() throws SQLException {
                .);
        backupSPB.addArgument(.getDatabase());
        Iterator it = this..iterator();
        if (it.hasNext()) {
            String backupFile = (Stringit.next();
            
            backupSPB.addArgument(.backupFile);
            backupSPB.addArgument(.this.);
            if (this.)
        } else {
        	throw new FBSQLException("No backup file specified");
        }
        
        return backupSPB;
    }

    
    public void restoreDatabase() throws SQLException {
    }

    
Creates and returns the "restore" service request buffer for the Service Manager.

Returns:
the "restore" service request buffer for the Service Manager.
    private ServiceRequestBuffer getRestoreSRB() throws SQLException {
        GDS gds = getGds();
        ServiceRequestBuffer restoreSPB = gds
        restoreSPB.addArgument(.getDatabase());
        
        Iterator it = this..iterator();
        if (it.hasNext()) {
        	while (it.hasNext()) {
                String backupFile = (Stringit.next();
                restoreSPB.addArgument(.backupFile);
        	}
        } else {
        	throw new FBSQLException("No backup file specified");
        }
        return restoreSPB;
    }
    
    
    public void setBackupLevel(int backupLevel) {
    	this. = backupLevel;
    }
    
    
    public void setNoDBTriggers(boolean noDBTriggers) {
    	this. = noDBTriggers;
    }
New to GrepCode? Check out our FAQ X