org.apache.ojb.broker.ant
Class Command

java.lang.Object
  extended by org.apache.ojb.broker.ant.Command
Direct Known Subclasses:
WriteDataSqlToFileCommand, WriteDataToDatabaseCommand, WriteDtdToFileCommand

public abstract class Command
extends Object

Base class for commands that work with a database and repository model.

Version:
$Revision: 1.1 $
Author:
Thomas Dudziak

Constructor Summary
Command()
           
 
Method Summary
abstract  void execute(org.apache.tools.ant.Task task, org.apache.ddlutils.model.Database dbModel, DescriptorRepository objModel)
          Executes this command.
protected  String getDatabaseType()
          Returns the database type.
protected  org.apache.ddlutils.Platform getPlatform()
          Creates the platform for the configured database.
 boolean isFailOnError()
          Determines whether the command execution will be stopped upon an error.
 void setFailOnError(boolean failOnError)
          Specifies whether the command execution will be stopped upon an error.
protected  void setPlatform(org.apache.ddlutils.Platform platform)
          Sets the platform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Command

public Command()
Method Detail

getDatabaseType

protected String getDatabaseType()
Returns the database type.

Returns:
The database type

setPlatform

protected void setPlatform(org.apache.ddlutils.Platform platform)
Sets the platform.

Parameters:
platform - The platform

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 command execution will be stopped upon an error.

Parameters:
failOnError - true if the execution stops in case of an error

getPlatform

protected org.apache.ddlutils.Platform getPlatform()
                                            throws org.apache.tools.ant.BuildException
Creates the platform for the configured database.

Returns:
The platform
Throws:
org.apache.tools.ant.BuildException

execute

public abstract void execute(org.apache.tools.ant.Task task,
                             org.apache.ddlutils.model.Database dbModel,
                             DescriptorRepository objModel)
                      throws org.apache.tools.ant.BuildException
Executes this command.

Parameters:
task - The executing task
dbModel - The database model
objModel - The object model
Throws:
org.apache.tools.ant.BuildException


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.