public class LocalFileKnowledgeBase extends KnowledgeBase
Modifier and Type | Class and Description |
---|---|
static class |
LocalFileKnowledgeBase.LocalFileKnowledgeBaseDescriptor
Descriptor for
LocalFileKnowledgeBase . |
KnowledgeBase.KnowledgeBaseDescriptor
Constructor and Description |
---|
LocalFileKnowledgeBase()
Default constructor.
|
LocalFileKnowledgeBase(Collection<FailureCause> initialCauses)
Standard constructor.
|
LocalFileKnowledgeBase(hudson.util.CopyOnWriteList<FailureCause> legacyCauses)
Standard constructor.
|
Modifier and Type | Method and Description |
---|---|
FailureCause |
addCause(FailureCause cause)
Saves a new cause to the db and generates a new id for the cause.
|
void |
convertFrom(KnowledgeBase oldKnowledgeBase)
Converts the existing old knowledge base into this one.
|
boolean |
equals(KnowledgeBase oldKnowledgeBase)
Called to see if the configuration has changed.
|
boolean |
equals(Object other) |
List<String> |
getCategories()
Gets the unique categories of all FailureCauses.
|
FailureCause |
getCause(String id)
Get the cause with the given id.
|
Collection<FailureCause> |
getCauseNames()
Get the list of the
FailureCause 's names and ids. |
Collection<FailureCause> |
getCauses()
Get the list of
FailureCause s. |
hudson.model.Descriptor<KnowledgeBase> |
getDescriptor() |
Collection<FailureCause> |
getShallowCauses()
Get a shallow list of the
FailureCause s. |
int |
hashCode() |
boolean |
isEnableStatistics()
If Statistics logging is enabled on this knowledge base or not.
|
boolean |
isSuccessfulLogging()
If all builds should be added to statistics logging, not just unsuccessful builds.
|
protected void |
put(FailureCause cause)
Puts the cause directly into the map.
|
void |
removeBuildfailurecause(hudson.model.Run build)
Removes the build failure cause of particular build.
|
FailureCause |
removeCause(String id)
Removes the cause from the knowledge base.
|
FailureCause |
saveCause(FailureCause cause)
Saves a cause to the db.
|
void |
saveStatistics(Statistics stat)
Saves the Statistics.
|
void |
start()
Called when the KnowledgeBase should be up and running.
|
void |
stop()
Called when it is time to clean up after the KnowledgeBase.
|
convertFromAbstract, getCreationDateForCause, getLatestFailureForCause, removeBuildfailurecause, updateLastSeen
public LocalFileKnowledgeBase(hudson.util.CopyOnWriteList<FailureCause> legacyCauses)
legacyCauses
- the causes.public LocalFileKnowledgeBase(Collection<FailureCause> initialCauses)
initialCauses
- the causes.@DataBoundConstructor public LocalFileKnowledgeBase()
public Collection<FailureCause> getCauses()
KnowledgeBase
FailureCause
s. It is intended to be used in the scanning phase hence it should be
returned as quickly as possible, so the list could be cached.getCauses
in class KnowledgeBase
public Collection<FailureCause> getCauseNames()
KnowledgeBase
FailureCause
's names and ids. The list should be the latest possible from the DB as
they will be used for editing. The objects returned should contain at least the id and the name of the cause.getCauseNames
in class KnowledgeBase
public Collection<FailureCause> getShallowCauses() throws Exception
KnowledgeBase
FailureCause
s. The list should be the latest possible from the DB as
they will be used in the list of causes to edit.
shallow meaning no indications but information enough to show a nice list; at least id and name but description,
comment, lastOccurred and categories are preferred as well.getShallowCauses
in class KnowledgeBase
Exception
- if something in the KnowledgeBase handling goes wrong.KnowledgeBase.getCauseNames()
public FailureCause getCause(String id)
KnowledgeBase
getCause
in class KnowledgeBase
id
- the id of the cause.public FailureCause addCause(FailureCause cause) throws IOException
KnowledgeBase
addCause
in class KnowledgeBase
cause
- the cause to add.IOException
public FailureCause removeCause(String id) throws Exception
KnowledgeBase
removeCause
in class KnowledgeBase
id
- the id of the cause to remove.Exception
- if so.public FailureCause saveCause(FailureCause cause) throws IOException
KnowledgeBase
KnowledgeBase
implementation with a preexisting id that is being converted via KnowledgeBase.convertFrom(KnowledgeBase)
.saveCause
in class KnowledgeBase
cause
- the cause to add.IOException
protected void put(FailureCause cause)
cause
- the cause to put.public void convertFrom(KnowledgeBase oldKnowledgeBase) throws Exception
KnowledgeBase
convertFrom
in class KnowledgeBase
oldKnowledgeBase
- the old one.Exception
- if something in the KnowledgeBase handling goes wrong.public List<String> getCategories() throws Exception
KnowledgeBase
getCategories
in class KnowledgeBase
Exception
- if something in the KnowledgeBase handling goes wrong.public boolean equals(KnowledgeBase oldKnowledgeBase)
KnowledgeBase
equals
in class KnowledgeBase
oldKnowledgeBase
- the previous config.public void start()
KnowledgeBase
start
in class KnowledgeBase
public void stop()
KnowledgeBase
stop
in class KnowledgeBase
public boolean isEnableStatistics()
KnowledgeBase
isEnableStatistics
in class KnowledgeBase
public boolean isSuccessfulLogging()
KnowledgeBase
KnowledgeBase.isEnableStatistics()
is true.isSuccessfulLogging
in class KnowledgeBase
public void saveStatistics(Statistics stat) throws Exception
KnowledgeBase
saveStatistics
in class KnowledgeBase
stat
- the Statistics.Exception
- if something in the KnowledgeBase handling goes wrong.public hudson.model.Descriptor<KnowledgeBase> getDescriptor()
public void removeBuildfailurecause(hudson.model.Run build) throws Exception
KnowledgeBase
removeBuildfailurecause
in class KnowledgeBase
build
- the build.Exception
- if something in the KnowledgeBase handling goes wrong.Copyright © 2016–2021. All rights reserved.