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

java.lang.Object
  extended by hudson.model.AbstractDescribableImpl<ProjectGridBuilder>
      extended by au.com.centrumsystems.hudson.plugin.buildpipeline.ProjectGridBuilder
          extended by au.com.centrumsystems.hudson.plugin.buildpipeline.DownstreamProjectGridBuilder
All Implemented Interfaces:
hudson.model.Describable<ProjectGridBuilder>

public class DownstreamProjectGridBuilder
extends ProjectGridBuilder

ProjectGridBuilder based on the upstream/downstream relationship.

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class DownstreamProjectGridBuilder.DescriptorImpl
          Descriptor.
 
Constructor Summary
DownstreamProjectGridBuilder(String firstJob)
           
 
Method Summary
 ProjectGrid build(BuildPipelineView owner)
          Builds the grid.
 org.kohsuke.stapler.HttpResponse doBuild(org.kohsuke.stapler.StaplerRequest req, BuildPipelineView owner)
          Called to start a new pipeline instance (normally by triggering some job.)
 String getFirstJob()
           
 hudson.model.AbstractProject<?,?> getFirstJob(BuildPipelineView owner)
          The job that's configured as the head of the pipeline.
 String getFirstJobLink()
           
 boolean hasBuildPermission(BuildPipelineView owner)
          If the grid produced by this builder supports the notion of "starting a new pipeline instance", and if the current user has a permission to do so, then return true.
 void onJobRenamed(BuildPipelineView owner, hudson.model.Item item, String oldName, String newName)
          Called by BuildPipelineView when one of its members are renamed.
 boolean startsWithParameters(BuildPipelineView owner)
          If the first job of the grid produced by this builder has parameters
 
Methods inherited from class au.com.centrumsystems.hudson.plugin.buildpipeline.ProjectGridBuilder
getDescriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DownstreamProjectGridBuilder

@DataBoundConstructor
public DownstreamProjectGridBuilder(String firstJob)
Parameters:
firstJob - Name of the job to lead the piepline.
Method Detail

getFirstJob

public String getFirstJob()

getFirstJobLink

public String getFirstJobLink()

getFirstJob

public hudson.model.AbstractProject<?,?> getFirstJob(BuildPipelineView owner)
The job that's configured as the head of the pipeline.

Parameters:
owner - View that this builder is operating under.
Returns:
possibly null

hasBuildPermission

public boolean hasBuildPermission(BuildPipelineView owner)
Description copied from class: ProjectGridBuilder
If the grid produced by this builder supports the notion of "starting a new pipeline instance", and if the current user has a permission to do so, then return true.

Specified by:
hasBuildPermission in class ProjectGridBuilder
Parameters:
owner - View that this builder is operating under.
Returns:
True if the user has a permission.

startsWithParameters

public boolean startsWithParameters(BuildPipelineView owner)
Description copied from class: ProjectGridBuilder
If the first job of the grid produced by this builder has parameters

Specified by:
startsWithParameters in class ProjectGridBuilder
Parameters:
owner - View that this builder is operating under.
Returns:
True if the first job has parameters.

doBuild

public org.kohsuke.stapler.HttpResponse doBuild(org.kohsuke.stapler.StaplerRequest req,
                                                @AncestorInPath
                                                BuildPipelineView owner)
                                         throws IOException
Description copied from class: ProjectGridBuilder
Called to start a new pipeline instance (normally by triggering some job.)

Specified by:
doBuild in class ProjectGridBuilder
Parameters:
req - Current HTTP request
owner - View that this builder is operating under.
Returns:
The HTTP response.
Throws:
IOException

build

public ProjectGrid build(BuildPipelineView owner)
Description copied from class: ProjectGridBuilder
Builds the grid.

Specified by:
build in class ProjectGridBuilder
Parameters:
owner - The view for which this builder is working. Never null. If the ProjectGridBuilder takes user-supplied job name, this parameter should be used as a context to resolve relative names. See Jenkins.getItem(String, hudson.model.ItemGroup) (where you obtain ItemGroup by View.getOwnerItemGroup().
Returns:
Never null, although the obtained ProjectGrid can be empty.

onJobRenamed

public void onJobRenamed(BuildPipelineView owner,
                         hudson.model.Item item,
                         String oldName,
                         String newName)
                  throws IOException
Description copied from class: ProjectGridBuilder
Called by BuildPipelineView when one of its members are renamed.

Overrides:
onJobRenamed in class ProjectGridBuilder
Parameters:
owner - View that this builder is operating under.
item - Job being renamed.
oldName - Old short name of the job
newName - New short name of the job
Throws:
IOException


Copyright © 2004-2015. All Rights Reserved.