Class CommandsTask
java.lang.Object
org.nuxeo.connect.update.task.standalone.AbstractTask
org.nuxeo.connect.update.task.standalone.CommandsTask
- All Implemented Interfaces:
org.nuxeo.connect.update.task.Task
- Direct Known Subclasses:
InstallTask,UninstallTask
A command based task.
- Author:
- Bogdan Stefanescu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final LinkedList<org.nuxeo.connect.update.task.Command> The log is generated in the inverse order of commands to ensure last command is rollbacked first.protected final List<org.nuxeo.connect.update.task.Command> Fields inherited from class org.nuxeo.connect.update.task.standalone.AbstractTask
env, ENV_BUNDLES, ENV_CONFIG, ENV_EAR, ENV_HOME, ENV_HOSTAPP_NAME, ENV_HOSTAPP_VERSION, ENV_LIB, ENV_SERVER_HOME, ENV_SYSLIB, ENV_TEMPLATES, ENV_TIMESTAMP, pkg, PKG_ID, PKG_NAME, PKG_ROOT, PKG_VERSION, restart, serverPathPrefix, service, updateMgr, updateMgrLoaded -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommand(org.nuxeo.connect.update.task.Command command) Adds a command to this task.protected voidprotected voidUser parameters are not handled by default.voiddoValidate(org.nuxeo.connect.update.ValidationStatus status) protected abstract voidflush()List<org.nuxeo.connect.update.task.Command> Gets the command log.List<org.nuxeo.connect.update.task.Command> Gets the commands to execute.protected abstract FileGet the commands file from where to load commands for this task.voidinitialize(org.nuxeo.connect.update.LocalPackage pkg, boolean restart) protected voidLoad the commands of this task given the user parameters.parametrizePaths(String content) voidvoidMethods inherited from class org.nuxeo.connect.update.task.standalone.AbstractTask
createContextMap, getFile, getPackage, getRelativeFilePath, getUpdateManager, isInstallTask, isRestartRequired, loadParametrizedFile, rollback, rollbackDone, run, saveParams, setRestartRequired, taskDone, validate, validateInstall
-
Field Details
-
commands
-
commandLog
The log is generated in the inverse order of commands to ensure last command is rollbacked first.
-
-
Constructor Details
-
CommandsTask
public CommandsTask(org.nuxeo.connect.update.PackageUpdateService pus)
-
-
Method Details
-
getCommandsFile
Get the commands file from where to load commands for this task.- Throws:
org.nuxeo.connect.update.PackageException
-
initialize
public void initialize(org.nuxeo.connect.update.LocalPackage pkg, boolean restart) throws org.nuxeo.connect.update.PackageException - Specified by:
initializein interfaceorg.nuxeo.connect.update.task.Task- Overrides:
initializein classAbstractTask- Throws:
org.nuxeo.connect.update.PackageException
-
loadCommands
protected void loadCommands() throws org.nuxeo.connect.update.PackageExceptionLoad the commands of this task given the user parameters. The parameter map may be null.- Throws:
org.nuxeo.connect.update.PackageException
-
getCommands
Gets the commands to execute. -
getCommandLog
Gets the command log. These are the commands ran so far. -
addCommand
public void addCommand(org.nuxeo.connect.update.task.Command command) Adds a command to this task. -
doRun
User parameters are not handled by default. You need to implement your own task to do this.- Specified by:
doRunin classAbstractTask- Throws:
org.nuxeo.connect.update.PackageException
-
flush
protected abstract void flush() throws org.nuxeo.connect.update.PackageException- Throws:
org.nuxeo.connect.update.PackageException- Since:
- 5.6
-
doRollback
protected void doRollback() throws org.nuxeo.connect.update.PackageException- Specified by:
doRollbackin classAbstractTask- Throws:
org.nuxeo.connect.update.PackageException
-
doValidate
public void doValidate(org.nuxeo.connect.update.ValidationStatus status) throws org.nuxeo.connect.update.PackageException - Specified by:
doValidatein classAbstractTask- Throws:
org.nuxeo.connect.update.PackageException
-
writeLog
- Throws:
org.nuxeo.connect.update.PackageException
-
parametrizePaths
-
readLog
- Throws:
org.nuxeo.connect.update.PackageException
-