com.continuent.tungsten.replicator.backup
Class AbstractBackupAgent

java.lang.Object
  extended by com.continuent.tungsten.replicator.backup.AbstractBackupAgent
All Implemented Interfaces:
BackupAgent, BackupPlugin
Direct Known Subclasses:
MySqlDumpAgent, MySqlLvmDumpAgent, PostgreSqlDumpAgent, ScriptDumpAgent

public abstract class AbstractBackupAgent
extends java.lang.Object
implements BackupAgent

This class defines a AbstractBackupAgent

Version:
1.0
Author:
Stephane Giron

Field Summary
protected  BackupCapabilities capabilities
           
protected static org.apache.log4j.Logger logger
           
protected  ProcessHelper processHelper
           
protected  boolean restoreCompleted
           
 
Constructor Summary
AbstractBackupAgent()
           
 
Method Summary
abstract  BackupSpecification backup()
          Back up the database.
 BackupCapabilities capabilities()
          Returns capabilities of this backup agent.
protected  void completeRestore()
          Post-restore operations.
 void configure()
          Complete plug-in configuration.
protected  void initRestore()
          Pre-restore operations.
abstract  void release()
          Release all resources used by plug-in.
 void restore(BackupSpecification bspec)
          Restore the database from a backup.
protected abstract  void restoreOneLocator(BackupLocator locator)
          restoreOneLocator is used to restore a database using one locator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

processHelper

protected ProcessHelper processHelper

restoreCompleted

protected boolean restoreCompleted

capabilities

protected BackupCapabilities capabilities
Constructor Detail

AbstractBackupAgent

public AbstractBackupAgent()
Method Detail

backup

public abstract BackupSpecification backup()
                                    throws BackupException,
                                           java.lang.InterruptedException
Back up the database.

Specified by:
backup in interface BackupAgent
Throws:
BackupException
java.lang.InterruptedException
See Also:
BackupAgent.backup()

restore

public void restore(BackupSpecification bspec)
             throws BackupException,
                    java.lang.InterruptedException
Restore the database from a backup.

Specified by:
restore in interface BackupAgent
Throws:
BackupException
java.lang.InterruptedException
See Also:
BackupAgent.restore(com.continuent.tungsten.replicator.backup.BackupSpecification)

initRestore

protected void initRestore()
                    throws BackupException
Pre-restore operations.

Throws:
BackupException - if anything wrong happened while preparing to restore

completeRestore

protected void completeRestore()
Post-restore operations.


restoreOneLocator

protected abstract void restoreOneLocator(BackupLocator locator)
                                   throws BackupException,
                                          java.io.FileNotFoundException
restoreOneLocator is used to restore a database using one locator.

Parameters:
locator - the locator to be used to restore the database
Throws:
BackupException - if something happens while restoring
java.io.FileNotFoundException - if the dump file cannot be found

configure

public void configure()
               throws BackupException
Complete plug-in configuration. This is called after setters are invoked.

Specified by:
configure in interface BackupPlugin
Throws:
BackupException
See Also:
BackupPlugin.configure()

release

public abstract void release()
                      throws BackupException
Release all resources used by plug-in. This is called before the plug-in is deallocated.

Specified by:
release in interface BackupPlugin
Throws:
BackupException
See Also:
BackupPlugin.release()

capabilities

public BackupCapabilities capabilities()
Returns capabilities of this backup agent.

Specified by:
capabilities in interface BackupAgent
See Also:
BackupAgent.capabilities()