|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sonyericsson.jenkins.plugins.bfa.db.KnowledgeBase
public abstract class KnowledgeBase
Base class for storage implementations of FailureCause
s. Extend this class and put @Extension
on
the descriptor to provide your own.
Nested Class Summary | |
---|---|
static class |
KnowledgeBase.KnowledgeBaseDescriptor
Descriptor for KnowledgeBase s. |
Constructor Summary | |
---|---|
KnowledgeBase()
|
Method Summary | |
---|---|
abstract FailureCause |
addCause(FailureCause cause)
Saves a new cause to the db and generates a new id for the cause. |
abstract void |
convertFrom(KnowledgeBase oldKnowledgeBase)
Converts the existing old knowledge base into this one. |
protected void |
convertFromAbstract(KnowledgeBase oldKnowledgeBase)
Does a full copy of the data in the old one to this one. |
abstract boolean |
equals(KnowledgeBase oldKnowledgeBase)
Called to see if the configuration has changed. |
abstract List<String> |
getCategories()
Gets the unique categories of all FailureCauses. |
abstract FailureCause |
getCause(String id)
Get the cause with the given id. |
abstract Collection<FailureCause> |
getCauseNames()
Get the list of the FailureCause 's names and ids. |
abstract Collection<FailureCause> |
getCauses()
Get the list of FailureCause s. |
List<ObjectCountPair<String>> |
getFailureCauseNames(GraphFilterBuilder filter)
Gets a list of ObjectCountPair s where each pair contains a unique FailureCause -name as key
and the number of times that failure cause was triggered as count. |
Map<Integer,List<FailureCause>> |
getFailureCausesPerBuild(GraphFilterBuilder filter)
Gets a map where a lists of failure causes are mapped by the build number for which they were triggered. |
List<FailureCauseTimeInterval> |
getFailureCausesPerTime(int intervalSize,
GraphFilterBuilder filter,
boolean byCategories)
Fetches failure causes grouped in time intervals. |
List<ObjectCountPair<String>> |
getNbrOfFailureCategoriesPerName(GraphFilterBuilder filter,
int limit)
Gets a list of ObjectCountPair where each pair contains a unique failure category string as key
and the number of times that the failure cause category was triggered as count. |
List<ObjectCountPair<FailureCause>> |
getNbrOfFailureCauses(GraphFilterBuilder filter)
Gets a list of ObjectCountPair where each pair contains a unique FailureCause as key
and the number of times that failure cause was triggered as count. |
List<ObjectCountPair<String>> |
getNbrOfFailureCausesPerId(GraphFilterBuilder filter,
int limit)
Gets a list of ObjectCountPair where each pair contains a unique FailureCause id as key
and a belonging count value for how many times that FailureCause was triggered. |
long |
getNbrOfNullFailureCauses(GraphFilterBuilder filter)
Counts how many statistics posts there are without FailureCause (null) for a given filter. |
abstract Collection<FailureCause> |
getShallowCauses()
Get a shallow list of the FailureCause s. |
List<Statistics> |
getStatistics(GraphFilterBuilder filter,
int limit)
Gets Statistics data. |
Map<org.jfree.data.time.TimePeriod,Double> |
getUnknownFailureCauseQuotaPerTime(int intervalSize,
GraphFilterBuilder filter)
Gets the quota of unknown failure causes mapped by time periods. |
int |
hashCode()
|
abstract boolean |
isStatisticsEnabled()
If Statistics logging is enabled on this knowledge base or not. |
abstract boolean |
isSuccessfulLoggingEnabled()
If all builds should be added to statistics logging, not just unsuccessful builds. |
abstract void |
removeBuildfailurecause(hudson.model.AbstractBuild build)
Removes the build failure cause of particular build. |
abstract FailureCause |
removeCause(String id)
Removes the cause from the knowledge base. |
abstract FailureCause |
saveCause(FailureCause cause)
Saves a cause to the db. |
abstract void |
saveStatistics(Statistics stat)
Saves the Statistics. |
abstract void |
start()
Called when the KnowledgeBase should be up and running. |
abstract void |
stop()
Called when it is time to clean up after the KnowledgeBase. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface hudson.model.Describable |
---|
getDescriptor |
Constructor Detail |
---|
public KnowledgeBase()
Method Detail |
---|
public abstract Collection<FailureCause> getCauses() throws Exception
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.
Exception
- if something in the KnowledgeBase handling goes wrong.public abstract Collection<FailureCause> getCauseNames() throws Exception
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.
Exception
- if something in the KnowledgeBase handling goes wrong.public abstract Collection<FailureCause> getShallowCauses() throws Exception
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
and categories are preferred as well.
Exception
- if something in the KnowledgeBase handling goes wrong.getCauseNames()
public abstract FailureCause getCause(String id) throws Exception
id
- the id of the cause.
Exception
- if something in the KnowledgeBase handling goes wrong.public abstract FailureCause addCause(FailureCause cause) throws Exception
cause
- the cause to add.
Exception
- if something in the KnowledgeBase handling goes wrong.public abstract FailureCause removeCause(String id) throws Exception
id
- the id of the cause to remove.
Exception
- if so.public abstract FailureCause saveCause(FailureCause cause) throws Exception
KnowledgeBase
implementation with a preexisting id that is being converted via convertFrom(KnowledgeBase)
.
cause
- the cause to add.
Exception
- if something in the KnowledgeBase handling goes wrong.public abstract void convertFrom(KnowledgeBase oldKnowledgeBase) throws Exception
oldKnowledgeBase
- the old one.
Exception
- if something in the KnowledgeBase handling goes wrong.public abstract List<String> getCategories() throws Exception
Exception
- if something in the KnowledgeBase handling goes wrong.protected void convertFromAbstract(KnowledgeBase oldKnowledgeBase) throws Exception
convertFrom(KnowledgeBase)
to handle conversion from an unknown source type.
oldKnowledgeBase
- the old one.
Exception
- if anything goes wrong in the KnowledgeBase handling.convertFrom(KnowledgeBase)
public abstract boolean equals(KnowledgeBase oldKnowledgeBase)
oldKnowledgeBase
- the previous config.
public abstract void start() throws Exception
Exception
- if anything goes wrong during the startup.public abstract void stop()
public int hashCode()
hashCode
in class Object
public abstract boolean isStatisticsEnabled()
public abstract boolean isSuccessfulLoggingEnabled()
isStatisticsEnabled()
is true.
public abstract void saveStatistics(Statistics stat) throws Exception
stat
- the Statistics.
Exception
- if something in the KnowledgeBase handling goes wrong.public List<Statistics> getStatistics(GraphFilterBuilder filter, int limit) throws Exception
filter
- the filter to use when fetching datalimit
- number of statistics items to fetch, set to nonpositive value to fetch all
Exception
- if something in the KnowledgeBase handling goes wrong.public List<ObjectCountPair<FailureCause>> getNbrOfFailureCauses(GraphFilterBuilder filter)
ObjectCountPair
where each pair contains a unique FailureCause
as key
and the number of times that failure cause was triggered as count.
The list is sorted by counts, meaning that the FailureCause that has been triggered the most comes first.
This method needs to be implemented in subclass for graph support.
filter
- the filter to use when fetching data
public Map<org.jfree.data.time.TimePeriod,Double> getUnknownFailureCauseQuotaPerTime(int intervalSize, GraphFilterBuilder filter)
intervalSize
- the interval sizes in which the data is grouped.
Should be set to Calendar.MONTH, Calendar.DATE or Calendar.HOUR_OF_DAY.filter
- The filter to use when fetching the data
public List<ObjectCountPair<String>> getFailureCauseNames(GraphFilterBuilder filter)
ObjectCountPair
s where each pair contains a unique FailureCause
-name as key
and the number of times that failure cause was triggered as count.
This list is sorted by counts, meaning that the FailureCause that has been triggered the most comes first.
This method needs to be implemented in subclass for graph support.
filter
- The filter to use when fetching the data
public long getNbrOfNullFailureCauses(GraphFilterBuilder filter)
filter
- the filter to use when fetching data
public List<ObjectCountPair<String>> getNbrOfFailureCategoriesPerName(GraphFilterBuilder filter, int limit)
ObjectCountPair
where each pair contains a unique failure category string as key
and the number of times that the failure cause category was triggered as count.
The list is sorted by counts, meaning that the Category that has been triggered the most comes first.
This method needs to be implemented in subclass for graph support.
filter
- the filter to use when fetching datalimit
- the number of categories to fetch, set to nonpositive value to fetch all
public Map<Integer,List<FailureCause>> getFailureCausesPerBuild(GraphFilterBuilder filter)
filter
- the filter to use when fetching data
public List<FailureCauseTimeInterval> getFailureCausesPerTime(int intervalSize, GraphFilterBuilder filter, boolean byCategories)
intervalSize
- the interval sizes in which the data is grouped.
Should be set to Calendar.MONTH, Calendar.DATE or Calendar.HOUR_OF_DAY.filter
- the filter to use when fetching databyCategories
- set to true in order to group failure causes by their categories
public List<ObjectCountPair<String>> getNbrOfFailureCausesPerId(GraphFilterBuilder filter, int limit)
ObjectCountPair
where each pair contains a unique FailureCause id as key
and a belonging count value for how many times that FailureCause was triggered.
This method needs to be implemented in subclass for graph support.
filter
- the filter to use when fetching datalimit
- the number of items to fetch, set to nonpositive value to fetch all
public abstract void removeBuildfailurecause(hudson.model.AbstractBuild build) throws Exception
build
- the AbstractBuild.
Exception
- if something in the KnowledgeBase handling goes wrong.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |