Class PluginImpl
java.lang.Object
hudson.model.Descriptor<GlobalConfiguration>
jenkins.model.GlobalConfiguration
com.sonyericsson.jenkins.plugins.bfa.PluginImpl
- All Implemented Interfaces:
- ExtensionPoint,- Describable<GlobalConfiguration>,- Saveable,- Loadable,- OnMaster
The main thing.
- Author:
- Robert Sandell <robert.sandell@sonyericsson.com>
- 
Nested Class SummaryNested classes/interfaces inherited from class hudson.model.DescriptorDescriptor.FormException, Descriptor.PropertyType, Descriptor.SelfNested classes/interfaces inherited from interface hudson.ExtensionPointExtensionPoint.LegacyInstancesAreScopedToHudson
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringConvenience constant for the default icon size.static final StringDeprecated.plugin now uses icons.static final intDefault max size of log to be scanned ('0' disables check).static final intDefault number of concurrent scan threads.static final StringDefault slack channel to use.static final StringDefault value for which failure categories to notify slack.protected static final intMinimum allowed value fornrOfScanThreads.static final PermissionGroupThe permission group for all permissions related to this plugin.static final PermissionPermission to remove causes.static final PermissionPermission to update the causes.static final PermissionPermission to view the causes.Fields inherited from class hudson.model.Descriptorclazz
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanconfigure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject o) Does the auto completion for categories, matching with any category already present in the knowledge base.Does the auto completion for categories, matching with any category already present in the knowledge base.static StringReturns the default icon to use for this plugin.Get the categories that are considered generic.Fallback categories.static StringgetFullImageUrl(String size, String name) Deprecated.plugin now uses icons.static StringgetImageUrl(String name) Deprecated.plugin now uses icons.static StringgetImageUrl(String size, String name) Deprecated.plugin now uses icons.static PluginImplReturns the singleton instance.The knowledge base containing all causes.getKnowledgeBaseDescriptor(String descString) Gets the KnowledgeBaseDescriptor that matches the name descString.Convenience method to reach the list from jelly.intReturns the maximum log size that should be scanned.Getter for the no causes message.intThe number of threads to have in the pool for each build.Get configured slack channel.Get configured slack failure cause categories.Getter sodVariable.static StringDeprecated.plugin now uses icons.static StringReturns the base relative URI for static resources packaged in webapp.Get categories to be assigned to failure causes representing failed test cases.booleanIf this feature is enabled or not.booleanSend notifications to Gerrit-Trigger-plugin.booleanIf this feature is enabled or not.booleanIf graphs are enabled or not.booleanIf metrics should be squashed to only unique categories per build.booleanWhether to display in the build page when no causes are identified.static booleanisSizeInLimit(Run build) Checks that log size is in limits.booleanSend notifications to Slack.booleanIf failed test cases should be represented as failure causes.static booleanneedToAnalyze(Result result) Checks if the build with certain result should be analyzed or not.protected ObjectvoidsetDoNotAnalyzeAbortedJob(boolean doNotAnalyzeAbortedJob) Sets if this feature is enabled or not.voidsetFallbackCategoriesAsString(String categories) Sets the categories to be considered as generic.voidsetGerritTriggerEnabled(boolean gerritTriggerEnabled) Sets if this feature is enabled or not.voidsetGlobalEnabled(boolean globalEnabled) Sets if this feature is enabled or not.voidsetGraphsEnabled(boolean graphsEnabled) Sets if graphs are enabled.voidsetKnowledgeBase(KnowledgeBase knowledgeBase) Sets the knowledge base.voidsetMaxLogSize(int maxLogSize) Set the maximum log size that should be scanned.voidsetMetricSquashingEnabled(boolean metricSquashingEnabled) Sets if metrics should be squashed to only unique categories per build.voidsetNoCausesEnabled(boolean noCausesEnabled) Sets whether the "no indications found" message should be shown in the job page when no causes are found.voidsetNoCausesMessage(String noCausesMessage) Sets the no causes message.voidsetNrOfScanThreads(int nrOfScanThreads) The number of threads to have in the pool for each build.voidsetSlackChannelName(String slackChannelName) Set configured slack channel.voidsetSlackFailureCategories(String slackFailureCategories) Set configured slack failure cause categories.voidsetSlackNotifEnabled(boolean slackNotifEnabled) Sets if this feature is enabled or not.voidsetSodVariables(ScanOnDemandVariables sodVariables) Sets the scan on demand variables.voidsetTestResultCategories(String testResultCategories) Set categories to be assigned to failure causes representing failed test cases.voidsetTestResultParsingEnabled(boolean testResultParsingEnabled) Sets if failed test cases should be represented as failure causes or not.static booleanshouldScan(Job project) Checks if the specified project should be scanned or not.static booleanshouldScan(Run build) Checks if the specified build should be scanned or not.voidstart()Starts the knowledge base.voidstop()Run on Jenkins shutdown.Methods inherited from class jenkins.model.GlobalConfigurationall, configure, getDescriptor, getGlobalConfigPageMethods inherited from class hudson.model.DescriptoraddHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
- 
Field Details- 
DEFAULT_ICON_SIZEDeprecated.plugin now uses icons.Convenience constant for the 24x24 icon size. used forgetImageUrl(String, String).- See Also:
 
- 
DEFAULT_ICON_NAMEConvenience constant for the default icon size. used forgetDefaultIcon().- See Also:
 
- 
DEFAULT_NR_OF_SCAN_THREADSpublic static final int DEFAULT_NR_OF_SCAN_THREADSDefault number of concurrent scan threads.- See Also:
 
- 
DEFAULT_MAX_LOG_SIZEpublic static final int DEFAULT_MAX_LOG_SIZEDefault max size of log to be scanned ('0' disables check).- See Also:
 
- 
DEFAULT_SLACK_CHANNELDefault slack channel to use.- See Also:
 
- 
DEFAULT_SLACK_FAILURE_CATEGORIESDefault value for which failure categories to notify slack.- See Also:
 
- 
PERMISSION_GROUPThe permission group for all permissions related to this plugin.
- 
UPDATE_PERMISSIONPermission to update the causes. E.e. AccessCauseManagement.
- 
VIEW_PERMISSIONPermission to view the causes. E.e. AccessCauseManagement.
- 
REMOVE_PERMISSIONPermission to remove causes.
- 
MINIMUM_NR_OF_SCAN_THREADSprotected static final int MINIMUM_NR_OF_SCAN_THREADSMinimum allowed value fornrOfScanThreads.- See Also:
 
 
- 
- 
Constructor Details- 
PluginImpl@DataBoundConstructor public PluginImpl()Default constructor.
 
- 
- 
Method Details- 
readResolve
- 
getConfigFile- Overrides:
- getConfigFilein class- Descriptor<GlobalConfiguration>
 
- 
startStarts the knowledge base.
- 
stopRun on Jenkins shutdown.
- 
getStaticResourcesBaseReturns the base relative URI for static resources packaged in webapp.- Returns:
- the base URI.
 
- 
getSodVariablesGetter sodVariable.- Returns:
- the message.
 
- 
getStaticImagesBaseDeprecated.plugin now uses icons.Returns the base relative URI for static images packaged in webapp.- Returns:
- the images directory.
- See Also:
 
- 
getImageUrlDeprecated.plugin now uses icons.Provides a Jenkins relative url to a plugin internal image.- Parameters:
- size- the size of the image (the sub directory of images).
- name- the name of the image file.
- Returns:
- a URL to the image.
 
- 
getFullImageUrlDeprecated.plugin now uses icons.Get the full url to an image, including rootUrl and context path.- Parameters:
- size- the size of the image (the sub directory of images).
- name- the name of the image file.
- Returns:
- a URL to the image.
 
- 
getImageUrlDeprecated.plugin now uses icons.Provides a Jenkins relative url to a plugin internal image ofDEFAULT_ICON_SIZEsize.- Parameters:
- name- the name of the image.
- Returns:
- a URL to the image.
- See Also:
 
- 
getDefaultIconReturns the default icon to use for this plugin.- Returns:
- the default icon.
 
- 
getInstanceReturns the singleton instance.- Returns:
- the one.
 
- 
getNoCausesMessageGetter for the no causes message.- Returns:
- the message.
 
- 
isNoCausesEnabledpublic boolean isNoCausesEnabled()Whether to display in the build page when no causes are identified.- Returns:
- true if on.
 
- 
setNoCausesEnabled@DataBoundSetter public void setNoCausesEnabled(boolean noCausesEnabled) Sets whether the "no indications found" message should be shown in the job page when no causes are found. Default value is true.- Parameters:
- noCausesEnabled- on or off.
 
- 
isGlobalEnabledpublic boolean isGlobalEnabled()If this feature is enabled or not. When on all unsuccessful builds will be scanned. None when off.- Returns:
- true if on.
 
- 
isDoNotAnalyzeAbortedJobpublic boolean isDoNotAnalyzeAbortedJob()If this feature is enabled or not. When on all aborted builds will be ignored.- Returns:
- true if on.
 
- 
isGraphsEnabledpublic boolean isGraphsEnabled()If graphs are enabled or not. Links to graphs and graphs will not be displayed when disabled. It can be enabled only if the knowledgeBase has support for it.- Returns:
- True if enabled.
 
- 
setGraphsEnabled@DataBoundSetter public void setGraphsEnabled(boolean graphsEnabled) Sets if graphs are enabled. Default value is false.- Parameters:
- graphsEnabled- the graph flag
 
- 
setNoCausesMessageSets the no causes message.- Parameters:
- noCausesMessage- the no causes message
 
- 
setKnowledgeBaseSets the knowledge base.- Parameters:
- knowledgeBase- the knowledge base
 
- 
setSodVariablesSets the scan on demand variables.- Parameters:
- sodVariables- the variables
 
- 
setFallbackCategoriesAsStringSets the categories to be considered as generic. Causes with generic categories will only be found if there are no other, non-generic causes.- Parameters:
- categories- The space separated list of generic categories
 
- 
getFallbackCategoriesAsStringFallback categories.- Returns:
- Fallback categories
 
- 
isTestResultParsingEnabledpublic boolean isTestResultParsingEnabled()If failed test cases should be represented as failure causes.- Returns:
- True if enabled.
 
- 
getTestResultCategoriesGet categories to be assigned to failure causes representing failed test cases.- Returns:
- the categories.
 
- 
getFallbackCategoriesGet the categories that are considered generic.- Returns:
- a list of generic categories, never null.
 
- 
isMetricSquashingEnabledpublic boolean isMetricSquashingEnabled()If metrics should be squashed to only unique categories per build.- Returns:
- True if enabled.
 
- 
setDoNotAnalyzeAbortedJob@DataBoundSetter public void setDoNotAnalyzeAbortedJob(boolean doNotAnalyzeAbortedJob) Sets if this feature is enabled or not. When on all aborted builds will be ignored.- Parameters:
- doNotAnalyzeAbortedJob- on or off.
 
- 
setGlobalEnabled@DataBoundSetter public void setGlobalEnabled(boolean globalEnabled) Sets if this feature is enabled or not. When on all unsuccessful builds will be scanned. None when off. Default value is true.- Parameters:
- globalEnabled- on or off.
 
- 
setTestResultParsingEnabled@DataBoundSetter public void setTestResultParsingEnabled(boolean testResultParsingEnabled) Sets if failed test cases should be represented as failure causes or not. Default value is false.- Parameters:
- testResultParsingEnabled- on or off.
 
- 
setTestResultCategoriesSet categories to be assigned to failure causes representing failed test cases.- Parameters:
- testResultCategories- Space-separated string with categories
 
- 
setMetricSquashingEnabled@DataBoundSetter public void setMetricSquashingEnabled(boolean metricSquashingEnabled) Sets if metrics should be squashed to only unique categories per build. Default value is false.- Parameters:
- metricSquashingEnabled- on or off.
 
- 
isGerritTriggerEnabledpublic boolean isGerritTriggerEnabled()Send notifications to Gerrit-Trigger-plugin.- Returns:
- true if on.
 
- 
isSlackNotifEnabledpublic boolean isSlackNotifEnabled()Send notifications to Slack.- Returns:
- true if on.
 
- 
getSlackChannelNameGet configured slack channel.- Returns:
- String - Slack Channel.
 
- 
getSlackFailureCategoriesGet configured slack failure cause categories.- Returns:
- String - Space separated list of failure cause categories.
 
- 
setGerritTriggerEnabled@DataBoundSetter public void setGerritTriggerEnabled(boolean gerritTriggerEnabled) Sets if this feature is enabled or not. When on, cause descriptions will be forwarded to Gerrit-Trigger-Plugin. Default value is true.- Parameters:
- gerritTriggerEnabled- on or off.
 
- 
setSlackNotifEnabled@DataBoundSetter public void setSlackNotifEnabled(boolean slackNotifEnabled) Sets if this feature is enabled or not. When on, selected failures will be sent to Slack channel.- Parameters:
- slackNotifEnabled- on or off. null == off.
 
- 
setSlackChannelNameSet configured slack channel.- Parameters:
- slackChannelName- null = DEFAULT_SLACK_CHANNEL
 
- 
setSlackFailureCategoriesSet configured slack failure cause categories.- Parameters:
- slackFailureCategories- - Space seperated list of failure cause categories.
 
- 
getNrOfScanThreadspublic int getNrOfScanThreads()The number of threads to have in the pool for each build. Used by theBuildFailureScanner. Will return nothing less thanMINIMUM_NR_OF_SCAN_THREADS.- Returns:
- the number of scan threads.
 
- 
setNrOfScanThreads@DataBoundSetter public void setNrOfScanThreads(int nrOfScanThreads) The number of threads to have in the pool for each build. Used by theBuildFailureScanner. Will throw anIllegalArgumentExceptionif the parameter is less thanMINIMUM_NR_OF_SCAN_THREADS.- Parameters:
- nrOfScanThreads- the number of scan threads.
 
- 
setMaxLogSize@DataBoundSetter public void setMaxLogSize(int maxLogSize) Set the maximum log size that should be scanned.- Parameters:
- maxLogSize- value
 
- 
getMaxLogSizepublic int getMaxLogSize()Returns the maximum log size that should be scanned.- Returns:
- value
 
- 
needToAnalyzeChecks if the build with certain result should be analyzed or not.- Parameters:
- result- the result
- Returns:
- true if it should be analyzed.
 
- 
shouldScanChecks if the specified build should be scanned or not.- Parameters:
- build- the build
- Returns:
- true if it should be scanned.
- See Also:
 
- 
isSizeInLimitChecks that log size is in limits.- Parameters:
- build- the build
- Returns:
- true if size is in limit.
 
- 
shouldScanChecks if the specified project should be scanned or not. Determined byisGlobalEnabled()and if the project hasScannerJobProperty.isDoNotScan().- Parameters:
- project- the project
- Returns:
- true if it should be scanned.
 
- 
getKnowledgeBaseThe knowledge base containing all causes.- Returns:
- all the base.
 
- 
getKnowledgeBaseDescriptorsConvenience method to reach the list from jelly.- Returns:
- the list of registered KnowledgeBaseDescriptors
 
- 
getKnowledgeBaseDescriptorGets the KnowledgeBaseDescriptor that matches the name descString.- Parameters:
- descString- either name of a KnowledgeBaseDescriptor or the fully qualified name.
- Returns:
- The matching KnowledgeBaseDescriptor or null if none is found.
 
- 
configurepublic boolean configure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject o) - Overrides:
- configurein class- GlobalConfiguration
 
- 
getCategoryAutoCompletionCandidatesDoes the auto completion for categories, matching with any category already present in the knowledge base.- Parameters:
- prefix- the input prefix.
- Returns:
- the AutoCompletionCandidates.
 
- 
doAutoCompleteFallbackCategoriesAsStringpublic AutoCompletionCandidates doAutoCompleteFallbackCategoriesAsString(@QueryParameter String value) Does the auto completion for categories, matching with any category already present in the knowledge base.- Parameters:
- value- the input value.
- Returns:
- the AutoCompletionCandidates.
 
 
-