Class Command
java.lang.Object
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.task.Command
- Direct Known Subclasses:
DatabaseCommand
,WriteDtdToFileCommand
Base class for commands that work with a model.
- Version:
- $Revision: 289996 $
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
execute
(DatabaseTaskBase task, Database model) Executes this command.protected void
handleException
(Exception ex, String msg) Handles the given exception according to the fail-on-error setting by either re-throwing it (wrapped in a build exception) or only logging it.boolean
Determines whether the command execution will be stopped upon an error.abstract boolean
Specifies whether this command requires a model, i.e.void
setFailOnError
(boolean failOnError) Specifies whether the execution shall stop if an error has occurred during the task runs.
-
Field Details
-
_log
protected final org.apache.commons.logging.Log _logThe log.
-
-
Constructor Details
-
Command
public Command()
-
-
Method Details
-
isFailOnError
public boolean isFailOnError()Determines whether the command execution will be stopped upon an error. Default value istrue
.- Returns:
true
if the execution stops in case of an error
-
setFailOnError
public void setFailOnError(boolean failOnError) Specifies whether the execution shall stop if an error has occurred during the task runs.- Parameters:
failOnError
-true
if the execution shall stop in case of an error
-
handleException
Handles the given exception according to the fail-on-error setting by either re-throwing it (wrapped in a build exception) or only logging it.- Parameters:
ex
- The exceptionmsg
- The message to use unless this the exception is rethrown and it is already a build exception- Throws:
org.apache.tools.ant.BuildException
-
isRequiringModel
public abstract boolean isRequiringModel()Specifies whether this command requires a model, i.e. whether the second argument inexecute(DatabaseTaskBase, Database)
cannot benull
.- Returns:
true
if this command requires a model
-
execute
public abstract void execute(DatabaseTaskBase task, Database model) throws org.apache.tools.ant.BuildException Executes this command.- Parameters:
task
- The executing taskmodel
- The database model- Throws:
org.apache.tools.ant.BuildException
-