Class KeepRuleImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.cleanup.v2019.rules.KeepRuleImpl
-
- All Implemented Interfaces:
SKeepRule,DbFieldsProvider,KeepRule
public class KeepRuleImpl extends Object implements SKeepRule
- Since:
- 2019.1
- See Also:
StorableRule
-
-
Constructor Summary
Constructors Constructor Description KeepRuleImpl(Set<KeepBuildDataPart> keepBuildDataParts, Set<KeepFilter> filters, Set<KeepPartition> partitions, KeepLimit limit, boolean preserveArtifactDependencies)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Long>computeBuildIdsToKeepStatistics(String buildTypeId, DbBuildsData buildsData)Returns such ids of the provided builds, statistical data of which should be kept.static KeepLevelcomputeHigherLevel(Collection<KeepBuildDataPart> keepBuildDataParts)Returns higher keep level of the provided keep build data parts.Map<Long,Collection<KeepBuildDataPart>>computeHistoryBuildsDataToKeep(String buildTypeId, DbBuildsData historyBuildsData)Computes data to keep for every incoming history build.booleanequals(Object o)Collection<KeepFilter>getFilters()Only builds satisfying all the filters will be kept by this rule.Collection<KeepBuildDataPart>getKeepBuildDataParts()KeepLimitgetLimit()Limits builds to keep (after filtering, for every partition subset).Collection<KeepPartition>getPartitions()Provides builds partitioning to subsets: builds are in the same subset if they are in the same partition for every partition.inthashCode()booleanshouldPreserveArtifactDependencies()Defines should all artifact dependencies (some builds typically from another build configurations) be kept for such builds, history of which is preserved by this rule, i.e.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.impl.cleanup.SKeepRule
getRequiredDbFields
-
-
-
-
Constructor Detail
-
KeepRuleImpl
public KeepRuleImpl(@NotNull Set<KeepBuildDataPart> keepBuildDataParts, @NotNull Set<KeepFilter> filters, @NotNull Set<KeepPartition> partitions, @NotNull KeepLimit limit, boolean preserveArtifactDependencies) throws IllegalRuleException- Throws:
IllegalRuleException
-
-
Method Detail
-
getKeepBuildDataParts
@NotNull public Collection<KeepBuildDataPart> getKeepBuildDataParts()
- Specified by:
getKeepBuildDataPartsin interfaceSKeepRule
-
getFilters
@NotNull public Collection<KeepFilter> getFilters()
Description copied from interface:SKeepRuleOnly builds satisfying all the filters will be kept by this rule.- Specified by:
getFiltersin interfaceSKeepRule
-
getPartitions
@NotNull public Collection<KeepPartition> getPartitions()
Description copied from interface:SKeepRuleProvides builds partitioning to subsets: builds are in the same subset if they are in the same partition for every partition. Preserving will be applied for every subset separately.- Specified by:
getPartitionsin interfaceSKeepRule
-
getLimit
@NotNull public KeepLimit getLimit()
Description copied from interface:SKeepRuleLimits builds to keep (after filtering, for every partition subset).
-
shouldPreserveArtifactDependencies
public boolean shouldPreserveArtifactDependencies()
Description copied from interface:KeepRuleDefines should all artifact dependencies (some builds typically from another build configurations) be kept for such builds, history of which is preserved by this rule, i.e.KeepRule.computeHistoryBuildsDataToKeep(String, DbBuildsData))} result has aKeepBuildDataPartwith levelKeepLevel.HISTORYor stronger for build.- Specified by:
shouldPreserveArtifactDependenciesin interfaceKeepRule
-
computeHistoryBuildsDataToKeep
@NotNull public Map<Long,Collection<KeepBuildDataPart>> computeHistoryBuildsDataToKeep(@NotNull String buildTypeId, @NotNull DbBuildsData historyBuildsData)
Description copied from interface:KeepRuleComputes data to keep for every incoming history build. If no data of some build should be kept, its id should be either absent in the result either data parts collection should be empty. There is no sense to return suchKeepBuildDataPartthat do not keep history.
AllhistoryBuildsDatamust belong to the same build configuration with idbuildTypeId.- Specified by:
computeHistoryBuildsDataToKeepin interfaceKeepRule- Returns:
- map from build id to collection of build data parts to keep
-
computeBuildIdsToKeepStatistics
@NotNull public Collection<Long> computeBuildIdsToKeepStatistics(@NotNull String buildTypeId, @NotNull DbBuildsData buildsData)
Description copied from interface:KeepRuleReturns such ids of the provided builds, statistical data of which should be kept.
AllbuildsDatamust belong to the same build configuration with idbuildTypeId.- Specified by:
computeBuildIdsToKeepStatisticsin interfaceKeepRule- Returns:
- build ids to keep
-
computeHigherLevel
@NotNull public static KeepLevel computeHigherLevel(@NotNull Collection<KeepBuildDataPart> keepBuildDataParts)
Returns higher keep level of the provided keep build data parts. Can beKeepLevel.STATISTICSor stronger (more preserving).
-
-