com.continuent.tungsten.replicator.backup.generic
Class ScriptDumpAgent

java.lang.Object
  extended by com.continuent.tungsten.replicator.backup.AbstractBackupAgent
      extended by com.continuent.tungsten.replicator.backup.generic.ScriptDumpAgent
All Implemented Interfaces:
BackupAgent, BackupPlugin

public class ScriptDumpAgent
extends AbstractBackupAgent

Implements a backup agent that works by calling an external script. The script must support the following semantics:

Operation Syntax Output
Backup ${script} -backup -properties filename [-options ${options}] 0 for success; in addition, the script must write the name of the backup file into the file name provide by the -properties option.
Backup ${script} -restore -properties filename [-options ${options}] 0 for success; the file to restore is provided in the file indicated by -properties
The properties file is used to exchange file information from a backup or to a restore. The properties file has standard Java key=value format as shown in the following example. Lines preceded by # are comments.

file=/tmp/backup/store-0000000021-custom-backup.tar.gz

Version:
1.0
Author:
Robert Hodges

Field Summary
 
Fields inherited from class com.continuent.tungsten.replicator.backup.AbstractBackupAgent
capabilities, logger, restoreCompleted
 
Constructor Summary
ScriptDumpAgent()
           
 
Method Summary
 BackupSpecification backup()
          Run backup by invoking a script.
 void configure()
          Complete plug-in configuration.
 java.lang.String getCommandPrefix()
           
 java.lang.String getLogFilename()
           
 java.lang.String getOptions()
           
 java.lang.String getScript()
           
 boolean isHotBackupEnabled()
           
 void release()
          Release all resources used by plug-in.
protected  void restoreOneLocator(BackupLocator locator)
          restoreOneLocator is used to restore a database using one locator.
 void setCommandPrefix(java.lang.String commandPrefix)
           
 void setHotBackupEnabled(boolean hotBackupEnabled)
           
 void setLogFilename(java.lang.String logFilename)
           
 void setOptions(java.lang.String options)
           
 void setScript(java.lang.String script)
           
 
Methods inherited from class com.continuent.tungsten.replicator.backup.AbstractBackupAgent
capabilities, completeRestore, initRestore, restore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptDumpAgent

public ScriptDumpAgent()
Method Detail

getScript

public java.lang.String getScript()

setScript

public void setScript(java.lang.String script)

getCommandPrefix

public java.lang.String getCommandPrefix()

setCommandPrefix

public void setCommandPrefix(java.lang.String commandPrefix)

getOptions

public java.lang.String getOptions()

setOptions

public void setOptions(java.lang.String options)

isHotBackupEnabled

public boolean isHotBackupEnabled()

setHotBackupEnabled

public void setHotBackupEnabled(boolean hotBackupEnabled)

getLogFilename

public java.lang.String getLogFilename()

setLogFilename

public void setLogFilename(java.lang.String logFilename)

backup

public BackupSpecification backup()
                           throws BackupException
Run backup by invoking a script. Back up the database.

Specified by:
backup in interface BackupAgent
Specified by:
backup in class AbstractBackupAgent
Throws:
BackupException
See Also:
BackupAgent.backup()

configure

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

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

release

public 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
Specified by:
release in class AbstractBackupAgent
Throws:
BackupException
See Also:
BackupPlugin.release()

restoreOneLocator

protected void restoreOneLocator(BackupLocator locator)
                          throws BackupException,
                                 java.io.FileNotFoundException
Description copied from class: AbstractBackupAgent
restoreOneLocator is used to restore a database using one locator.

Specified by:
restoreOneLocator in class AbstractBackupAgent
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