org.jenkinsci.plugins.periodicreincarnation
Class Utils

java.lang.Object
  extended by org.jenkinsci.plugins.periodicreincarnation.Utils

public class Utils
extends Object

Utility class.

Author:
yboev

Constructor Summary
Utils()
           
 
Method Summary
protected static PeriodicReincarnationGlobalConfiguration.RegEx checkBuild(hudson.model.Run<?,?> build)
          Checks if a certain build matches any of the given regular expressions.
protected static boolean checkBuild(hudson.model.Run<?,?> build, PeriodicReincarnationGlobalConfiguration.RegEx regEx)
          Checks if a certain build matches the given regular expression.
protected static void execAction(hudson.model.Project<?,?> project, String nodeAction, String masterAction)
          Executes script actions for a given project.
protected static boolean qualifyForUnchangedRestart(hudson.model.Project<?,?> project)
          If there were no changes between the last 2 builds of a project and the last build failed but the previous didn't, then this project is being restarted if this unchanged restart option is enabled.
protected static void restart(hudson.model.Project<?,?> project, String cause, PeriodicReincarnationGlobalConfiguration.RegEx regEx)
          Helper method for restarting a project.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

qualifyForUnchangedRestart

protected static boolean qualifyForUnchangedRestart(hudson.model.Project<?,?> project)
If there were no changes between the last 2 builds of a project and the last build failed but the previous didn't, then this project is being restarted if this unchanged restart option is enabled.

Parameters:
project - the project.
Returns:
true if it qualifies, false otherwise.

restart

protected static void restart(hudson.model.Project<?,?> project,
                              String cause,
                              PeriodicReincarnationGlobalConfiguration.RegEx regEx)
Helper method for restarting a project.

Parameters:
project - the project.
cause - the cause for the restart.
regEx - regual expression
Throws:
IOException
InterruptedException

checkBuild

protected static PeriodicReincarnationGlobalConfiguration.RegEx checkBuild(hudson.model.Run<?,?> build)
Checks if a certain build matches any of the given regular expressions.

Parameters:
build - the build.
Returns:
RegEx object if at least one match, null otherwise.

checkBuild

protected static boolean checkBuild(hudson.model.Run<?,?> build,
                                    PeriodicReincarnationGlobalConfiguration.RegEx regEx)
Checks if a certain build matches the given regular expression.

Parameters:
build - the build.
regEx - the regular expression.
Returns:
true means a match, false otherwise.

execAction

protected static void execAction(hudson.model.Project<?,?> project,
                                 String nodeAction,
                                 String masterAction)
                          throws IOException,
                                 InterruptedException
Executes script actions for a given project.

Parameters:
project - the project
config - the configuration
nodeAction - the nodeAction
masterAction - the masterAction
Throws:
IOException
InterruptedException


Copyright © 2004-2013. All Rights Reserved.