public class FailureCause extends Object implements Serializable, Action, Describable<FailureCause>, IFailureCauseMetricData
Modifier and Type | Class and Description |
---|---|
static class |
FailureCause.FailureCauseDescriptor
Descriptor is only used for auto completion of categories.
|
Constructor and Description |
---|
FailureCause()
Default constructor.
|
FailureCause(String name,
String description)
Standard constructor.
|
FailureCause(String name,
String description,
String comment)
Standard constructor.
|
FailureCause(String name,
String description,
String comment,
String categories)
Standard constructor.
|
FailureCause(String id,
String name,
String description,
String comment,
Date lastOccurred,
List<String> categories,
List<Indication> indications,
List<FailureCauseModification> modifications)
JSON constructor.
|
FailureCause(String id,
String name,
String description,
String comment,
Date lastOccurred,
String categories,
List<Indication> indications,
List<FailureCauseModification> modifications)
Standard data bound constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addIndication(Indication indication)
Adds an indication to the list.
|
FormValidation |
doCheckDescription(String value)
Deprecated.
|
FormValidation |
doCheckName(String value)
Deprecated.
|
void |
doConfigSubmit(org.kohsuke.stapler.StaplerRequest request,
org.kohsuke.stapler.StaplerResponse response)
The form submission handler.
|
CauseManagement |
getAncestorCauseManagement()
Finds the
CauseManagement ancestor of the current request . |
Date |
getAndInitiateLastOccurred()
Initiates the last occurrence if it's not already initiated
and then returns the date of last modification.
|
List<FailureCauseModification> |
getAndInitiateModifications()
Initiates the list of modifications if it's not already initiated
and then returns the list.
|
List<String> |
getCategories()
Getter for the categories.
|
String |
getCategoriesAsString()
Returns the categories as a String, used for the view.
|
String |
getComment()
Getter for the comment.
|
String |
getDescription()
Getter for the description.
|
FailureCause.FailureCauseDescriptor |
getDescriptor() |
String |
getDisplayName() |
String |
getIconFileName() |
String |
getId()
The id.
|
List<Indication> |
getIndications()
Getter for the list of indications.
|
Date |
getLastOccurred()
Getter for the last occurrence.
|
FailureCauseModification |
getLatestModification()
Gets the latest
FailureCauseModification of this FailureCause. |
List<FailureCauseModification> |
getModifications()
Getter for the list of modifications.
|
String |
getName()
Getter for the name.
|
String |
getUrlName() |
void |
setCategories(List<String> categories)
Setter for the categories.
|
void |
setId(String id)
The id.
|
void |
setLastOccurred(Date lastOccurred)
Setter for the last occurrence.
|
FormValidation |
validate(String newName,
String newDescription,
List<Indication> newIndications)
Validates this FailureCause.
|
@DataBoundConstructor public FailureCause(String id, String name, String description, String comment, Date lastOccurred, String categories, List<Indication> indications, List<FailureCauseModification> modifications)
id
- the id.name
- the name of this FailureCause.description
- the description of this FailureCause.comment
- the comment of this FailureCause.lastOccurred
- the time at which this FailureCause last occurred.categories
- the categories of this FailureCause.indications
- the list of indicationsmodifications
- the modification history of this FailureCause.public FailureCause(String id, String name, String description, String comment, Date lastOccurred, List<String> categories, List<Indication> indications, List<FailureCauseModification> modifications)
id
- the id.name
- the name of this FailureCause.description
- the description of this FailureCause.comment
- the comment of this FailureCause.lastOccurred
- the last time this FailureCause occurred.categories
- the categories of this FailureCause.indications
- the list of indicationsmodifications
- the modification history of this FailureCause.public FailureCause(String name, String description)
name
- the name of this FailureCause.description
- the description of this FailureCause.public FailureCause(String name, String description, String comment)
name
- the name of this FailureCause.description
- the description of this FailureCause.comment
- the comment for this FailureCause.public FailureCause(String name, String description, String comment, String categories)
name
- the name of this FailureCause.description
- the description of this FailureCause.comment
- the comment for this FailureCause.categories
- the categories of this FailureCause.public FailureCause()
public FormValidation validate(String newName, String newDescription, List<Indication> newIndications)
FailureCause.FailureCauseDescriptor.doCheckName(String, String)
,
FailureCause.FailureCauseDescriptor.doCheckDescription(String)
,
Indications.size > 0. and Indication.validate()
.newName
- the name to validatenewDescription
- the descriptionnewIndications
- the list of indicationsFormValidation.ok()
if everything is fine.@Deprecated public FormValidation doCheckDescription(@QueryParameter String value)
FailureCause.FailureCauseDescriptor.doCheckDescription(String)
insteaddescription
. Checks for not empty and not "Description..."value
- the form value.FormValidation.ok()
if everything is well.@Deprecated public FormValidation doCheckName(@QueryParameter String value)
FailureCause.FailureCauseDescriptor.doCheckName(String, String)
insteadname
. Checks for not empty, not "New...", Jenkins.checkGoodName(String)
and
that it is unique based on the cache of existing causes.value
- the form value.FormValidation.ok()
if everything is well.public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) throws Exception
request
- the request.response
- the responseException
- if it fails to save to the knowledge base or a validation error occurs.public void addIndication(Indication indication)
indication
- the indication to add.public String getId()
public void setId(String id)
id
- the id.public String getName()
getName
in interface IFailureCauseMetricData
public String getDescription()
public String getComment()
public Date getLastOccurred()
public Date getAndInitiateLastOccurred()
public void setLastOccurred(Date lastOccurred)
lastOccurred
- the occurrence to set.public List<FailureCauseModification> getModifications()
public List<FailureCauseModification> getAndInitiateModifications()
public List<String> getCategories()
getCategories
in interface IFailureCauseMetricData
public String getCategoriesAsString()
public FailureCauseModification getLatestModification()
FailureCauseModification
of this FailureCause.public void setCategories(List<String> categories)
categories
- the categories.public List<Indication> getIndications()
public CauseManagement getAncestorCauseManagement()
CauseManagement
ancestor of the current request
.IllegalStateException
- if no ancestor is found.public String getIconFileName()
getIconFileName
in interface Action
public String getDisplayName()
getDisplayName
in interface Action
getDisplayName
in interface ModelObject
public String getUrlName()
getUrlName
in interface Action
public FailureCause.FailureCauseDescriptor getDescriptor()
getDescriptor
in interface Describable<FailureCause>
Copyright © 2016–2021. All rights reserved.