java.lang.Object
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.task.Command
Direct Known Subclasses:
DatabaseCommand, WriteDtdToFileCommand

public abstract class Command extends Object
Base class for commands that work with a model.
Version:
$Revision: 289996 $
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.apache.commons.logging.Log
    The log.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    Executes this command.
    protected void
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _log

      protected final org.apache.commons.logging.Log _log
      The 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 is true.
      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

      protected void handleException(Exception ex, String msg) throws org.apache.tools.ant.BuildException
      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 exception
      msg - 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 in execute(DatabaseTaskBase, Database) cannot be null.
      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 task
      model - The database model
      Throws:
      org.apache.tools.ant.BuildException