Class MutableExpiryCriteria
- java.lang.Object
-
- com.atlassian.bamboo.resultsummary.MutableExpiryCriteria
-
- All Implemented Interfaces:
ExpiryCriteria
public class MutableExpiryCriteria extends Object implements ExpiryCriteria
A mutable version ofExpiryCriteria
.
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.common.collect.ImmutableSet<String>
labelsToExclude
protected org.joda.time.DateTime
maxBuildCompletedDate
protected Integer
maxBuildNumber
protected Long
maxIgnoredLogSize
protected long
maxResults
protected Integer
minBuildNumberToKeep
protected PlanKey
planKey
protected boolean
requireArtifactLinks
protected Class<? extends ResultsSummary>
resultsSummaryClass
-
Constructor Summary
Constructors Constructor Description MutableExpiryCriteria(@NotNull PlanKey planKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Set<String>
getLabelsToExclude()
A set of labellings to exclude from the search (so to avoid expiring build results with certain labels).@Nullable org.joda.time.DateTime
getMaxBuildCompletedDate()
A criterion for result summaries completion date - will cause to fetch only results completed before the date.@Nullable Integer
getMaxBuildNumber()
A criterion for result summaries that will cause to fetch only results with smaller than or equal build number.@Nullable Long
getMaxIgnoredLogSize()
A threshold for result summariesImmutableResultsSummary.getLogSize()
- the log size must be either unknown or greater than the given value.int
getMaxResults()
Number of results to return.Integer
getMinBuildNumberToKeep()
A criterion for result summaries that will cause to fetch results with smaller build number, regardless ofExpiryCriteria.getMaxBuildCompletedDate()
@NotNull PlanKey
getPlanKey()
A plan key by which theresult summaries
should be filtered.@NotNull Class<? extends ResultsSummary>
getResultsSummaryClass()
The actual class of returned result summaries (eg.boolean
isRequireArtifactLinks()
A filter for result summaries that requires them to have a directly or indirectly linked artifact (eg.void
setLabelsToExclude(@NotNull Iterable<String> labelsToExclude)
void
setMaxBuildCompletedDate(@Nullable org.joda.time.DateTime maxBuildCompletedDate)
void
setMaxBuildNumber(@Nullable Integer maxBuildNumber)
void
setMaxIgnoredLogSize(@Nullable Long maxIgnoredLogSize)
void
setMaxResults(long maxResults)
void
setMinBuildNumberToKeep(Integer minBuildNumberToKeep)
void
setRequireArtifactLinks(boolean requireArtifactLinks)
-
-
-
Field Detail
-
planKey
protected PlanKey planKey
-
resultsSummaryClass
protected Class<? extends ResultsSummary> resultsSummaryClass
-
requireArtifactLinks
protected boolean requireArtifactLinks
-
maxIgnoredLogSize
protected Long maxIgnoredLogSize
-
maxBuildNumber
protected Integer maxBuildNumber
-
minBuildNumberToKeep
protected Integer minBuildNumberToKeep
-
maxBuildCompletedDate
protected org.joda.time.DateTime maxBuildCompletedDate
-
labelsToExclude
protected com.google.common.collect.ImmutableSet<String> labelsToExclude
-
maxResults
protected long maxResults
-
-
Constructor Detail
-
MutableExpiryCriteria
public MutableExpiryCriteria(@NotNull @NotNull PlanKey planKey)
-
-
Method Detail
-
getPlanKey
@NotNull public @NotNull PlanKey getPlanKey()
Description copied from interface:ExpiryCriteria
A plan key by which theresult summaries
should be filtered.- Specified by:
getPlanKey
in interfaceExpiryCriteria
-
getResultsSummaryClass
@NotNull public @NotNull Class<? extends ResultsSummary> getResultsSummaryClass()
Description copied from interface:ExpiryCriteria
The actual class of returned result summaries (eg.ChainResultsSummary
orBuildResultsSummary
).- Specified by:
getResultsSummaryClass
in interfaceExpiryCriteria
-
isRequireArtifactLinks
public boolean isRequireArtifactLinks()
Description copied from interface:ExpiryCriteria
A filter for result summaries that requires them to have a directly or indirectly linked artifact (eg. an artifact link exists for a job result of a chain result).Note that this search criterion and
ExpiryCriteria.getMaxIgnoredLogSize()
criterion are a disjunction (either of the conditions must be met).- Specified by:
isRequireArtifactLinks
in interfaceExpiryCriteria
-
getMaxIgnoredLogSize
@Nullable public @Nullable Long getMaxIgnoredLogSize()
Description copied from interface:ExpiryCriteria
A threshold for result summariesImmutableResultsSummary.getLogSize()
- the log size must be either unknown or greater than the given value.Note that this search criterion and
ExpiryCriteria.isRequireArtifactLinks()
criterion are a disjunction (either of the conditions must be met).- Specified by:
getMaxIgnoredLogSize
in interfaceExpiryCriteria
- Returns:
- the log size threshold (inclusive) or null, if the criterion is not set
-
getMaxBuildNumber
@Nullable public @Nullable Integer getMaxBuildNumber()
Description copied from interface:ExpiryCriteria
A criterion for result summaries that will cause to fetch only results with smaller than or equal build number.- Specified by:
getMaxBuildNumber
in interfaceExpiryCriteria
- Returns:
- the maximum result build number or null, if the criterion is not set
-
getMaxBuildCompletedDate
@Nullable public @Nullable org.joda.time.DateTime getMaxBuildCompletedDate()
Description copied from interface:ExpiryCriteria
A criterion for result summaries completion date - will cause to fetch only results completed before the date.- Specified by:
getMaxBuildCompletedDate
in interfaceExpiryCriteria
- Returns:
- the date or null, if the criterion is not set
-
getLabelsToExclude
@NotNull public @NotNull Set<String> getLabelsToExclude()
Description copied from interface:ExpiryCriteria
A set of labellings to exclude from the search (so to avoid expiring build results with certain labels).- Specified by:
getLabelsToExclude
in interfaceExpiryCriteria
- Returns:
- an immutable set of labels to exclude
-
getMaxResults
public int getMaxResults()
Description copied from interface:ExpiryCriteria
Number of results to return.- Specified by:
getMaxResults
in interfaceExpiryCriteria
-
setRequireArtifactLinks
public void setRequireArtifactLinks(boolean requireArtifactLinks)
-
setMaxIgnoredLogSize
public void setMaxIgnoredLogSize(@Nullable @Nullable Long maxIgnoredLogSize)
-
setMaxBuildNumber
public void setMaxBuildNumber(@Nullable @Nullable Integer maxBuildNumber)
-
setMaxBuildCompletedDate
public void setMaxBuildCompletedDate(@Nullable @Nullable org.joda.time.DateTime maxBuildCompletedDate)
-
setLabelsToExclude
public void setLabelsToExclude(@NotNull @NotNull Iterable<String> labelsToExclude)
-
setMaxResults
public void setMaxResults(long maxResults)
-
getMinBuildNumberToKeep
public Integer getMinBuildNumberToKeep()
Description copied from interface:ExpiryCriteria
A criterion for result summaries that will cause to fetch results with smaller build number, regardless ofExpiryCriteria.getMaxBuildCompletedDate()
- Specified by:
getMinBuildNumberToKeep
in interfaceExpiryCriteria
- Returns:
- the first build number that should be kept or null, if the criterion is not set
-
setMinBuildNumberToKeep
public void setMinBuildNumberToKeep(Integer minBuildNumberToKeep)
-
-