public abstract class AbstractCommand extends Object implements org.nuxeo.connect.update.task.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 |
|---|---|
protected String |
fail |
protected Map<String,Object> |
guardVars |
protected String |
id
List of files which must never be deleted at runtime.
|
protected String |
ignore |
| Modifier | Constructor and Description |
|---|---|
|
AbstractCommand(AbstractCommand command) |
protected |
AbstractCommand(String id) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract org.nuxeo.connect.update.task.Command |
doRun(org.nuxeo.connect.update.task.Task task,
Map<String,String> prefs)
Override to implement command actions
|
protected abstract void |
doValidate(org.nuxeo.connect.update.task.Task task,
org.nuxeo.connect.update.ValidationStatus status)
Override to implement validation.
|
String |
getId() |
boolean |
ignore() |
void |
initialize(Element element) |
boolean |
isPostInstall() |
abstract void |
readFrom(Element element)
Must be implemented to initialize the command arguments from an XML
fragment.
|
org.nuxeo.connect.update.task.Command |
run(org.nuxeo.connect.update.task.Task task,
Map<String,String> prefs) |
void |
setFail(String fail) |
void |
setIgnore(String ignore) |
void |
validate(org.nuxeo.connect.update.task.Task task,
org.nuxeo.connect.update.ValidationStatus status) |
protected final String id
protected String fail
protected String ignore
protected AbstractCommand(String id)
public AbstractCommand(AbstractCommand command)
public boolean isPostInstall()
isPostInstall in interface org.nuxeo.connect.update.task.Commandprotected abstract org.nuxeo.connect.update.task.Command doRun(org.nuxeo.connect.update.task.Task task,
Map<String,String> prefs)
throws org.nuxeo.connect.update.PackageException
task - prefs - org.nuxeo.connect.update.PackageExceptionprotected abstract void doValidate(org.nuxeo.connect.update.task.Task task,
org.nuxeo.connect.update.ValidationStatus status)
throws org.nuxeo.connect.update.PackageException
task - The task being validatedstatus - Use ValidationStatus.addError(String) or
ValidationStatus.addWarning(String) to provide
validation error/warning messagesorg.nuxeo.connect.update.PackageExceptionpublic void validate(org.nuxeo.connect.update.task.Task task,
org.nuxeo.connect.update.ValidationStatus status)
throws org.nuxeo.connect.update.PackageException
validate in interface org.nuxeo.connect.update.task.Commandorg.nuxeo.connect.update.PackageExceptionpublic org.nuxeo.connect.update.task.Command run(org.nuxeo.connect.update.task.Task task,
Map<String,String> prefs)
throws org.nuxeo.connect.update.PackageException
run in interface org.nuxeo.connect.update.task.Commandorg.nuxeo.connect.update.PackageExceptionpublic String getId()
getId in interface org.nuxeo.connect.update.task.Commandpublic void setFail(String fail)
public void setIgnore(String ignore)
public boolean ignore()
throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageExceptionpublic void initialize(Element element) throws org.nuxeo.connect.update.PackageException
initialize in interface org.nuxeo.connect.update.task.Commandorg.nuxeo.connect.update.PackageExceptionpublic abstract void readFrom(Element element) throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageExceptionCopyright © 2019 Nuxeo SA. All rights reserved.