hudson.plugins.jobConfigHistory
Class JobConfigHistory

java.lang.Object
  extended by hudson.Plugin
      extended by hudson.plugins.jobConfigHistory.JobConfigHistory
All Implemented Interfaces:
hudson.model.Saveable

public class JobConfigHistory
extends hudson.Plugin

Class supporting global configuration settings, along with methods associated with the plugin itself.

Author:
jborghi

Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.Plugin
hudson.Plugin.DummyImpl
 
Field Summary
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
JobConfigHistory()
           
 
Method Summary
 void configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData)
           
 hudson.util.FormValidation doCheckExcludePattern(String value)
          Validates the user entry for the regular expression of system file names to exclude from saving.
 hudson.util.FormValidation doCheckMaxDaysToKeepEntries(String value)
          Validates the user entry for the maximum number of days to keep history items.
 hudson.util.FormValidation doCheckMaxEntriesPerPage(String value)
          Validates the user entry for the maximum number of history items to show per site.
 hudson.util.FormValidation doCheckMaxHistoryEntries(String value)
          Validates the user entry for the maximum number of history items to keep.
protected  File getConfigFile(File historyDir)
           
protected  File getConfiguredHistoryRootDir()
          Returns the File object representing the configured root history directory.
 String getDefaultExcludePattern()
          Used by the configuration page.
 String getDefaultRootDir()
           
 String getExcludePattern()
           
protected  Pattern getExcludeRegexpPattern()
          Used for testing to verify invalid pattern not loaded.
 String getHistoryRootDir()
           
 String getMaxDaysToKeepEntries()
           
 String getMaxEntriesPerPage()
           
 String getMaxHistoryEntries()
           
 boolean getSaveItemGroupConfiguration()
          Deprecated. since version 2.9
 boolean getSaveModuleConfiguration()
           
 String getShowBuildBadges()
           
 boolean getSkipDuplicateHistory()
           
protected  void setMaxEntriesPerPage(String maxEntryInput)
          Set the maximum number of history entries to show per site.
protected  void setMaxHistoryEntries(String maxEntryInput)
          Set the maximum number of history entries per item.
 void setShowBuildBadges(String showBadges)
          Used for testing only.
 void start()
           
 
Methods inherited from class hudson.Plugin
configure, doDynamic, getConfigXml, getWrapper, load, postInitialize, save, setServletContext, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobConfigHistory

public JobConfigHistory()
Method Detail

start

public void start()
           throws Exception
Overrides:
start in class hudson.Plugin
Throws:
Exception

configure

public void configure(org.kohsuke.stapler.StaplerRequest req,
                      net.sf.json.JSONObject formData)
               throws IOException,
                      javax.servlet.ServletException,
                      hudson.model.Descriptor.FormException
Overrides:
configure in class hudson.Plugin
Throws:
IOException
javax.servlet.ServletException
hudson.model.Descriptor.FormException

getHistoryRootDir

public String getHistoryRootDir()
Returns:
The configured history root directory.

getDefaultRootDir

public String getDefaultRootDir()
Returns:
The default history root directory.

getMaxHistoryEntries

public String getMaxHistoryEntries()
Returns:
The maximum number of history entries to keep.

setMaxHistoryEntries

protected void setMaxHistoryEntries(String maxEntryInput)
Set the maximum number of history entries per item.

Parameters:
maxEntryInput - The maximum number of history entries to keep

getMaxEntriesPerPage

public String getMaxEntriesPerPage()
Returns:
The maximum number of history entries to show per site.

setMaxEntriesPerPage

protected void setMaxEntriesPerPage(String maxEntryInput)
Set the maximum number of history entries to show per site.

Parameters:
maxEntryInput - The maximum number of history entries to show per site

getMaxDaysToKeepEntries

public String getMaxDaysToKeepEntries()
Returns:
The maximum number of days to keep history entries.

getSaveItemGroupConfiguration

@Deprecated
public boolean getSaveItemGroupConfiguration()
Deprecated. since version 2.9

Returns:
True if item group configurations should be saved.

getSkipDuplicateHistory

public boolean getSkipDuplicateHistory()
Returns:
true if we should skip saving history that duplicates the prior saved configuration.

getExcludePattern

public String getExcludePattern()
Returns:
The regular expression for 'system' file names to exclude from saving.

getDefaultExcludePattern

public String getDefaultExcludePattern()
Used by the configuration page.

Returns:
The default regular expression for 'system' file names to exclude from saving.

getSaveModuleConfiguration

public boolean getSaveModuleConfiguration()
Returns:
true if we should save 'system' configurations.

getShowBuildBadges

public String getShowBuildBadges()
Returns:
Whether build badges should appear always, never or only for users with config rights.

setShowBuildBadges

public void setShowBuildBadges(String showBadges)
Used for testing only.

Parameters:
showBadges - Never, always, userWithConfigPermission or adminUser.

getExcludeRegexpPattern

protected Pattern getExcludeRegexpPattern()
Used for testing to verify invalid pattern not loaded.

Returns:
The loaded regexp pattern, or null if pattern was invalid.

getConfiguredHistoryRootDir

protected File getConfiguredHistoryRootDir()
Returns the File object representing the configured root history directory.

Returns:
The configured root history File object.

getConfigFile

protected File getConfigFile(File historyDir)
Parameters:
historyDir - The history directory to look under.
Returns:
The configuration file or null if no file is found.
See Also:
FileHistoryDao.getConfigFile(java.io.File).

doCheckMaxHistoryEntries

public hudson.util.FormValidation doCheckMaxHistoryEntries(@QueryParameter
                                                           String value)
Validates the user entry for the maximum number of history items to keep. Must be blank or a non-negative integer.

Parameters:
value - The form input entered by the user.
Returns:
ok if the entry is blank or a non-negative integer.

doCheckMaxEntriesPerPage

public hudson.util.FormValidation doCheckMaxEntriesPerPage(@QueryParameter
                                                           String value)
Validates the user entry for the maximum number of history items to show per site. Must be blank or a non-negative integer.

Parameters:
value - The form input entered by the user.
Returns:
ok if the entry is blank or a non-negative integer.

doCheckMaxDaysToKeepEntries

public hudson.util.FormValidation doCheckMaxDaysToKeepEntries(@QueryParameter
                                                              String value)
Validates the user entry for the maximum number of days to keep history items. Must be blank or a non-negative integer.

Parameters:
value - The form input entered by the user.
Returns:
ok if the entry is blank or a non-negative integer.

doCheckExcludePattern

public hudson.util.FormValidation doCheckExcludePattern(@QueryParameter
                                                        String value)
Validates the user entry for the regular expression of system file names to exclude from saving.

Parameters:
value - The form input entered by the user.
Returns:
ok if the entry is a valid regular expression.


Copyright © 2004–2014. All rights reserved.