Class AbstractCommand

    • Field Detail

      • id

        protected final String id
        List of files which must never be deleted at runtime.
        Since:
        5.5
      • ignore

        protected String ignore
    • Constructor Detail

      • AbstractCommand

        protected AbstractCommand​(String id)
    • Method Detail

      • setPackageUpdateService

        public void setPackageUpdateService​(org.nuxeo.connect.update.PackageUpdateService packageUpdateService)
        Specified by:
        setPackageUpdateService in interface org.nuxeo.connect.update.task.Command
      • isPostInstall

        public boolean isPostInstall()
        Specified by:
        isPostInstall in interface org.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.PackageException
        Override 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 validated
        status - Use ValidationStatus.addError(String) or ValidationStatus.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:
        validate in interface org.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:
        run in interface org.nuxeo.connect.update.task.Command
        Throws:
        org.nuxeo.connect.update.PackageException
      • getId

        public String getId()
        Specified by:
        getId in interface org.nuxeo.connect.update.task.Command
      • setFail

        public void setFail​(String fail)
      • setIgnore

        public void setIgnore​(String ignore)
      • ignore

        public boolean ignore()
                       throws org.nuxeo.connect.update.PackageException
        Throws:
        org.nuxeo.connect.update.PackageException
      • initialize

        public void initialize​(Element element)
                        throws org.nuxeo.connect.update.PackageException
        Specified by:
        initialize in interface org.nuxeo.connect.update.task.Command
        Throws:
        org.nuxeo.connect.update.PackageException
      • readFrom

        public abstract void readFrom​(Element element)
                               throws org.nuxeo.connect.update.PackageException
        Must be implemented to initialize the command arguments from an XML fragment.
        Throws:
        org.nuxeo.connect.update.PackageException