com.buildforge.services.client.dbo
Class Result

java.lang.Object
  extended by com.buildforge.services.client.dbo.Result

public class Result
extends java.lang.Object

This class represents the runtime result of an executed Step of a Project. In general, only the Build Forge engine creates these objects.


Field Summary
static java.lang.Class<Result> CLASS
           
 
Constructor Summary
Result(APIClientConnection conn)
          In the general course of events, only the Build Forge engine will call this,and not standard API clients.
 
Method Summary
static java.util.List<Result> findByBuild(APIClientConnection conn, int buildId)
          Retrieves all Results by Build.
static java.util.List<Result> findByBuild(APIClientConnection conn, int buildId, boolean getCmd, boolean getEnv)
          Retrieves all Results
 boolean getAbsolute()
          Returns whether the Step's path was relative to the Server's path (true) or to the Project's (false).
 boolean getBroadcast()
          Returns true if a server was a member of a pool, and the step was broadcast to all of the servers in the pool.
 int getBuildId()
          Returns the identifer of the build
 int getCaller()
          This returns the same value as getOwner() if this step was inlined by a threaded step, and 0 otherwise.
 int getChainedBuildId()
          Returns the build id of the chain that was launched according to the step's pass or fail state.
 int getChainId()
          Returns the Project identifier that was chained inline from this step's execution, or 0 if no Project was assigned as an inline chain.
 java.lang.String getCommandText()
          Returns the literal text of the command that was executed
 java.lang.String getDescription()
          Returns the name of the Step whose Result this is
 java.lang.String getDirectory()
          Returns the working directory used by this step
 int getDuration()
          Returns the elapsed time of Step execution, in seconds
 int getEnvironmentGroupId()
          Returns the identifier of the Environment used during this Step's execution
 java.lang.String getEnvironmentText()
          Returns the literal environment used for Step execution.
 int getFailChainId()
          Returns the identifier of the Project to chain execution to if this step fails.
 java.lang.String getFailNotify()
          Returns the name of the notification group to notify in the case of failure
 boolean getFailWait()
          Returns whether or not execution should wait for the fail chain to complete before continuing
 int getFilterSetId()
          Returns the identifier of the Filter used in association with this Step's execution
 int getFinish()
          Returns the timestamp of when execution completed, in seconds since epoch
 ResultDBO.StepFlag getFlag()
          Returns the step control flag used for pausing, cancelling, etc.
 ResultDBO.Floating getFloating()
          Returns the floating status flag used in conjunction with project stickiness
 int getLevel()
          Returns the security level associated with this Result
 java.util.List<Log> getLogs()
          Returns the log output generated by the this execution
 StepDBO.OnFail getOnFail()
          Returns whether this Step was step to stop or continue on failure
 int getOriginalStepId()
          Returns the identifer of the Step that was the original Step definition within its project.
 int getOwner()
          Used by inline chains.
 int getPassChainId()
          Returns the identifier of the Project to chain execution to if this step succeeds.
 java.lang.String getPassNotify()
          Returns the name of the notification group to notify in the case of success
 boolean getPassWait()
          Returns whether or not execution should wait for the pass chain to complete before continuing
 int getProjectId()
          Returns the identifier of the Project to which this Result is associated
 java.lang.String getResource()
          Initially, this is set from the Step's resource field.
 ResultDBO.StepResult getResult()
          Returns the final outcome of execution: pass, fail, warn, etc.
 int getResultStepId()
          The build-wide, unique, and ordinal identifer for this Result.
 java.lang.String getServer()
          Returns the name of the Server that was finally chosen to execute the step on.
 int getStartTimestamp()
          Returns the timestamp of the beginning of execution in seconds since the epoch
 StepDBO.Threaded getThreaded()
          Returns how, if at all, this Result was parallelized during execution
 int getTimeout()
          Return the amount of time, in seconds, that was allowed for execution before forcible termination.
 java.lang.String getUid()
          The system-wide unique identifier for this Result
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS

public static final java.lang.Class<Result> CLASS
Constructor Detail

Result

public Result(APIClientConnection conn)
In the general course of events, only the Build Forge engine will call this,and not standard API clients.

Parameters:
conn -
Method Detail

findByBuild

public static java.util.List<Result> findByBuild(APIClientConnection conn,
                                                 int buildId)
                                          throws java.io.IOException,
                                                 ServiceException
Retrieves all Results by Build. The returns Result objects will have their command text populated, but not their environments. See findByBuild(APIClientConnection, int, boolean, boolean) to override these defaults.

Parameters:
conn -
buildId - The build identifier
Returns:
Throws:
java.io.IOException
ServiceException

findByBuild

public static java.util.List<Result> findByBuild(APIClientConnection conn,
                                                 int buildId,
                                                 boolean getCmd,
                                                 boolean getEnv)
                                          throws java.io.IOException,
                                                 ServiceException
Retrieves all Results

Parameters:
conn -
buildId - The build identifier
getCmd - Whether or not to also return the command text
getEnv - Whether or not to also return the contents of the environment
Returns:
Throws:
java.io.IOException
ServiceException

getAbsolute

public boolean getAbsolute()
Returns whether the Step's path was relative to the Server's path (true) or to the Project's (false).


getBroadcast

public boolean getBroadcast()
Returns true if a server was a member of a pool, and the step was broadcast to all of the servers in the pool. This is accomplished by creating a results record for this step for each server in the pool as if they had been explicitly specified as steps in the original project. The 'real' step identifier may be retrieved via getOriginalStepId().


getBuildId

public int getBuildId()
Returns the identifer of the build


getCaller

public int getCaller()
This returns the same value as getOwner() if this step was inlined by a threaded step, and 0 otherwise. It is needed for the proper implementation of threadblocks in combination with inlined projects.


getChainedBuildId

public int getChainedBuildId()
Returns the build id of the chain that was launched according to the step's pass or fail state. When a step completes, its final status is evaluated as either passing (for ResultDBO.StepResult.PASSED or ResultDBO.StepResult.FILTWARN) or failing (for ResultDBO.StepResult.FAILED or ResultDBO.StepResult.FAILWARN). Accordingly, either the Pass Chain Identifier or the Fail Chain Identifier is checked as appropriate for a valid Project identifier. If one is found, then a build of that project is started, and its build id is stored in this field. The value is negated for fail chains.


getChainId

public int getChainId()
Returns the Project identifier that was chained inline from this step's execution, or 0 if no Project was assigned as an inline chain.


getCommandText

public java.lang.String getCommandText()
Returns the literal text of the command that was executed


getDescription

public java.lang.String getDescription()
Returns the name of the Step whose Result this is


getDirectory

public java.lang.String getDirectory()
Returns the working directory used by this step


getDuration

public int getDuration()
Returns the elapsed time of Step execution, in seconds


getEnvironmentGroupId

public int getEnvironmentGroupId()
Returns the identifier of the Environment used during this Step's execution


getEnvironmentText

public java.lang.String getEnvironmentText()
Returns the literal environment used for Step execution. This field may or may not be populated, depending on how this Result was loaded. See findByBuild(APIClientConnection, int, boolean, boolean)


getFailChainId

public int getFailChainId()
Returns the identifier of the Project to chain execution to if this step fails.


getFailNotify

public java.lang.String getFailNotify()
Returns the name of the notification group to notify in the case of failure


getFailWait

public boolean getFailWait()
Returns whether or not execution should wait for the fail chain to complete before continuing


getFilterSetId

public int getFilterSetId()
Returns the identifier of the Filter used in association with this Step's execution


getFinish

public int getFinish()
Returns the timestamp of when execution completed, in seconds since epoch


getFlag

public ResultDBO.StepFlag getFlag()
Returns the step control flag used for pausing, cancelling, etc. a Step.


getFloating

public ResultDBO.Floating getFloating()
Returns the floating status flag used in conjunction with project stickiness


getLevel

public int getLevel()
Returns the security level associated with this Result


getLogs

public java.util.List<Log> getLogs()
                            throws java.io.IOException,
                                   ServiceException
Returns the log output generated by the this execution

Throws:
java.io.IOException
ServiceException

getOnFail

public StepDBO.OnFail getOnFail()
Returns whether this Step was step to stop or continue on failure


getOriginalStepId

public int getOriginalStepId()
Returns the identifer of the Step that was the original Step definition within its project. For .load-generated steps, this is set to 0.


getOwner

public int getOwner()
Used by inline chains. This returns the Step identifier of the Result that inlined this step, or 0 if that's not how this Result came to exist.


getPassChainId

public int getPassChainId()
Returns the identifier of the Project to chain execution to if this step succeeds.


getPassNotify

public java.lang.String getPassNotify()
Returns the name of the notification group to notify in the case of success


getPassWait

public boolean getPassWait()
Returns whether or not execution should wait for the pass chain to complete before continuing


getProjectId

public int getProjectId()
Returns the identifier of the Project to which this Result is associated


getResource

public java.lang.String getResource()
Initially, this is set from the Step's resource field. This is the workspace for selecting the server on which to run the step. It is originally blank unless the Step has a Server explicitly specified for it. This also affects the value of getFloating(), the workspace for the implementation of the sticky flag, as a Server that is explicitly specified will not be changed. However, if this specifies a Server for which pooling is active, then the Step may be run on any Server in that pool.


getResult

public ResultDBO.StepResult getResult()
Returns the final outcome of execution: pass, fail, warn, etc.


getResultStepId

public int getResultStepId()
The build-wide, unique, and ordinal identifer for this Result. This reflects the true ordering of the steps (except, of course, within a thread block, for which the step ordering is indeterminate).


getServer

public java.lang.String getServer()
Returns the name of the Server that was finally chosen to execute the step on. It is also the workspace for things like the sticky flag and .bset server that try to change the server at build time.


getStartTimestamp

public int getStartTimestamp()
Returns the timestamp of the beginning of execution in seconds since the epoch


getThreaded

public StepDBO.Threaded getThreaded()
Returns how, if at all, this Result was parallelized during execution


getTimeout

public int getTimeout()
Return the amount of time, in seconds, that was allowed for execution before forcible termination.


getUid

public java.lang.String getUid()
The system-wide unique identifier for this Result


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object