au.com.centrumsystems.hudson.plugin.buildpipeline
Class PipelineBuild

java.lang.Object
  extended by au.com.centrumsystems.hudson.plugin.buildpipeline.PipelineBuild

public class PipelineBuild
extends java.lang.Object

Author:
KevinV

Constructor Summary
PipelineBuild()
          Default constructor
PipelineBuild(hudson.model.AbstractBuild<?,?> build, hudson.model.AbstractProject<?,?> project, hudson.model.AbstractBuild<?,?> previousBuild)
          Creates a new PipelineBuild with currentBuild, project and upstreamBuild set.
PipelineBuild(hudson.model.FreeStyleProject project)
           
 
Method Summary
 java.lang.String getBuildDescription()
          Returns the current build description.
 java.lang.String getBuildDuration()
          Returns the current build duration.
 java.lang.String getBuildResultURL()
          Build a URL of the currentBuild
 hudson.model.AbstractBuild<?,?> getCurrentBuild()
           
 java.lang.String getCurrentBuildNumber()
          Returns the current build number.
 java.lang.String getCurrentBuildResult()
          Determines the result of the current build.
 java.util.List<PipelineBuild> getDownstreamPipeline()
          Constructs a List of downstream PipelineBuild objects that make up the current pipeline.
 hudson.model.AbstractProject<?,?> getProject()
          Returns the project name.
 java.lang.String getProjectURL()
          Builds a URL of the current project
 java.lang.String getScmRevision()
          Get the SCM revision no of a particular currentBuild
 java.util.Date getStartTime()
          Start time of build
 hudson.model.AbstractBuild<?,?> getUpstreamBuild()
           
 java.lang.String getUpstreamBuildResult()
          Determines the result of the upstream build.
 PipelineBuild getUpstreamPipelineBuild()
          Returns the upstream PipelineBuild object from the current PipelineBuild object.
 boolean hasBuildPermission()
          Checks whether the user has Build permission for the current project.
 boolean isManual()
           
 void setCurrentBuild(hudson.model.AbstractBuild<?,?> currentBuild)
           
 void setProject(hudson.model.AbstractProject<?,?> currentProject)
           
 void setUpstreamBuild(hudson.model.AbstractBuild<?,?> upstreamBuild)
           
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PipelineBuild

public PipelineBuild()
Default constructor


PipelineBuild

public PipelineBuild(hudson.model.AbstractBuild<?,?> build,
                     hudson.model.AbstractProject<?,?> project,
                     hudson.model.AbstractBuild<?,?> previousBuild)
Creates a new PipelineBuild with currentBuild, project and upstreamBuild set.

Parameters:
build - - current build
project - - current project
previousBuild - - upstream build

PipelineBuild

public PipelineBuild(hudson.model.FreeStyleProject project)
Parameters:
project - project
Method Detail

getCurrentBuild

public hudson.model.AbstractBuild<?,?> getCurrentBuild()

setCurrentBuild

public void setCurrentBuild(hudson.model.AbstractBuild<?,?> currentBuild)

getUpstreamBuild

public hudson.model.AbstractBuild<?,?> getUpstreamBuild()

setUpstreamBuild

public void setUpstreamBuild(hudson.model.AbstractBuild<?,?> upstreamBuild)

setProject

public void setProject(hudson.model.AbstractProject<?,?> currentProject)

getProject

public hudson.model.AbstractProject<?,?> getProject()
Returns the project name. If the current project is null the project name is determined using the current build.

Returns:
- Project name

getCurrentBuildNumber

public java.lang.String getCurrentBuildNumber()
Returns the current build number.

Returns:
- Current build number or empty String is the current build is null.

getDownstreamPipeline

public java.util.List<PipelineBuild> getDownstreamPipeline()
Constructs a List of downstream PipelineBuild objects that make up the current pipeline.

Returns:
- List of downstream PipelineBuild objects that make up the current pipeline.

getBuildResultURL

public java.lang.String getBuildResultURL()
Build a URL of the currentBuild

Returns:
URL of the currentBuild

getProjectURL

public java.lang.String getProjectURL()
Builds a URL of the current project

Returns:
URL - of the project

getCurrentBuildResult

public java.lang.String getCurrentBuildResult()
Determines the result of the current build.

Returns:
- String representing the build result
See Also:
getBuildResult(AbstractBuild)

getUpstreamBuildResult

public java.lang.String getUpstreamBuildResult()
Determines the result of the upstream build.

Returns:
- String representing the build result
See Also:
getBuildResult(AbstractBuild)

getUpstreamPipelineBuild

public PipelineBuild getUpstreamPipelineBuild()
Returns the upstream PipelineBuild object from the current PipelineBuild object.

Returns:
- Upstream PipelineBuild object from the current PipelineBuild object

getBuildDuration

public java.lang.String getBuildDuration()
Returns the current build duration.

Returns:
- Current build duration or an empty String if the current build is null.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

getBuildDescription

public java.lang.String getBuildDescription()
Returns the current build description.

Returns:
- Current build description or the project name if the current build is null.

getScmRevision

public java.lang.String getScmRevision()
Get the SCM revision no of a particular currentBuild

Returns:
The revision number of the currentBuild or "No Revision"

hasBuildPermission

public boolean hasBuildPermission()
Checks whether the user has Build permission for the current project.

Returns:
- true: Has Build permission; false: Does not have Build permission
See Also:
Item

isManual

public boolean isManual()

getStartTime

public java.util.Date getStartTime()
Start time of build

Returns:
start time


Copyright © 2011. All Rights Reserved.