net.sourceforge.cruisecontrol.builders
Class ExecBuilder

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.util.PerDayScheduleItem
      extended bynet.sourceforge.cruisecontrol.Builder
          extended bynet.sourceforge.cruisecontrol.builders.ExecBuilder
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class ExecBuilder
extends Builder

Exec builder class. Executes a command line as a builder and determines whether the command was successful or not. A string can be supplied to additionally check for certain error messages in the output

Author:
Kevin Lee
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.cruisecontrol.util.PerDayScheduleItem
INVALID_NAME_OF_DAY, NOT_SET
 
Constructor Summary
ExecBuilder()
           
 
Method Summary
 org.jdom.Element build(java.util.Map buildProperties)
          execute the command and return the results as XML
 org.jdom.Element buildWithTarget(java.util.Map properties, java.lang.String target)
           
 java.lang.String getBuildError()
          Get whether there was n error written to the build log
 java.lang.String getCommand()
          Gets the command to execute.
 void setArgs(java.lang.String args)
          Sets the arguments for the command to execute
 void setCommand(java.lang.String cmd)
          Sets the command to execute
 void setErrorStr(java.lang.String errStr)
          Sets the error string to search for in the command output
 void setTimeout(long timeout)
          Sets build timeout in seconds.
 void setWorkingDir(java.lang.String dir)
          Sets the working directory where the command is to be executed
 void validate()
           
 
Methods inherited from class net.sourceforge.cruisecontrol.Builder
compareTo, getGroup, getMultiple, getTime, isValidDay, setGroup, setMultiple, setTime
 
Methods inherited from class net.sourceforge.cruisecontrol.util.PerDayScheduleItem
getDay, setDay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecBuilder

public ExecBuilder()
Method Detail

validate

public void validate()
              throws CruiseControlException
Overrides:
validate in class Builder
Throws:
CruiseControlException

build

public org.jdom.Element build(java.util.Map buildProperties)
                       throws CruiseControlException
execute the command and return the results as XML

Specified by:
build in class Builder
Throws:
CruiseControlException

buildWithTarget

public org.jdom.Element buildWithTarget(java.util.Map properties,
                                        java.lang.String target)
                                 throws CruiseControlException
Specified by:
buildWithTarget in class Builder
Throws:
CruiseControlException

setTimeout

public void setTimeout(long timeout)
Sets build timeout in seconds.

Parameters:
timeout - long build timeout

setCommand

public void setCommand(java.lang.String cmd)
Sets the command to execute

Parameters:
cmd - the command to execute

getCommand

public java.lang.String getCommand()
Gets the command to execute.

Returns:
the command to execute.

setArgs

public void setArgs(java.lang.String args)
Sets the arguments for the command to execute

Parameters:
args - arguments for the command to execute

setErrorStr

public void setErrorStr(java.lang.String errStr)
Sets the error string to search for in the command output

Parameters:
errStr - the error string to search for in the command output

setWorkingDir

public void setWorkingDir(java.lang.String dir)
Sets the working directory where the command is to be executed

Parameters:
dir - the directory where the command is to be executed

getBuildError

public java.lang.String getBuildError()
Get whether there was n error written to the build log

Returns:
the error string otherwise null