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
Modifier 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCommand
(org.nuxeo.connect.update.task.Command command) Adds a command to this task.protected void
protected void
User parameters are not handled by default.void
doValidate
(org.nuxeo.connect.update.ValidationStatus status) protected abstract void
flush()
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 File
Get the commands file from where to load commands for this task.void
initialize
(org.nuxeo.connect.update.LocalPackage pkg, boolean restart) protected void
Load the commands of this task given the user parameters.parametrizePaths
(String content) void
void
Methods 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:
initialize
in interfaceorg.nuxeo.connect.update.task.Task
- Overrides:
initialize
in 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:
doRun
in 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:
doRollback
in 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:
doValidate
in classAbstractTask
- Throws:
org.nuxeo.connect.update.PackageException
-
writeLog
- Throws:
org.nuxeo.connect.update.PackageException
-
parametrizePaths
-
readLog
- Throws:
org.nuxeo.connect.update.PackageException
-