public abstract class AbstractCommand extends Object implements Command
If ignore is defined and evaluated to true then the command will be ignored (null is returned as the inverse command) If fail is defined and evaluated to true then the validation fails.
Commands extending this class must implement the doRun(org.nuxeo.connect.update.task.Task, java.util.Map<java.lang.String, java.lang.String>)
and
doValidate(org.nuxeo.connect.update.task.Task, org.nuxeo.connect.update.ValidationStatus)
methods instead of the one in the interface. These
methods are first testing for ignore and fail guards and then if needed
delegated to the doXXX method versions.
Modifier and Type | Field and Description |
---|---|
static String[] |
FILES_TO_DELETE_ONLY_ON_EXIT
List of files which must never be deleted at runtime.
|
Modifier and Type | Method and Description |
---|---|
String |
getId()
The command id
|
boolean |
ignore() |
void |
initialize(Element element)
Initialize a command parameters from a DOM element.
|
boolean |
isPostInstall()
Test if the command must be run at the end in an installation process.
|
abstract void |
readFrom(Element element)
Must be implemented to initialize the command arguments from an XML
fragment.
|
Command |
run(org.nuxeo.connect.update.task.Task task,
Map<String,String> prefs)
Execute the command and return the inverse command that can be used to
rollback.
|
void |
setFail(String fail) |
void |
setIgnore(String ignore) |
void |
validate(org.nuxeo.connect.update.task.Task task,
org.nuxeo.connect.update.ValidationStatus status)
Validate if the command can be safely executed on the running platform.
|
public static final String[] FILES_TO_DELETE_ONLY_ON_EXIT
public boolean isPostInstall()
Command
PostInstallCommand
.isPostInstall
in interface Command
public void validate(org.nuxeo.connect.update.task.Task task, org.nuxeo.connect.update.ValidationStatus status) throws org.nuxeo.connect.update.PackageException
Command
public Command run(org.nuxeo.connect.update.task.Task task, Map<String,String> prefs) throws org.nuxeo.connect.update.PackageException
Command
public void setFail(String fail)
public void setIgnore(String ignore)
public boolean ignore() throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
public void initialize(Element element) throws org.nuxeo.connect.update.PackageException
Command
initialize
in interface Command
org.nuxeo.connect.update.PackageException
public abstract void readFrom(Element element) throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
Copyright © 2011 Nuxeo SA. All Rights Reserved.