info.magnolia.module.delta
Class AbstractConditionalRepositoryTask
java.lang.Object
info.magnolia.module.delta.AbstractTask
info.magnolia.module.delta.AbstractRepositoryTask
info.magnolia.module.delta.AbstractConditionalRepositoryTask
- All Implemented Interfaces:
- Task
public abstract class AbstractConditionalRepositoryTask
- extends AbstractRepositoryTask
An abstract implementation of a RepositoryTask that only needs to be executed when a specific node is not found in the
repository. Can be used to easily create self-check tasks for mandatory configuration.
- Version:
- $Id$
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. |
abstract String |
getCheckedPath()
Returns a path in a repository in the form repository:path (e.g. |
AbstractConditionalRepositoryTask
public AbstractConditionalRepositoryTask(String name,
String description)
- Parameters:
name
- task namedescription
- task description
getCheckedPath
public abstract String getCheckedPath()
- Returns a path in a repository in the form
repository:path
(e.g.
config:server/activation
) that will checked. Only if such path doesn't exist, doExecute() will be
called.
- Returns:
- repository:path string
execute
public void execute(InstallContext ctx)
throws TaskExecutionException
- 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 AbstractRepositoryTask
- Throws:
TaskExecutionException
Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.