au.com.centrumsystems.hudson.plugin.util
Class BuildUtil

java.lang.Object
  extended by au.com.centrumsystems.hudson.plugin.util.BuildUtil

public final class BuildUtil
extends Object

Provides helper methods for #hudson.model.AbstractBuild

Author:
Centrum Systems

Constructor Summary
BuildUtil()
           
 
Method Summary
static hudson.model.Action getAllBuildParametersAction(hudson.model.AbstractBuild<?,?> upstreamBuild, hudson.model.AbstractProject<?,?> downstreamProject)
          Given an Upstream AbstractBuild and a Downstream AbstractProject will retrieve the associated ParametersAction.
static hudson.model.ParametersAction getBuildParametersAction(hudson.model.AbstractBuild<?,?> build)
          Gets the ParametersAction of an AbstractBuild
static hudson.model.AbstractBuild<?,?> getDownstreamBuild(hudson.model.AbstractProject<?,?> downstreamProject, hudson.model.AbstractBuild<?,?> upstreamBuild)
          Gets the next downstream build based on the upstream build and downstream project.
static Map<String,String> getUnsensitiveParameters(hudson.model.AbstractBuild<?,?> build)
          Retrieve build parameters in String format without sensitive parameters (passwords, ...)
static hudson.model.ParametersAction mergeParameters(hudson.model.ParametersAction base, hudson.model.ParametersAction overlay)
          Merges two sets of ParametersAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildUtil

public BuildUtil()
Method Detail

getDownstreamBuild

public static hudson.model.AbstractBuild<?,?> getDownstreamBuild(hudson.model.AbstractProject<?,?> downstreamProject,
                                                                 hudson.model.AbstractBuild<?,?> upstreamBuild)
Gets the next downstream build based on the upstream build and downstream project.

Parameters:
downstreamProject - - The downstream project
upstreamBuild - - The upstream build
Returns:
- The next downstream build based on the upstream build and downstream project, or null if there is no downstream project.

getAllBuildParametersAction

public static hudson.model.Action getAllBuildParametersAction(hudson.model.AbstractBuild<?,?> upstreamBuild,
                                                              hudson.model.AbstractProject<?,?> downstreamProject)
Given an Upstream AbstractBuild and a Downstream AbstractProject will retrieve the associated ParametersAction. This will result in parameters from the upstream build not overriding parameters on the downstream project.

Parameters:
upstreamBuild - - The AbstractBuild
downstreamProject - - The AbstractProject
Returns:
- AbstractBuild's ParametersAction

getBuildParametersAction

public static hudson.model.ParametersAction getBuildParametersAction(hudson.model.AbstractBuild<?,?> build)
Gets the ParametersAction of an AbstractBuild

Parameters:
build - - AbstractBuild
Returns:
- ParametersAction of AbstractBuild

mergeParameters

public static hudson.model.ParametersAction mergeParameters(hudson.model.ParametersAction base,
                                                            hudson.model.ParametersAction overlay)
Merges two sets of ParametersAction

Parameters:
base - ParametersAction set 1
overlay - ParametersAction set 2
Returns:
- Single set of ParametersAction

getUnsensitiveParameters

public static Map<String,String> getUnsensitiveParameters(hudson.model.AbstractBuild<?,?> build)
Retrieve build parameters in String format without sensitive parameters (passwords, ...)

Parameters:
build - the build we retrieve the parameters from
Returns:
a map of parameters names and values


Copyright © 2004-2014. All Rights Reserved.