Class CauseManagement
java.lang.Object
com.sonyericsson.jenkins.plugins.bfa.CauseManagement
- All Implemented Interfaces:
- ExtensionPoint,- Action,- ModelObject,- RootAction
- Direct Known Subclasses:
- TransientCauseManagement
Page for managing the failure causes.
- Author:
- Robert Sandell <robert.sandell@sonyericsson.com>
- 
Nested Class SummaryNested classes/interfaces inherited from interface hudson.ExtensionPointExtensionPoint.LegacyInstancesAreScopedToHudson
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringTitle for the page displaying the graphs.static final StringThe pre-filled description that a new cause gets.static final StringThe reserved id for getting a newFailureCausefromgetDynamic(String, org.kohsuke.stapler.StaplerRequest2, org.kohsuke.stapler.StaplerResponse2).static final StringThe pre-filled name that a new cause gets.static final StringThe request attribute key where error messages are added.static final StringSession key for the last removedFailureCauseby the user.static final StringWhere in the Jenkins name space this action will be.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoiddoRemoveConfirm(String id, org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) Web call to remove aFailureCause.getDynamic(String id, org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) Dynamic Stapler URL binding.getErrorMessage(org.kohsuke.stapler.StaplerRequest2 request) Used for getting the error message to show on the page.getImageUrl(String size, String name) Deprecated.plugin now uses icons.Provides a list of all IndicationDescriptors.static CauseManagementProvides the singleton instance of this class that Jenkins has loaded.getOwner()The "owner" of this Action.protected StringWhere to redirect after the form has been saved, probably to the owner.The permission related to this action.The permission related to this action.Convenience method forKnowledgeBase.getShallowCauses().booleanisError(org.kohsuke.stapler.StaplerRequest2 request) Convenience method for jelly.booleanChecks if Jenkins is run from inside a HudsonTestCase.
- 
Field Details- 
URL_NAMEWhere in the Jenkins name space this action will be.- See Also:
 
- 
NEW_CAUSE_DYNAMIC_IDThe reserved id for getting a newFailureCausefromgetDynamic(String, org.kohsuke.stapler.StaplerRequest2, org.kohsuke.stapler.StaplerResponse2).- See Also:
 
- 
NEW_CAUSE_NAMEThe pre-filled name that a new cause gets.- See Also:
 
- 
NEW_CAUSE_DESCRIPTIONThe pre-filled description that a new cause gets.- See Also:
 
- 
REQUEST_CAUSE_MANAGEMENT_ERRORThe request attribute key where error messages are added.- See Also:
 
- 
SESSION_REMOVED_FAILURE_CAUSESession key for the last removedFailureCauseby the user. Will be removed by the index page when it displays it.- See Also:
 
- 
GRAPH_PAGE_TITLETitle for the page displaying the graphs.- See Also:
 
 
- 
- 
Constructor Details- 
CauseManagementpublic CauseManagement()
 
- 
- 
Method Details- 
getIconFileName- Specified by:
- getIconFileNamein interface- Action
 
- 
getDisplayName- Specified by:
- getDisplayNamein interface- Action
- Specified by:
- getDisplayNamein interface- ModelObject
 
- 
getUrlName- Specified by:
- getUrlNamein interface- Action
 
- 
getImageUrlDeprecated.plugin now uses icons.Convenience method for callingPluginImpl.getImageUrl(String, String)from jelly.- Parameters:
- size- the size
- name- the name
- Returns:
- the url.
- See Also:
 
- 
getShallowCausesConvenience method forKnowledgeBase.getShallowCauses().- Returns:
- the collection of causes.
- Throws:
- Exception- if communication fails.
 
- 
isErrorpublic boolean isError(org.kohsuke.stapler.StaplerRequest2 request) Convenience method for jelly.- Parameters:
- request- the request where the message might be.
- Returns:
- true if there is an error message to display.
 
- 
getErrorMessageUsed for getting the error message to show on the page.- Parameters:
- request- the request where the message might be.
- Returns:
- the error message to show.
 
- 
getDynamicpublic FailureCause getDynamic(String id, org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) throws Exception Dynamic Stapler URL binding. Provides the ability to navigate to a cause via for example:/jenkins/failure-cause-management/abf123- Parameters:
- id- the id of the cause of "new" to create a new cause.
- request- the request
- response- the response
- Returns:
- the cause if found or null.
- Throws:
- Exception- if communication with the knowledge base failed.
 
- 
doRemoveConfirm@POST public void doRemoveConfirm(@QueryParameter String id, org.kohsuke.stapler.StaplerRequest2 request, org.kohsuke.stapler.StaplerResponse2 response) throws IOException Web call to remove aFailureCause. Does a permission check forPluginImpl.REMOVE_PERMISSION.- Parameters:
- id- the id of the cause to remove.
- request- the stapler request.
- response- the stapler response.
- Throws:
- IOException- if so during redirect.
 
- 
getOwnerThe "owner" of this Action. Default this would beHudson.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.- Returns:
- the holder of the beer.
 
- 
getOwnerUrlWhere to redirect after the form has been saved, probably to the owner.- Returns:
- the owner's URL or some place else to redirect the user after save.
 
- 
getIndicationDescriptorsProvides a list of all IndicationDescriptors. For Jelly convenience.- Returns:
- a list of descriptors.
- See Also:
 
- 
getPermissionThe permission related to this action. For Jelly convenience.- Returns:
- the permission.
- See Also:
 
- 
getRemovePermissionThe permission related to this action. For Jelly convenience.- Returns:
- the permission.
- See Also:
 
- 
isUnderTestpublic boolean isUnderTest()Checks if Jenkins is run from inside a HudsonTestCase. For some reason the buildQueue fails to render when run under test but works fine when run with hpi:run. So the jelly file skips the inclusion of the sidepanel if we are running under test to work around this problem. The check is done via looking at the class name ofJenkins.getPluginManager().- Returns:
- true if we are running under test.
 
- 
getInstanceProvides the singleton instance of this class that Jenkins has loaded. Throws an IllegalStateException if for some reason the action can't be found.- Returns:
- the instance.
 
 
-