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
Constructors Constructor Description JobAction(Job<?,?> owner, StaticAnalysisLabelProvider labelProvider)
Deprecated.JobAction(Job<?,?> owner, StaticAnalysisLabelProvider labelProvider, int numberOfTools)
Creates a new instance ofJobAction
.JobAction(Job<?,?> owner, StaticAnalysisLabelProvider labelProvider, int numberOfTools, TrendChartType trendChartType)
Creates a new instance ofJobAction
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description History
createBuildHistory()
Returns the build history for this job.void
doIndex(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
Redirects the index page to the last result.String
getBuildTrendModel()
Deprecated.String
getConfigurableBuildTrendModel(String configuration)
Returns the trend chart model that renders the build results for a specific action.String
getDisplayName()
String
getIconFileName()
Returns the icon URL for the side-panel in the job screen.String
getId()
Returns the ID of this action and the ID of the associated results.Optional<ResultAction>
getLatestAction()
Returns the latest static analysis results for this job.Job<?,?>
getOwner()
Returns the job this action belongs to.String
getTrendName()
Returns the title of the trend graph.String
getUrlName()
boolean
isTrendEmpty()
Returns whether the trend chart is empty.boolean
isTrendVisible()
Returns whether the trend chart is visible or not.String
toString()
-
-
-
Constructor Detail
-
JobAction
@Deprecated public JobAction(Job<?,?> owner, StaticAnalysisLabelProvider labelProvider)
Deprecated.Creates a new instance ofJobAction
.- Parameters:
owner
- the job that owns this actionlabelProvider
- the label provider
-
JobAction
public JobAction(Job<?,?> owner, StaticAnalysisLabelProvider labelProvider, int numberOfTools)
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
public JobAction(Job<?,?> owner, StaticAnalysisLabelProvider labelProvider, int numberOfTools, TrendChartType trendChartType)
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
-
-
Method Detail
-
getId
public String getId()
Returns the ID of this action and the ID of the associated results.- Returns:
- the ID
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getTrendName
public String getTrendName()
Returns the title of the trend graph.- Returns:
- the title of the trend graph.
-
getOwner
public Job<?,?> getOwner()
Returns the job this action belongs to.- Returns:
- the job
-
createBuildHistory
public History createBuildHistory()
Returns the build history for this job.- Returns:
- the history
-
getIconFileName
@CheckForNull public String getIconFileName()
Returns the icon URL for the side-panel in the job screen. If there is no valid result yet, thennull
is returned.- Specified by:
getIconFileName
in interfaceAction
- Returns:
- the icon URL for the side-panel in the job screen
-
getUrlName
public String getUrlName()
- Specified by:
getUrlName
in interfaceAction
-
doIndex
public void doIndex(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse 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
public Optional<ResultAction> getLatestAction()
Returns the latest static analysis results for this job.- Returns:
- the latest results (if available)
-
getBuildTrendModel
@Deprecated public String getBuildTrendModel()
Deprecated.Returns the trend chart model that renders the aggregated build results.- Returns:
- the trend chart
-
getConfigurableBuildTrendModel
@JavaScriptMethod public String getConfigurableBuildTrendModel(String configuration)
Returns the trend chart model that renders the build results for a specific action.- Specified by:
getConfigurableBuildTrendModel
in 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:
isTrendVisible
in interfaceio.jenkins.plugins.echarts.AsyncConfigurableTrendChart
- Returns:
true
if 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:
true
if the trend is empty, false otherwise
-
-