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 String
ARTIFACT_PATTERNS_PARAM
-
Constructor Summary
Constructors Modifier Constructor Description protected
HistoryRetentionPolicy(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 void
appendParametersDescription(StringBuilder description)
int
compareTo(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)
boolean
equals(Object o)
protected Set<String>
getActiveBranchNames(SBuildType buildType)
String
getArtifactPatterns()
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)
CleanupLevel
getCleanupLevel()
String
getDescription()
String
getId()
Returns unique id of this descriptorMap<String,String>
getParameters()
Returns parameters map.String
getType()
Returns type of the parametersint
hashCode()
protected void
reportDecision(CleanupDecisionListener decisionListener, long buildId, boolean matched, String format, Object... args)
protected void
reportDecisionWithoutDetails(CleanupDecisionListener decisionListener, long buildId, boolean matched, String detailsAbsenceReason)
protected void
reportPinnedBuild(CleanupDecisionListener decisionListener, long buildId)
protected void
reportUnresolvedBuildType(CleanupDecisionListener decisionListener, String buildTypeId, ProjectManagerEx projectManager)
String
toString()
-
-
-
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:ParametersDescriptor
Returns unique id of this descriptor- Specified by:
getId
in interfaceParametersDescriptor
- Returns:
- unique id of this descriptor
-
getType
@NotNull public String getType()
Description copied from interface:ParametersDescriptor
Returns type of the parameters- Specified by:
getType
in interfaceParametersDescriptor
- Returns:
- parameters type
-
getArtifactPatterns
@NotNull public String getArtifactPatterns()
Description copied from interface:CleanupPolicy
Artifact patterns are intended for TeamCity internal usage only. Empty string means clean all artifacts.- Specified by:
getArtifactPatterns
in 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:ParametersDescriptor
Returns parameters map.- Specified by:
getParameters
in interfaceParametersDescriptor
- Returns:
- parameters map
-
compareTo
public int compareTo(@NotNull HistoryRetentionPolicy o)
- Specified by:
compareTo
in interfaceComparable<HistoryRetentionPolicy>
-
-