Class JobAction
java.lang.Object
io.jenkins.plugins.analysis.core.model.JobAction
- All Implemented Interfaces:
Action,ModelObject,io.jenkins.plugins.echarts.AsyncConfigurableTrendChart
public class JobAction
extends Object
implements Action, io.jenkins.plugins.echarts.AsyncConfigurableTrendChart
A job action displays a link on the side panel of a job. This action also is responsible to render the historical
trend via its associated 'charts.jelly' view.
- Author:
- Ullrich Hafner
-
Constructor Summary
ConstructorsConstructorDescriptionJobAction(Job<?, ?> owner, StaticAnalysisLabelProvider labelProvider, int numberOfTools) Deprecated.JobAction(Job<?, ?> owner, StaticAnalysisLabelProvider labelProvider, int numberOfTools, TrendChartType trendChartType) Deprecated.JobAction(Job<?, ?> owner, StaticAnalysisLabelProvider labelProvider, int numberOfTools, TrendChartType trendChartType, String urlName) Creates a new instance ofJobAction. -
Method Summary
Modifier and TypeMethodDescriptionReturns the build history for this job.voiddoIndex(org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) Redirects the index page to the last result.getConfigurableBuildTrendModel(String configuration) Returns the trend chart model that renders the build results for a specific action.Returns the icon URL for the side-panel in the job screen.getId()Returns the ID of this action and the ID of the associated results.Returns the latest static analysis results for this job.Job<?,?> getOwner()Returns the job this action belongs to.Returns the title of the trend graph.booleanReturns whether the trend chart is empty.booleanReturns whether the trend chart is visible or not.toString()
-
Constructor Details
-
JobAction
@Deprecated public JobAction(Job<?, ?> owner, StaticAnalysisLabelProvider labelProvider, int numberOfTools) Deprecated.Creates a new instance ofJobAction.- Parameters:
owner- the job that owns this actionlabelProvider- the label providernumberOfTools- the number of tools that have results to show
-
JobAction
@Deprecated public JobAction(Job<?, ?> owner, StaticAnalysisLabelProvider labelProvider, int numberOfTools, TrendChartType trendChartType) Deprecated.Creates a new instance ofJobAction.- Parameters:
owner- the job that owns this actionlabelProvider- the label providernumberOfTools- the number of tools that have results to showtrendChartType- determines if the trend chart will be shown
-
JobAction
public JobAction(Job<?, ?> owner, StaticAnalysisLabelProvider labelProvider, int numberOfTools, TrendChartType trendChartType, String urlName) Creates a new instance ofJobAction.- Parameters:
owner- the job that owns this actionlabelProvider- the label providernumberOfTools- the number of tools that have results to showtrendChartType- determines if the trend chart will be shownurlName- the custom URL name of this action
-
-
Method Details
-
getId
Returns the ID of this action and the ID of the associated results.- Returns:
- the ID
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject
-
getTrendName
Returns the title of the trend graph.- Returns:
- the title of the trend graph.
-
getOwner
Returns the job this action belongs to.- Returns:
- the job
-
createBuildHistory
Returns the build history for this job.- Returns:
- the history
-
getIconFileName
Returns the icon URL for the side-panel in the job screen. If there is no valid result yet, thennullis returned.- Specified by:
getIconFileNamein interfaceAction- Returns:
- the icon URL for the side-panel in the job screen
-
getUrlName
- Specified by:
getUrlNamein interfaceAction
-
doIndex
public void doIndex(org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) throws IOException Redirects the index page to the last result.- Parameters:
request- Stapler requestresponse- Stapler response- Throws:
IOException- in case of an error
-
getLatestAction
Returns the latest static analysis results for this job.- Returns:
- the latest results (if available)
-
getConfigurableBuildTrendModel
Returns the trend chart model that renders the build results for a specific action.- Specified by:
getConfigurableBuildTrendModelin interfaceio.jenkins.plugins.echarts.AsyncConfigurableTrendChart- Parameters:
configuration- JSON configuration of the chart (number of builds, etc.)- Returns:
- the trend chart
-
isTrendVisible
public boolean isTrendVisible()Returns whether the trend chart is visible or not.- Specified by:
isTrendVisiblein interfaceio.jenkins.plugins.echarts.AsyncConfigurableTrendChart- Returns:
trueif the trend is visible, false otherwise
-
isTrendEmpty
public boolean isTrendEmpty()Returns whether the trend chart is empty. The trend is empty if all builds have zero issues.- Returns:
trueif the trend is empty, false otherwise
-
toString
-
JobAction(Job, StaticAnalysisLabelProvider, int, TrendChartType, String)instead.