|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthudson.Plugin
hudson.plugins.jobConfigHistory.JobConfigHistory
public class JobConfigHistory
Class supporting global configuration settings, along with methods associated with the plugin itself.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class hudson.Plugin |
|---|
hudson.Plugin.DummyImpl |
| Field Summary | |
|---|---|
static FileFilter |
DELETED_FILTER
A filter to return only those directories of a file listing that represent deleted jobs history directories. |
static FileFilter |
HISTORY_FILTER
A filter to return only those directories of a file listing that represent configuration history directories. |
| Fields inherited from interface hudson.model.Saveable |
|---|
NOOP |
| Constructor Summary | |
|---|---|
JobConfigHistory()
|
|
| Method Summary | |
|---|---|
protected void |
checkForPurgeByQuantity(File itemHistoryRoot)
Checks if we should purge old history entries under the specified root using the maxHistoryEntries value as the criteria, and if required
calls the appropriate method to perform the purge. |
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 |
doCheckMaxHistoryEntries(String value)
Validates the user entry for the maximum number of history items to keep. |
protected File |
getConfigFile(File historyDir)
Returns the configuration data file stored in the specified history directory. |
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. |
protected File |
getHistoryDir(hudson.XmlFile xmlFile)
Returns the configuration history directory for the given configuration file. |
String |
getHistoryRootDir()
|
protected File |
getJobHistoryRootDir()
Returns the File object representing the job history directory, which is for reasons of backwards compatibility either a sibling or child of the configured history root dir. |
String |
getMaxDaysToKeepEntries()
|
String |
getMaxHistoryEntries()
|
boolean |
getSaveItemGroupConfiguration()
|
boolean |
getSaveModuleConfiguration()
|
boolean |
getSaveSystemConfiguration()
|
String |
getShowBuildBadges()
|
boolean |
getSkipDuplicateHistory()
|
protected boolean |
isSaveable(hudson.model.Saveable item,
hudson.XmlFile xmlFile)
Returns true if configuration for this item should be saved, based on the plugin settings, the type of item and the configuration file specified. |
protected void |
setMaxDaysToKeepEntries(String maxDays)
This method is for convenience in testing. |
protected void |
setMaxHistoryEntries(String maxHistoryEntries)
This method is for convenience in testing. |
void |
setSaveSystemConfiguration(boolean bool)
Used for testing only. |
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 |
| Field Detail |
|---|
public static final FileFilter HISTORY_FILTER
public static final FileFilter DELETED_FILTER
| Constructor Detail |
|---|
public JobConfigHistory()
| Method Detail |
|---|
public void start()
throws Exception
start in class hudson.PluginException
public void configure(org.kohsuke.stapler.StaplerRequest req,
net.sf.json.JSONObject formData)
throws IOException,
javax.servlet.ServletException,
hudson.model.Descriptor.FormException
configure in class hudson.PluginIOException
javax.servlet.ServletException
hudson.model.Descriptor.FormExceptionpublic String getHistoryRootDir()
public String getDefaultRootDir()
public String getMaxHistoryEntries()
protected void setMaxHistoryEntries(String maxHistoryEntries)
maxHistoryEntries - The maximum number of history entries to keeppublic String getMaxDaysToKeepEntries()
protected void setMaxDaysToKeepEntries(String maxDays)
maxDays - For how long history entries should be kept (in days)public boolean getSaveSystemConfiguration()
public void setSaveSystemConfiguration(boolean bool)
bool - True if system configuration should be saved.public boolean getSaveItemGroupConfiguration()
public boolean getSkipDuplicateHistory()
public String getExcludePattern()
public String getDefaultExcludePattern()
public boolean getSaveModuleConfiguration()
public String getShowBuildBadges()
public void setShowBuildBadges(String showBadges)
showBadges - Never, always, userWithConfigPermission or adminUser.protected Pattern getExcludeRegexpPattern()
protected File getJobHistoryRootDir()
protected File getConfiguredHistoryRootDir()
protected File getHistoryDir(hudson.XmlFile xmlFile)
xmlFile - The configuration file whose content we are saving.
protected File getConfigFile(File historyDir)
JobConfigHistoryConsts.HISTORY_FILE.
Relies on the assumption that random '.xml' files will not appear in the history directories.
Checks that we are in an actual 'history directory' to prevent use for getting random xml files.
historyDir - The history directory to look under.
protected boolean isSaveable(hudson.model.Saveable item,
hudson.XmlFile xmlFile)
If the item is an instance of AbstractProject or the configuration
file is stored directly in HUDSON_ROOT, it is considered for saving.
If the plugin is configured to skip saving duplicated history, we also evaluate
if this configuration duplicates the previous saved history (if such history exists).
item - The item whose configuration is under consideration.xmlFile - The configuration file for the above item.
protected void checkForPurgeByQuantity(File itemHistoryRoot)
maxHistoryEntries value as the criteria, and if required
calls the appropriate method to perform the purge.
itemHistoryRoot - The directory to consider purging history under.
public hudson.util.FormValidation doCheckMaxHistoryEntries(@QueryParameter
String value)
value - The form input entered by the user.
public hudson.util.FormValidation doCheckMaxDaysToKeepEntries(@QueryParameter
String value)
value - The form input entered by the user.
public hudson.util.FormValidation doCheckExcludePattern(@QueryParameter
String value)
value - The form input entered by the user.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||