org.logicalcobwebs.dbscript
Class Command

java.lang.Object
  extended by org.logicalcobwebs.dbscript.Command
All Implemented Interfaces:
CommandIF

 class Command
extends java.lang.Object
implements CommandIF

An SQL command that isrun by a Script. If load or loops are configured then it might run more than once.

Since:
Proxool 0.5
Version:
$Revision: 1.8 $, $Date: 2003/03/03 11:12:02 $
Author:
Bill Horsman (bill@logicalcobwebs.co.uk), $Author: billhorsman $ (current maintainer)

Field Summary
private  java.lang.String exception
           
protected static java.lang.String EXCEPTION_IGNORE
          If this command encounters an exception it will silently ignore the exception and continue.
protected static java.lang.String EXCEPTION_LOG
          If this command encounters an exception it will log it at DEBUG level and continue
protected static java.lang.String EXCEPTION_STOP
          If this command encounters an exception it will stop executing (and if it is in a loop it will break out of the loop)
private  int load
           
private static Log LOG
           
private  int loops
           
private  java.lang.String name
           
private  java.lang.String sql
           
 
Constructor Summary
Command()
           
 
Method Summary
 int getLoad()
          How many "threads" to simulate.
 int getLoops()
          The number of loops to perform.
 java.lang.String getName()
          A convenient name to call this command to help logging.
 java.lang.String getSql()
          The SQL statement to run
 boolean isIgnoreException()
          If true then errors that occur during this command are ignored silently and do not stop the script running.
 boolean isLogException()
          If true then errors that occur during this command are logged as debug messages but do not stop the script running.
 void setException(java.lang.String exception)
           
protected  void setLoad(int load)
           
protected  void setLoops(int loops)
           
 void setName(java.lang.String name)
           
protected  void setSql(java.lang.String sql)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG

name

private java.lang.String name

sql

private java.lang.String sql

load

private int load

loops

private int loops

exception

private java.lang.String exception

EXCEPTION_STOP

protected static final java.lang.String EXCEPTION_STOP
If this command encounters an exception it will stop executing (and if it is in a loop it will break out of the loop)

See Also:
Constant Field Values

EXCEPTION_LOG

protected static final java.lang.String EXCEPTION_LOG
If this command encounters an exception it will log it at DEBUG level and continue

See Also:
Constant Field Values

EXCEPTION_IGNORE

protected static final java.lang.String EXCEPTION_IGNORE
If this command encounters an exception it will silently ignore the exception and continue. But it still calls the

See Also:
Constant Field Values
Constructor Detail

Command

Command()
Method Detail

getSql

public java.lang.String getSql()
Description copied from interface: CommandIF
The SQL statement to run

Specified by:
getSql in interface CommandIF
Returns:
sql
See Also:
CommandIF.getSql()

setSql

protected void setSql(java.lang.String sql)
See Also:
getSql()

getLoad

public int getLoad()
Description copied from interface: CommandIF
How many "threads" to simulate. See Script to see how it actually implements thread-like behaviour.

Specified by:
getLoad in interface CommandIF
Returns:
load
See Also:
CommandIF.getLoad()

setLoad

protected void setLoad(int load)
See Also:
getLoad()

getLoops

public int getLoops()
Description copied from interface: CommandIF
The number of loops to perform. Each loop will run the sql load times.

Specified by:
getLoops in interface CommandIF
Returns:
loops
See Also:
CommandIF.getLoops()

setLoops

protected void setLoops(int loops)
See Also:
getLoops()

isIgnoreException

public boolean isIgnoreException()
Description copied from interface: CommandIF
If true then errors that occur during this command are ignored silently and do not stop the script running.

Specified by:
isIgnoreException in interface CommandIF
Returns:
true if exceptions should be ignored
See Also:
CommandIF.isIgnoreException()

isLogException

public boolean isLogException()
Description copied from interface: CommandIF
If true then errors that occur during this command are logged as debug messages but do not stop the script running.

Specified by:
isLogException in interface CommandIF
Returns:
true if exceptions should be logged
See Also:
CommandIF.isIgnoreException()

setException

public void setException(java.lang.String exception)
See Also:
isIgnoreException()

getName

public java.lang.String getName()
Description copied from interface: CommandIF
A convenient name to call this command to help logging.

Specified by:
getName in interface CommandIF
Returns:
name
See Also:
CommandIF.getName()

setName

public void setName(java.lang.String name)
See Also:
getName()