@Extension public class CauseManagement extends BfaGraphAction
ExtensionPoint.LegacyInstancesAreScopedToHudson
Modifier and Type | Field and Description |
---|---|
static String |
GRAPH_PAGE_TITLE
Title for the page displaying the graphs.
|
static String |
NEW_CAUSE_DESCRIPTION
The pre-filled description that a new cause gets.
|
static String |
NEW_CAUSE_DYNAMIC_ID
The reserved id for getting a new
FailureCause from getDynamic(String,
org.kohsuke.stapler.StaplerRequest, org.kohsuke.stapler.StaplerResponse) . |
static String |
NEW_CAUSE_NAME
The pre-filled name that a new cause gets.
|
static String |
REQUEST_CAUSE_MANAGEMENT_ERROR
The request attribute key where error messages are added.
|
static String |
SESSION_REMOVED_FAILURE_CAUSE
Session key for the last removed
FailureCause by the user. |
static String |
URL_NAME
Where in the Jenkins name space this action will be.
|
DEFAULT_GRAPH_HEIGHT, DEFAULT_GRAPH_WIDTH, EXCLUDE_ABORTED, ID_SEPARATOR, URL_PARAM_ALL_MASTERS, URL_PARAM_SHOW_ABORTED, URL_PARAM_TIME_PERIOD, URL_PARAM_VALUE_MAX, URL_PARAM_VALUE_MONTH, URL_PARAM_VALUE_TODAY, URL_PARAM_WHICH_GRAPH
Constructor and Description |
---|
CauseManagement() |
Modifier and Type | Method and Description |
---|---|
void |
doRemoveConfirm(String id,
org.kohsuke.stapler.StaplerRequest request,
org.kohsuke.stapler.StaplerResponse response)
Web call to remove a
FailureCause . |
String |
getDisplayName() |
FailureCause |
getDynamic(String id,
org.kohsuke.stapler.StaplerRequest request,
org.kohsuke.stapler.StaplerResponse response)
Dynamic Stapler URL binding.
|
String |
getErrorMessage(org.kohsuke.stapler.StaplerRequest request)
Used for getting the error message to show on the page.
|
protected Graph |
getGraph(GraphType which,
Date timePeriod,
boolean hideManAborted,
boolean forAllMasters,
Map<String,String> rawReqParams)
Get the graph corresponding to the specified arguments.
|
protected String |
getGraphCacheId(GraphType whichGraph,
String reqTimePeriod,
boolean hideAborted,
boolean forAllMasters)
Get a unique id used in the caching of the graph.
|
String |
getGraphsPageTitle()
Get the title to display in the top of the detailed graphs page.
|
GraphType[] |
getGraphTypes()
Returns an array of
GraphType s, where each element represents
a graph. |
String |
getIconFileName() |
String |
getImageUrl(String size,
String name)
Convenience method for calling
PluginImpl.getImageUrl(String, String) from jelly. |
ExtensionList<Indication.IndicationDescriptor> |
getIndicationDescriptors()
Provides a list of all IndicationDescriptors.
|
static CauseManagement |
getInstance()
Provides the singleton instance of this class that Jenkins has loaded.
|
ModelObject |
getOwner()
The "owner" of this Action.
|
protected String |
getOwnerUrl()
Where to redirect after the form has been saved, probably to the owner.
|
Permission |
getPermission()
The permission related to this action.
|
Permission |
getRemovePermission()
The permission related to this action.
|
Iterable<FailureCause> |
getShallowCauses()
Convenience method for
KnowledgeBase.getShallowCauses() . |
String |
getUrlName() |
boolean |
isError(org.kohsuke.stapler.StaplerRequest request)
Convenience method for jelly.
|
boolean |
isUnderTest()
Checks if Jenkins is run from inside a HudsonTestCase.
|
boolean |
showGraphDelayText()
Helper for the groovy-views; show/hide info text for graph delay.
|
boolean |
showMasterSwitch()
Helper for the groovy-views; show/hide Masters-switch.
|
getDefaultGraphHeight, getDefaultGraphWidth, getGraph
public static final String URL_NAME
getUrlName()
,
Constant Field Valuespublic static final String NEW_CAUSE_DYNAMIC_ID
FailureCause
from getDynamic(String,
org.kohsuke.stapler.StaplerRequest, org.kohsuke.stapler.StaplerResponse)
.public static final String NEW_CAUSE_NAME
public static final String NEW_CAUSE_DESCRIPTION
public static final String REQUEST_CAUSE_MANAGEMENT_ERROR
public static final String SESSION_REMOVED_FAILURE_CAUSE
FailureCause
by the user. Will be removed by the index page when it
displays it.public static final String GRAPH_PAGE_TITLE
public String getIconFileName()
public String getDisplayName()
public String getUrlName()
public String getImageUrl(String size, String name)
PluginImpl.getImageUrl(String, String)
from jelly.size
- the sizename
- the namePluginImpl.getImageUrl(String, String)
public Iterable<FailureCause> getShallowCauses() throws Exception
KnowledgeBase.getShallowCauses()
.Exception
- if communication fails.public boolean isError(org.kohsuke.stapler.StaplerRequest request)
request
- the request where the message might be.public String getErrorMessage(org.kohsuke.stapler.StaplerRequest request)
request
- the request where the message might be.public FailureCause getDynamic(String id, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) throws Exception
/jenkins/failure-cause-management/abf123
id
- the id of the cause of "new" to create a new cause.request
- the requestresponse
- the responseException
- if communication with the knowledge base failed.public void doRemoveConfirm(@QueryParameter String id, org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) throws IOException
FailureCause
. Does a permission check for PluginImpl.REMOVE_PERMISSION
.id
- the id of the cause to remove.request
- the stapler request.response
- the stapler response.IOException
- if so during redirect.public ModelObject getOwner()
Hudson.getInstance()
but if the class is
included in some build or something we might want to be able to easier change the side panel for example.getOwner
in class BfaGraphAction
protected String getOwnerUrl()
public ExtensionList<Indication.IndicationDescriptor> getIndicationDescriptors()
Indication.IndicationDescriptor.getAll()
public Permission getPermission()
PluginImpl.UPDATE_PERMISSION
public Permission getRemovePermission()
PluginImpl.UPDATE_PERMISSION
public boolean isUnderTest()
Jenkins.getPluginManager()
.public static CauseManagement getInstance()
public GraphType[] getGraphTypes()
BfaGraphAction
GraphType
s, where each element represents
a graph. These are the types used to display the graphs/images
on the detailed graphs page, that is, they will be the 'which'-parameter
to getGraph(GraphType which, Date ...).
The graphs are displayed in the same order as the numbers in the array.getGraphTypes
in class BfaGraphAction
GraphType
s where each element
represents a graph to displaypublic String getGraphsPageTitle()
BfaGraphAction
getGraphsPageTitle
in class BfaGraphAction
public boolean showMasterSwitch()
BfaGraphAction
showMasterSwitch
in class BfaGraphAction
public boolean showGraphDelayText()
BfaGraphAction
showGraphDelayText
in class BfaGraphAction
protected Graph getGraph(GraphType which, Date timePeriod, boolean hideManAborted, boolean forAllMasters, Map<String,String> rawReqParams)
BfaGraphAction
getGraph
in class BfaGraphAction
which
- Which graph to displaytimePeriod
- How old statistics should be included in the graphhideManAborted
- Hide manually aborted causesforAllMasters
- Show for all mastersrawReqParams
- The url parameters that came with the requestprotected String getGraphCacheId(GraphType whichGraph, String reqTimePeriod, boolean hideAborted, boolean forAllMasters)
BfaGraphAction
getGraphCacheId
in class BfaGraphAction
whichGraph
- Which graphreqTimePeriod
- The selected time periodhideAborted
- Hide aborted buildsforAllMasters
- For all mastersCopyright © 2016–2019. All rights reserved.