info.magnolia.module.delta
Class BackupTask

java.lang.Object
  extended by info.magnolia.module.delta.ArrayDelegateTask
      extended by info.magnolia.module.delta.BackupTask
All Implemented Interfaces:
Task

public class BackupTask
extends ArrayDelegateTask

Backs up a node in the same workspace under a specific backup path.

Version:
$Id: BackupTask.java 41137 2011-01-06 18:19:25Z gjoseph $
Author:
vsteller

Constructor Summary
BackupTask(java.lang.String workspace, java.lang.String path)
           
BackupTask(java.lang.String workspace, java.lang.String path, boolean info)
           
 
Method Summary
 void execute(InstallContext ctx)
          A good-citizen task should execute itself responsibly: it should know what to do in case of problems: for instance, fixable or irrelevant issues should usually just be logged used the InstallContext methods, when the user can fix them later on.
protected  java.lang.String getBackupPath()
           
 
Methods inherited from class info.magnolia.module.delta.ArrayDelegateTask
addTask, getDescription, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BackupTask

public BackupTask(java.lang.String workspace,
                  java.lang.String path)

BackupTask

public BackupTask(java.lang.String workspace,
                  java.lang.String path,
                  boolean info)
Parameters:
workspace - the workspace that contains path
path - the path to the node that is to be backed up.
info - indicates if an info message should be displayed.
Method Detail

execute

public void execute(InstallContext ctx)
             throws TaskExecutionException
Description copied from interface: Task
A good-citizen task should execute itself responsibly: it should know what to do in case of problems: for instance, fixable or irrelevant issues should usually just be logged used the InstallContext methods, when the user can fix them later on. The task could also potentially do backups of nodes it needs to modify extensively, so the user could refer to the backups in case of problem. In the event of an unrecoverable issue, the Task could also throw a TaskExecutionException, knowing that will cancel the whole module's installation, update and startup. If a TaskExecutionException must be thrown, keep in mind that the exception message will still be shown to the end user, so try to keep them human readable.

Specified by:
execute in interface Task
Overrides:
execute in class ArrayDelegateTask
Throws:
TaskExecutionException

getBackupPath

protected java.lang.String getBackupPath()


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.