|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.connect.update.impl.task.AbstractCommand
public abstract class AbstractCommand
All commands have 2 attributes: fail and ignore which are EL expressions.
If ignore is defined and evaluated to true then the command will be ignored (null is returned as the inverse command) If fail is defined and evaluated to true then the validation fails.
Commands extending this class must implement the doRun(org.nuxeo.connect.update.task.Task, java.util.Map
and
doValidate(org.nuxeo.connect.update.task.Task, org.nuxeo.connect.update.ValidationStatus)
methods instead of the one in the
interface. These methods are first testing for ignore and fail guards and
then if needed delegated to the doXXX method versions.
Method Summary | |
---|---|
String |
getId()
The command id |
boolean |
ignore()
|
void |
initialize(Element element)
Initialize a command parameters from a DOM element. |
boolean |
isPostInstall()
Test if the command must be run at the end in an installation process. |
abstract void |
readFrom(Element element)
Must be implemented to initialize the command arguments from an XML fragment. |
Command |
run(org.nuxeo.connect.update.task.Task task,
Map<String,String> prefs)
Execute the command and return the inverse command that can be used to rollback. |
void |
setFail(String fail)
|
void |
setIgnore(String ignore)
|
void |
validate(org.nuxeo.connect.update.task.Task task,
org.nuxeo.connect.update.ValidationStatus status)
Validate if the command can be safely executed on the running platform. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.nuxeo.connect.update.impl.task.Command |
---|
writeTo |
Method Detail |
---|
public boolean isPostInstall()
Command
PostInstallCommand
.
isPostInstall
in interface Command
public void validate(org.nuxeo.connect.update.task.Task task, org.nuxeo.connect.update.ValidationStatus status) throws org.nuxeo.connect.update.PackageException
Command
validate
in interface Command
org.nuxeo.connect.update.PackageException
public Command run(org.nuxeo.connect.update.task.Task task, Map<String,String> prefs) throws org.nuxeo.connect.update.PackageException
Command
run
in interface Command
org.nuxeo.connect.update.PackageException
public String getId()
Command
getId
in interface Command
public void setFail(String fail)
public void setIgnore(String ignore)
public boolean ignore() throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
public void initialize(Element element) throws org.nuxeo.connect.update.PackageException
Command
initialize
in interface Command
org.nuxeo.connect.update.PackageException
public abstract void readFrom(Element element) throws org.nuxeo.connect.update.PackageException
org.nuxeo.connect.update.PackageException
|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |