Class AbstractCommand
java.lang.Object
org.nuxeo.connect.update.task.standalone.commands.AbstractCommand
- All Implemented Interfaces:
org.nuxeo.connect.update.task.Command
- Direct Known Subclasses:
CompositeCommand,Config,Copy,Delete,DeployConfigPlaceholder,DeployPlaceholder,InstallPlaceholder,LoadJarPlaceholder,PostInstallCommand,Rollback,UnAppend,UndeployConfigPlaceholder,UndeployPlaceholder,UninstallPlaceholder,UnloadJarPlaceholder,Update
public abstract class AbstractCommand
extends Object
implements org.nuxeo.connect.update.task.Command
All commands have 2 attributes: fail and ignore which are EL expressions.
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.
- Author:
- Bogdan Stefanescu
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.nuxeo.connect.update.task.CommandOverride to implement command actionsprotected abstract voiddoValidate(org.nuxeo.connect.update.task.Task task, org.nuxeo.connect.update.ValidationStatus status) Override to implement validation.getId()booleanignore()voidinitialize(Element element) booleanabstract voidMust be implemented to initialize the command arguments from an XML fragment.org.nuxeo.connect.update.task.CommandvoidvoidvoidsetPackageUpdateService(org.nuxeo.connect.update.PackageUpdateService packageUpdateService) voidvalidate(org.nuxeo.connect.update.task.Task task, org.nuxeo.connect.update.ValidationStatus status) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.connect.update.task.Command
writeTo
-
Field Details
-
id
List of files which must never be deleted at runtime.- Since:
- 5.5
-
guardVars
-
fail
-
ignore
-
-
Constructor Details
-
AbstractCommand
-
AbstractCommand
-
-
Method Details
-
setPackageUpdateService
public void setPackageUpdateService(org.nuxeo.connect.update.PackageUpdateService packageUpdateService) - Specified by:
setPackageUpdateServicein interfaceorg.nuxeo.connect.update.task.Command
-
isPostInstall
public boolean isPostInstall()- Specified by:
isPostInstallin interfaceorg.nuxeo.connect.update.task.Command
-
doRun
protected abstract org.nuxeo.connect.update.task.Command doRun(org.nuxeo.connect.update.task.Task task, Map<String, String> prefs) throws org.nuxeo.connect.update.PackageExceptionOverride to implement command actions- Returns:
- Rollback command
- Throws:
org.nuxeo.connect.update.PackageException
-
doValidate
protected abstract void doValidate(org.nuxeo.connect.update.task.Task task, org.nuxeo.connect.update.ValidationStatus status) throws org.nuxeo.connect.update.PackageException Override to implement validation.- Parameters:
task- The task being validatedstatus- UseValidationStatus.addError(String)orValidationStatus.addWarning(String)to provide validation error/warning messages- Throws:
org.nuxeo.connect.update.PackageException
-
validate
public void validate(org.nuxeo.connect.update.task.Task task, org.nuxeo.connect.update.ValidationStatus status) throws org.nuxeo.connect.update.PackageException - Specified by:
validatein interfaceorg.nuxeo.connect.update.task.Command- Throws:
org.nuxeo.connect.update.PackageException
-
run
public org.nuxeo.connect.update.task.Command run(org.nuxeo.connect.update.task.Task task, Map<String, String> prefs) throws org.nuxeo.connect.update.PackageException- Specified by:
runin interfaceorg.nuxeo.connect.update.task.Command- Throws:
org.nuxeo.connect.update.PackageException
-
getId
- Specified by:
getIdin interfaceorg.nuxeo.connect.update.task.Command
-
setFail
-
setIgnore
-
ignore
public boolean ignore() throws org.nuxeo.connect.update.PackageException- Throws:
org.nuxeo.connect.update.PackageException
-
initialize
- Specified by:
initializein interfaceorg.nuxeo.connect.update.task.Command- Throws:
org.nuxeo.connect.update.PackageException
-
readFrom
Must be implemented to initialize the command arguments from an XML fragment.- Throws:
org.nuxeo.connect.update.PackageException
-