Class HistoryRetentionPolicy
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.cleanup.HistoryRetentionPolicy
-
- All Implemented Interfaces:
Comparable<HistoryRetentionPolicy>,CleanupPolicy,ParametersDescriptor
- Direct Known Subclasses:
KeepNBuildsPolicy,KeepNDaysMBuildsPolicy,KeepNDaysPolicy,KeepNothingPolicy
public abstract class HistoryRetentionPolicy extends Object implements CleanupPolicy, Comparable<HistoryRetentionPolicy>
A base rule part for one cleanup level.- See Also:
BaseKeepRule,CleanupPolicyBuilderImpl.write(Element),CleanupPolicyFactory.readFromElement(org.jdom.Element)
-
-
Field Summary
Fields Modifier and Type Field Description static StringARTIFACT_PATTERNS_PARAM
-
Constructor Summary
Constructors Modifier Constructor Description protectedHistoryRetentionPolicy(String id, String policyType, Map<String,String> parameters, CleanupLevel cleanupLevel)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidappendParametersDescription(StringBuilder description)intcompareTo(HistoryRetentionPolicy o)protected abstract Map<String,jetbrains.buildServer.serverSide.impl.cleanup.BuildsPerSeries>computeBuildTypeIdToBuildsToClean(DBFunctions dbf, Collection<String> buildTypeIds, int packSize, ProjectManagerEx projectManager, jetbrains.buildServer.serverSide.impl.cleanup.CleanupStatistics statistics, CleanupDecisionListener decisionListener)booleanequals(Object o)protected Set<String>getActiveBranchNames(SBuildType buildType)StringgetArtifactPatterns()Artifact patterns are intended for TeamCity internal usage only.Map<String,gnu.trove.list.TLongList>getBuildsToClean(DBFunctions dbf, Collection<String> buildTypeIds, int packSize, ProjectManagerEx projectManager, jetbrains.buildServer.serverSide.impl.cleanup.CleanupStatistics statistics, CleanupDecisionListener decisionListener)CleanupLevelgetCleanupLevel()StringgetDescription()StringgetId()Returns unique id of this descriptorMap<String,String>getParameters()Returns parameters map.StringgetType()Returns type of the parametersinthashCode()protected voidreportDecision(CleanupDecisionListener decisionListener, long buildId, boolean matched, String format, Object... args)protected voidreportDecisionWithoutDetails(CleanupDecisionListener decisionListener, long buildId, boolean matched, String detailsAbsenceReason)protected voidreportPinnedBuild(CleanupDecisionListener decisionListener, long buildId)protected voidreportUnresolvedBuildType(CleanupDecisionListener decisionListener, String buildTypeId, ProjectManagerEx projectManager)StringtoString()
-
-
-
Field Detail
-
ARTIFACT_PATTERNS_PARAM
public static final String ARTIFACT_PATTERNS_PARAM
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBuildsToClean
@NotNull public Map<String,gnu.trove.list.TLongList> getBuildsToClean(@NotNull DBFunctions dbf, @NotNull Collection<String> buildTypeIds, int packSize, @NotNull ProjectManagerEx projectManager, @NotNull jetbrains.buildServer.serverSide.impl.cleanup.CleanupStatistics statistics, @NotNull CleanupDecisionListener decisionListener) throws DBException
- Throws:
DBException
-
computeBuildTypeIdToBuildsToClean
@NotNull protected abstract Map<String,jetbrains.buildServer.serverSide.impl.cleanup.BuildsPerSeries> computeBuildTypeIdToBuildsToClean(@NotNull DBFunctions dbf, @NotNull Collection<String> buildTypeIds, int packSize, @NotNull ProjectManagerEx projectManager, @NotNull jetbrains.buildServer.serverSide.impl.cleanup.CleanupStatistics statistics, @NotNull CleanupDecisionListener decisionListener)
-
getId
@NotNull public String getId()
Description copied from interface:ParametersDescriptorReturns unique id of this descriptor- Specified by:
getIdin interfaceParametersDescriptor- Returns:
- unique id of this descriptor
-
getType
@NotNull public String getType()
Description copied from interface:ParametersDescriptorReturns type of the parameters- Specified by:
getTypein interfaceParametersDescriptor- Returns:
- parameters type
-
getArtifactPatterns
@NotNull public String getArtifactPatterns()
Description copied from interface:CleanupPolicyArtifact patterns are intended for TeamCity internal usage only. Empty string means clean all artifacts.- Specified by:
getArtifactPatternsin interfaceCleanupPolicy- Returns:
- artifact patterns or empty string if there is no artifact patterns in the policy.
-
getDescription
public String getDescription()
-
appendParametersDescription
protected abstract void appendParametersDescription(@NotNull StringBuilder description)
-
getCleanupLevel
@NotNull public CleanupLevel getCleanupLevel()
-
getActiveBranchNames
@NotNull protected Set<String> getActiveBranchNames(@NotNull SBuildType buildType)
-
reportUnresolvedBuildType
protected void reportUnresolvedBuildType(@NotNull CleanupDecisionListener decisionListener, @NotNull String buildTypeId, @NotNull ProjectManagerEx projectManager)
-
reportPinnedBuild
protected void reportPinnedBuild(@NotNull CleanupDecisionListener decisionListener, long buildId)
-
reportDecision
protected void reportDecision(@NotNull CleanupDecisionListener decisionListener, long buildId, boolean matched, @NotNull String format, Object... args)
-
reportDecisionWithoutDetails
protected void reportDecisionWithoutDetails(@NotNull CleanupDecisionListener decisionListener, long buildId, boolean matched, @Nullable String detailsAbsenceReason)
-
getParameters
@NotNull public Map<String,String> getParameters()
Description copied from interface:ParametersDescriptorReturns parameters map.- Specified by:
getParametersin interfaceParametersDescriptor- Returns:
- parameters map
-
compareTo
public int compareTo(@NotNull HistoryRetentionPolicy o)- Specified by:
compareToin interfaceComparable<HistoryRetentionPolicy>
-
-