Class AbstractTask

java.lang.Object
org.nuxeo.connect.update.task.standalone.AbstractTask
All Implemented Interfaces:
org.nuxeo.connect.update.task.Task
Direct Known Subclasses:
CommandsTask

public abstract class AbstractTask extends Object implements org.nuxeo.connect.update.task.Task
Author:
Bogdan Stefanescu
  • Field Details

  • Constructor Details

    • AbstractTask

      public AbstractTask(org.nuxeo.connect.update.PackageUpdateService pus)
  • Method Details

    • isInstallTask

      public abstract boolean isInstallTask()
    • initialize

      public void initialize(org.nuxeo.connect.update.LocalPackage pkg, boolean restart) throws org.nuxeo.connect.update.PackageException
      Specified by:
      initialize in interface org.nuxeo.connect.update.task.Task
      Throws:
      org.nuxeo.connect.update.PackageException
    • getFile

      public File getFile(String key)
      Get a file given its key in the environment map. If no key exists then null is returned.
    • isRestartRequired

      public boolean isRestartRequired()
      Specified by:
      isRestartRequired in interface org.nuxeo.connect.update.task.Task
    • getPackage

      public org.nuxeo.connect.update.LocalPackage getPackage()
      Specified by:
      getPackage in interface org.nuxeo.connect.update.task.Task
    • createContextMap

      protected Map<Object,Object> createContextMap(Map<String,String> params)
    • loadParametrizedFile

      protected String loadParametrizedFile(File file, Map<String,String> params) throws IOException
      Throws:
      IOException
    • saveParams

      protected void saveParams(Map<String,String> params) throws org.nuxeo.connect.update.PackageException
      Throws:
      org.nuxeo.connect.update.PackageException
    • run

      public void run(Map<String,String> params) throws org.nuxeo.connect.update.PackageException
      Specified by:
      run in interface org.nuxeo.connect.update.task.Task
      Throws:
      org.nuxeo.connect.update.PackageException
    • getUpdateManager

      public UpdateManager getUpdateManager() throws org.nuxeo.connect.update.PackageException
      Throws:
      org.nuxeo.connect.update.PackageException
    • rollbackDone

      protected abstract void rollbackDone() throws org.nuxeo.connect.update.PackageException
      Throws:
      org.nuxeo.connect.update.PackageException
    • taskDone

      protected abstract void taskDone() throws org.nuxeo.connect.update.PackageException
      Throws:
      org.nuxeo.connect.update.PackageException
    • rollback

      public void rollback() throws org.nuxeo.connect.update.PackageException
      Specified by:
      rollback in interface org.nuxeo.connect.update.task.Task
      Throws:
      org.nuxeo.connect.update.PackageException
    • setRestartRequired

      public void setRestartRequired(boolean isRestartRequired)
      Specified by:
      setRestartRequired in interface org.nuxeo.connect.update.task.Task
    • doRun

      protected abstract void doRun(Map<String,String> params) throws org.nuxeo.connect.update.PackageException
      Throws:
      org.nuxeo.connect.update.PackageException
    • doRollback

      protected abstract void doRollback() throws org.nuxeo.connect.update.PackageException
      Throws:
      org.nuxeo.connect.update.PackageException
    • validate

      public org.nuxeo.connect.update.ValidationStatus validate() throws org.nuxeo.connect.update.PackageException
      Specified by:
      validate in interface org.nuxeo.connect.update.task.Task
      Throws:
      org.nuxeo.connect.update.PackageException
    • doValidate

      public abstract void doValidate(org.nuxeo.connect.update.ValidationStatus status) throws org.nuxeo.connect.update.PackageException
      Throws:
      org.nuxeo.connect.update.PackageException
    • validateInstall

      protected org.nuxeo.connect.update.LocalPackage validateInstall(org.nuxeo.connect.update.ValidationStatus status) throws org.nuxeo.connect.update.PackageException
      Throws:
      org.nuxeo.connect.update.PackageException
    • getRelativeFilePath

      public String getRelativeFilePath(File file)
      Specified by:
      getRelativeFilePath in interface org.nuxeo.connect.update.task.Task