Class Update
- java.lang.Object
-
- org.nuxeo.connect.update.task.standalone.commands.AbstractCommand
-
- org.nuxeo.connect.update.task.update.Update
-
- All Implemented Interfaces:
org.nuxeo.connect.update.task.Command
- Direct Known Subclasses:
UpdateAndDeploy
public class Update extends AbstractCommand
- Since:
- 5.5
- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
allowDowngrade
protected File
file
The source file.static String
ID
protected static Log
log
protected boolean
removeOnExit
protected File
todir
The target file.protected boolean
upgradeOnly
-
Fields inherited from class org.nuxeo.connect.update.task.standalone.commands.AbstractCommand
fail, guardVars, id, ignore
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.nuxeo.connect.update.task.Command
doRun(org.nuxeo.connect.update.task.Task task, Map<String,String> prefs)
Override to implement command actionsprotected void
doValidate(org.nuxeo.connect.update.task.Task task, org.nuxeo.connect.update.ValidationStatus status)
Override to implement validation.protected org.nuxeo.connect.update.task.Command
getDeployCommand(UpdateManager updateManager, org.nuxeo.connect.update.task.Command rollbackCommand)
Method to be overridden by subclasses to provide a deploy command for hot reloadFile
getFile()
void
initialize(Element element)
void
readFrom(Element element)
Must be implemented to initialize the command arguments from an XML fragment.protected CompositeCommand
updateDirectory(org.nuxeo.connect.update.task.Task task, File dir, UpdateManager mgr)
protected Rollback
updateFile(org.nuxeo.connect.update.task.Task task, File fileToUpdate, UpdateManager mgr)
void
writeTo(org.nuxeo.connect.update.xml.XmlWriter writer)
-
Methods inherited from class org.nuxeo.connect.update.task.standalone.commands.AbstractCommand
getId, ignore, isPostInstall, run, setFail, setIgnore, setPackageUpdateService, validate
-
-
-
-
Field Detail
-
log
protected static final Log log
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
file
protected File file
The source file. It can be a file or a directory.
-
todir
protected File todir
The target file. It can be a directory since 5.5
-
removeOnExit
protected boolean removeOnExit
-
allowDowngrade
protected boolean allowDowngrade
-
upgradeOnly
protected boolean upgradeOnly
-
-
Constructor Detail
-
Update
protected Update(String id)
-
Update
public Update()
-
-
Method Detail
-
initialize
public void initialize(Element element) throws org.nuxeo.connect.update.PackageException
- Specified by:
initialize
in interfaceorg.nuxeo.connect.update.task.Command
- Overrides:
initialize
in classAbstractCommand
- Throws:
org.nuxeo.connect.update.PackageException
-
readFrom
public void readFrom(Element element) throws org.nuxeo.connect.update.PackageException
Description copied from class:AbstractCommand
Must be implemented to initialize the command arguments from an XML fragment.- Specified by:
readFrom
in classAbstractCommand
- Throws:
org.nuxeo.connect.update.PackageException
-
writeTo
public void writeTo(org.nuxeo.connect.update.xml.XmlWriter writer)
-
doValidate
protected void doValidate(org.nuxeo.connect.update.task.Task task, org.nuxeo.connect.update.ValidationStatus status) throws org.nuxeo.connect.update.PackageException
Description copied from class:AbstractCommand
Override to implement validation.- Specified by:
doValidate
in classAbstractCommand
- Parameters:
task
- The task being validatedstatus
- UseValidationStatus.addError(String)
orValidationStatus.addWarning(String)
to provide validation error/warning messages- Throws:
org.nuxeo.connect.update.PackageException
-
doRun
protected org.nuxeo.connect.update.task.Command doRun(org.nuxeo.connect.update.task.Task task, Map<String,String> prefs) throws org.nuxeo.connect.update.PackageException
Description copied from class:AbstractCommand
Override to implement command actions- Specified by:
doRun
in classAbstractCommand
- Returns:
- Rollback command
- Throws:
org.nuxeo.connect.update.PackageException
-
updateDirectory
protected CompositeCommand updateDirectory(org.nuxeo.connect.update.task.Task task, File dir, UpdateManager mgr) throws org.nuxeo.connect.update.PackageException
- Throws:
org.nuxeo.connect.update.PackageException
-
updateFile
protected Rollback updateFile(org.nuxeo.connect.update.task.Task task, File fileToUpdate, UpdateManager mgr) throws org.nuxeo.connect.update.PackageException
- Throws:
org.nuxeo.connect.update.PackageException
-
getDeployCommand
protected org.nuxeo.connect.update.task.Command getDeployCommand(UpdateManager updateManager, org.nuxeo.connect.update.task.Command rollbackCommand)
Method to be overridden by subclasses to provide a deploy command for hot reload- Since:
- 5.6
-
getFile
public File getFile()
- Since:
- 9.3
-
-