com.pmease.quickbuild.stepsupport
Class Step

java.lang.Object
  extended by com.pmease.quickbuild.extensionpoint.support.TypeInstance
      extended by com.pmease.quickbuild.stepsupport.Step
All Implemented Interfaces:
Validatable, java.io.Serializable
Direct Known Subclasses:
AbstractPublisher, AggregationRebuildStep, CompositeStep, ConfigurationSyncStep, CopyPromotionsStep, CopyRepositoriesStep, CopyStepsStep, CopyVariablesStep, FailSafeStep, RepositoryStep, StatisticsRebuildStep, WorkspaceCleanupStep

public abstract class Step
extends TypeInstance
implements Validatable

See Also:
Serialized Form

Field Summary
static java.lang.String[] MASTER_EXCLUDED_PROPERTIES
           
static java.lang.String MASTER_NAME
           
 
Constructor Summary
Step()
           
 
Method Summary
 void clearResources()
           
 boolean equals(java.lang.Object other)
           
 void execute()
          Execute this step.
 CompositeStep findParent(java.lang.String name)
          Find parent step of specified name.
static Step fromDOM(Configuration configuration, VersionedDocument dom)
           
 Build getBuild()
           
 java.lang.String getDescription()
           
 java.lang.Long getDuration()
           
 java.lang.String getErrorMessage()
           
 ExecuteCondition getExecuteCondition()
           
 FileTransferOption getInputOption()
          Get input files option.
 java.lang.String getName()
           
 GridNode getNode()
           
 java.lang.String getNodeAddress()
           
 java.lang.String getNodeLaunchId()
           
 NodeMatcher getNodeMatcher()
           
 NodePreference getNodePreference()
           
 FileTransferOption getOutputOption()
          Get output files option.
 java.lang.String getParam(java.lang.String paramName)
           
 CompositeStep getParent()
           
 StepPath getPath()
           
 ExecuteAction getPostExecuteAction()
           
 ExecuteAction getPreExecuteAction()
           
 Step getPreviousExecutedSibling()
           
 Step getPreviousSibling()
           
 java.util.List<Repetition> getRepetitions()
           
 java.lang.Object getResource(java.lang.String name)
           
 java.lang.Object getResource(java.lang.String name, java.lang.Object defaultResource)
           
 java.util.Map<java.lang.String,java.lang.Integer> getResources()
           
 StepRuntime getRuntime()
           
 StepRuntime.Status getStatus()
           
 java.lang.String getType()
           
 java.lang.Long getWaitDuration()
           
 int hashCode()
           
 boolean isEnabled()
           
 boolean isFailed()
           
 boolean isFinished()
           
 boolean isIdle()
           
 boolean isMaster()
           
 boolean isRunning()
           
 boolean isSuccessful()
           
 boolean isWaiting()
           
 boolean matches(GridNode node)
           
 void removeResource(java.lang.String name)
           
 org.apache.wicket.Component renderCustomRuntimeData(java.lang.String panelId, java.lang.Object customRuntimeData)
          Render custom runtime data in step status graph.
 java.lang.String renderLogAsHtml(BuildLogEntry logEntry, boolean showStep)
          Render specified log entry as html with specified line separator.
 java.lang.String renderLogAsText(BuildLogEntry logEntry, java.lang.String lineSeparator, boolean showStep)
          Render specified log entry as text with specified line separator.
abstract  void run()
           
 void setBuild(Build build)
           
 void setDescription(java.lang.String description)
           
 void setDuration(java.lang.Long duration)
           
 void setEnabled(boolean enabled)
           
 void setErrorMessage(java.lang.String errorMessage)
           
 void setExecuteCondition(ExecuteCondition executeCondition)
           
 void setInputOption(FileTransferOption inputOption)
           
protected  void setJob(StepAwareJob job)
           
 void setName(java.lang.String name)
           
 void setNode(GridNode node)
           
 void setNodeLaunchId(java.lang.String nodeLaunchId)
           
 void setNodeMatcher(NodeMatcher nodeMatcher)
           
 void setNodePreference(NodePreference nodePreference)
           
 void setOutputOption(FileTransferOption outputOption)
           
 void setPath(StepPath path)
           
 void setPostExecuteAction(ExecuteAction postExecuteAction)
           
 void setPreExecuteAction(ExecuteAction preExecuteAction)
           
 void setRepetitions(java.util.List<Repetition> repetitions)
           
 void setResource(java.lang.String name, java.lang.Object resource)
           
 void setResources(java.util.Map<java.lang.String,java.lang.Integer> resources)
           
 void setStatus(StepRuntime.Status status)
           
 void setWaitDuration(java.lang.Long waitDuration)
           
 boolean shouldExecute()
           
 java.lang.String toString()
           
 void validate(java.util.Set<java.lang.String> properties, ErrorContext errorContext)
           
 
Methods inherited from class com.pmease.quickbuild.extensionpoint.support.TypeInstance
getPlugin
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MASTER_NAME

public static final java.lang.String MASTER_NAME
See Also:
Constant Field Values

MASTER_EXCLUDED_PROPERTIES

public static java.lang.String[] MASTER_EXCLUDED_PROPERTIES
Constructor Detail

Step

public Step()
Method Detail

run

public abstract void run()

renderLogAsText

public java.lang.String renderLogAsText(BuildLogEntry logEntry,
                                        java.lang.String lineSeparator,
                                        boolean showStep)
Render specified log entry as text with specified line separator.

Parameters:
logEntry -
lineSeparator -
Returns:

renderLogAsHtml

public java.lang.String renderLogAsHtml(BuildLogEntry logEntry,
                                        boolean showStep)
Render specified log entry as html with specified line separator.

Parameters:
logEntry -
Returns:

getName

@NotEmpty
public java.lang.String getName()
Get name of the step.


setName

public void setName(java.lang.String name)

getType

public java.lang.String getType()

getDescription

public java.lang.String getDescription()
Get description of the step.


setDescription

public void setDescription(java.lang.String description)

isEnabled

public boolean isEnabled()
Whether or not this step is enabled.


setEnabled

public void setEnabled(boolean enabled)

getExecuteCondition

@NotNull
public ExecuteCondition getExecuteCondition()

setExecuteCondition

public void setExecuteCondition(ExecuteCondition executeCondition)

getNodeMatcher

@NotNull
public NodeMatcher getNodeMatcher()

setNodeMatcher

public void setNodeMatcher(NodeMatcher nodeMatcher)

getNodePreference

@NotNull
public NodePreference getNodePreference()

setNodePreference

public void setNodePreference(NodePreference nodePreference)

getPreExecuteAction

@NotNull
public ExecuteAction getPreExecuteAction()

setPreExecuteAction

public void setPreExecuteAction(ExecuteAction preExecuteAction)

getPostExecuteAction

@NotNull
public ExecuteAction getPostExecuteAction()

setPostExecuteAction

public void setPostExecuteAction(ExecuteAction postExecuteAction)

getRepetitions

public java.util.List<Repetition> getRepetitions()

setRepetitions

public void setRepetitions(java.util.List<Repetition> repetitions)

getInputOption

public FileTransferOption getInputOption()
Get input files option.

Returns:
null if not specified.

setInputOption

public void setInputOption(FileTransferOption inputOption)

getOutputOption

public FileTransferOption getOutputOption()
Get output files option.

Returns:
null if not specified.

setOutputOption

public void setOutputOption(FileTransferOption outputOption)

getParent

public CompositeStep getParent()
Get parent composite step containing this step. Null if this step is not contained in a composite step. This method should only be called from background build thread.


isMaster

public boolean isMaster()
Is this step the master step?


getPreviousSibling

public Step getPreviousSibling()
Get the step defined before this step if this step is contained in a sequential step. Null if this is the first step or if it is contained in a parallel composite step.


getPreviousExecutedSibling

public Step getPreviousExecutedSibling()
Get the step executed before this step if this step is contained in a sequential step. Null if there is no executed step before this step or if this step is contained in a parallel composition step.


getStatus

public StepRuntime.Status getStatus()
Get status of this step.


setStatus

public void setStatus(StepRuntime.Status status)

getDuration

public java.lang.Long getDuration()
Get duration of this step in milliseconds. Null if unknown.


setDuration

public void setDuration(java.lang.Long duration)

getWaitDuration

public java.lang.Long getWaitDuration()
Get wait duration of this step in milliseconds. Null if unknown.


setWaitDuration

public void setWaitDuration(java.lang.Long waitDuration)

getErrorMessage

public java.lang.String getErrorMessage()
Get error message of this step. Null if no error.


setErrorMessage

public void setErrorMessage(java.lang.String errorMessage)

isSuccessful

public boolean isSuccessful()
Whether or not this step is successful.


isFailed

public boolean isFailed()
Whether or not this step is failed.


isIdle

public boolean isIdle()
Whether or not this step is idle.


isRunning

public boolean isRunning()
Whether or not this step is running.


isFinished

public boolean isFinished()
Whether or not this step is finished.


isWaiting

public boolean isWaiting()
Whetheror not this step is waiting.


execute

public final void execute()
Execute this step.


findParent

public CompositeStep findParent(java.lang.String name)
Find parent step of specified name.

Parameters:
name -
Returns:
null if not found.

validate

public void validate(java.util.Set<java.lang.String> properties,
                     ErrorContext errorContext)
Specified by:
validate in interface Validatable

getNode

public GridNode getNode()
Get the node running current step. Null if the step is not allocated to a node.


setNode

public void setNode(GridNode node)

getNodeAddress

public java.lang.String getNodeAddress()
Get address of the node running this step.


getResources

public java.util.Map<java.lang.String,java.lang.Integer> getResources()
Get resources allocated to this step.


setResources

public void setResources(java.util.Map<java.lang.String,java.lang.Integer> resources)

setJob

protected void setJob(StepAwareJob job)

getRuntime

public StepRuntime getRuntime()

getPath

public StepPath getPath()
Get path of this step.


setPath

public void setPath(StepPath path)

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

fromDOM

public static Step fromDOM(Configuration configuration,
                           VersionedDocument dom)

getResource

public java.lang.Object getResource(java.lang.String name)
Get step resource of specified name. Null will returned if resource of the name is not found.


setResource

public void setResource(java.lang.String name,
                        java.lang.Object resource)
Set step resource. The first param represents name of the resource, and the second param represents the resource itself.


getResource

public java.lang.Object getResource(java.lang.String name,
                                    java.lang.Object defaultResource)
Get step resource of specified name (the first param). If resource is not found, the specified default resource (the second param) will be associated with the name.


removeResource

public void removeResource(java.lang.String name)
Remove specified step resource.


clearResources

public void clearResources()
Clear all step resources.


shouldExecute

public boolean shouldExecute()

matches

public boolean matches(GridNode node)

getParam

public java.lang.String getParam(java.lang.String paramName)
Get value of specified parameter for current iteration. Null if not found.


renderCustomRuntimeData

public org.apache.wicket.Component renderCustomRuntimeData(java.lang.String panelId,
                                                           java.lang.Object customRuntimeData)
Render custom runtime data in step status graph.

Parameters:
customRuntimeData - not null
Returns:
null if nothing to render

toString

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

getBuild

public Build getBuild()
Get build object associated with this step. Return null if no build is associated.


setBuild

public void setBuild(Build build)

getNodeLaunchId

public java.lang.String getNodeLaunchId()

setNodeLaunchId

public void setNodeLaunchId(java.lang.String nodeLaunchId)


Copyright © 2005-2010 PMEase Inc. All Rights Reserved.