org.jenkinsci.plugins
Class ReincarnateFailedJobsConfiguration

java.lang.Object
  extended by hudson.model.Descriptor<jenkins.model.GlobalConfiguration>
      extended by jenkins.model.GlobalConfiguration
          extended by org.jenkinsci.plugins.ReincarnateFailedJobsConfiguration
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<jenkins.model.GlobalConfiguration>, hudson.model.Saveable

@Extension
public class ReincarnateFailedJobsConfiguration
extends jenkins.model.GlobalConfiguration

Implements the interface GlobalConfiguration from Jenkins. Gives the option to configure how this plugin works, what should be restarted, when it should be restarted and what should appear in the log file. With the help of the load() and save() method the configuration is loaded when instancing this class and saved when changing it.

Author:
yboev

Nested Class Summary
static class ReincarnateFailedJobsConfiguration.RegEx
          Class for handling regular expressions.
 
Nested classes/interfaces inherited from class hudson.model.Descriptor
hudson.model.Descriptor.FormException, hudson.model.Descriptor.PropertyType, hudson.model.Descriptor.Self
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from class hudson.model.Descriptor
clazz
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
ReincarnateFailedJobsConfiguration()
          Constructor.
ReincarnateFailedJobsConfiguration(String active, String cronTime, List<ReincarnateFailedJobsConfiguration.RegEx> regExprs, String logInfo, String noChange)
          Constructor.
 
Method Summary
 boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json)
           This method defines what happens when we save to configuration.
 hudson.util.FormValidation doCheckCronTime()
          Check method for the cron time.
static ReincarnateFailedJobsConfiguration get()
          Finds and returns the configuration class.
 String getActive()
          Returns the field active.
 String getCronTime()
          Returns the field cron time.
 String getLogInfo()
          Returns the field logInfo.
 String getNoChange()
          Returns the field noChange.
 List<ReincarnateFailedJobsConfiguration.RegEx> getRegExprs()
          Returns a list containing all regular expressions.
 boolean isActive()
          Tells if the plugin is activated or not.
 boolean isLogInfoEnabled()
          Tells if printing in log is enabled or not.
 boolean isRestartUnchangedJobsEnabled()
          See noChange.
 
Methods inherited from class jenkins.model.GlobalConfiguration
all, getDescriptor, getDisplayName, getGlobalConfigPage
 
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, find, find, getCheckUrl, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReincarnateFailedJobsConfiguration

public ReincarnateFailedJobsConfiguration()
Constructor. Loads the configuration upon invoke.


ReincarnateFailedJobsConfiguration

@DataBoundConstructor
public ReincarnateFailedJobsConfiguration(String active,
                                                               String cronTime,
                                                               List<ReincarnateFailedJobsConfiguration.RegEx> regExprs,
                                                               String logInfo,
                                                               String noChange)
Constructor. DataBound because this constructor is used to populate values entered from the user.

Parameters:
active - shows if plugin is enabled disabled.
cronTime - contains the cron time.
regExprs - list of all regular expressions.
logInfo - shows if log info is enabled
noChange - shows if no change option is enabled or disabled.
Method Detail

configure

public boolean configure(org.kohsuke.stapler.StaplerRequest req,
                         net.sf.json.JSONObject json)
                  throws hudson.model.Descriptor.FormException
This method defines what happens when we save to configuration. All values are taken from the json file and set to the variabled in this class.

Overrides:
configure in class hudson.model.Descriptor<jenkins.model.GlobalConfiguration>
Throws:
hudson.model.Descriptor.FormException

doCheckCronTime

public hudson.util.FormValidation doCheckCronTime()
Check method for the cron time. Returns an error message if the cron time was invalid.

Returns:
Returns ok if cron time was correct, error message otherwise.

get

public static ReincarnateFailedJobsConfiguration get()
Finds and returns the configuration class.

Returns:
the ReincarnateFailedJobsConfiguration.

getNoChange

public String getNoChange()
Returns the field noChange.

Returns:
the field noChange.

isRestartUnchangedJobsEnabled

public boolean isRestartUnchangedJobsEnabled()
See noChange.

Returns:
true if the option is enabled, false otherwise.

getLogInfo

public String getLogInfo()
Returns the field logInfo.

Returns:
logInfo.

isLogInfoEnabled

public boolean isLogInfoEnabled()
Tells if printing in log is enabled or not.

Returns:
true if enabled, false otherwise.

getRegExprs

public List<ReincarnateFailedJobsConfiguration.RegEx> getRegExprs()
Returns a list containing all regular expressions.

Returns:
the list with reg exs.

getCronTime

public String getCronTime()
Returns the field cron time.

Returns:
cronTime.

getActive

public String getActive()
Returns the field active.

Returns:
active.

isActive

public boolean isActive()
Tells if the plugin is activated or not.

Returns:
true if activated, false otherwise.


Copyright © 2004-2012. All Rights Reserved.