Package jetbrains.buildServer.vcs.impl
Class PeriodicChangesLoaderContext
- java.lang.Object
-
- jetbrains.buildServer.vcs.impl.PeriodicChangesLoaderContext
-
- All Implemented Interfaces:
ChangesLoaderContext,VcsChangesLoaderCallback
public class PeriodicChangesLoaderContext extends Object implements ChangesLoaderContext, VcsChangesLoaderCallback
User: kir
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.vcs.ChangesLoaderContext
ChangesLoaderContext.OperationRejectedReason
-
-
Constructor Summary
Constructors Constructor Description PeriodicChangesLoaderContext(BuildServerListener multicaster, VersionedSettingsManager settingsRootManager, BranchSpecs branchSpecs, MultiNodesEvents multiNodesEvents, PeriodicalCheckParameters checkParameters, VcsChangesLoaderMetrics vcsChangesLoaderMetrics)PeriodicChangesLoaderContext(BuildServerListener multicaster, VersionedSettingsManager settingsRootManager, BranchSpecs branchSpecs, MultiNodesEvents multiNodesEvents, VcsChangesLoaderMetrics vcsChangesLoaderMetrics)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbranchesMayHaveChanged(Collection<LVcsRootInstanceHolder> buildTypes)Is called for build types where repository state has been changed as a result of changes collecting or a branch specification change has been detectedvoidchangesCollectingFinished(LVcsRootInstance root)Called when changes collecting is finishedList<VcsRootInstance>getBuildTypeVcsRoots(LVcsRootInstanceHolder buildType)BuildTypeChangeRelationCalculatorgetChangeRelationCalculator()VcsChangesLoaderCallbackgetChangesLoaderCallback()Set<BranchSpec>getCurrentSettingsBranchSpecs(LVcsRootInstance root)Returns branch specs for the specified VCS root as for settings root.ChangesCollectionLoggergetLogger()Logger for changes collecting processSet<BranchSpec>getPrevSettingsBranchSpecs(LVcsRootInstance root)Returns previous branch specs used for changes collecting in the specified VCS root as in versioned settings root.List<VcsRootVcsException>getReportedProblems()OperationRequestorgetRequestor()DategetRequestTimestamp()Map<? extends LVcsRootInstanceHolder,CheckoutRules>getSettingRootUsages(LVcsRootInstance root)Returns all usages of the specified settings VCS root, including the buildTypes where settings root is attachedMap<SBuildType,CheckoutRules>getUsagesForChangePersisting(ModificationData modificationData)Map<SBuildType,CheckoutRules>getUsagesForChangesCollecting(LVcsRootInstance vcsRootInstance)VcsChangesLoaderMetricsgetVcsChangesLoaderMetrics()StringgetVersionedSettingsContentDir()StringgetVersionedSettingsRule(LVcsRootInstance root)static voidhandleBranchesChangedEvent(MultiNodesEvents nodesEvents, Collection<LVcsRootInstanceHolder> buildTypes, Date requestTimestamp)booleanhasCustomSettings(LVcsRootInstanceHolder buildType, LVcsRootInstance root, CheckoutRules rules)Returns true if the specified root or checkout rules are different from the one attached to the given buildTypebooleanisCanceled()booleanisImplicitSettingsVcsRoot(LVcsRootInstanceHolder buildType, LVcsRootInstance root)booleanisSettingsVcsRoot(LVcsRootInstanceHolder buildType, LVcsRootInstance root)Returns true if the specified VCS root used to store settings in the given buildTypebooleanisSettingsVcsRoot(LVcsRootInstance root)Returns true if the specified VCS root is used for storing versioned settings.voidmodificationPersisted(VcsModification modification, VcsRoot root)Called when modification persisted to databasebooleanperformVcsOperationsInCurrentThread()if true, all VCS-related operations will be performed in the same thread, otherwise, changes loader will try to split tasks among other threads if possiblevoidreportCollectChangesProblem(VcsRootVcsException exception)Used to report problems while collecting VCS sources.booleansaveSettingsBranchSpecs(LVcsRootInstance root)Saves branch specs of the specified VCS root previously returned by the getCurrentSettingsBranchSpecs() method, so that the subsequent call to getPrevSettingsBranchSpecs() returns them.booleanshouldWaitForChangesCollectionFinishing(LVcsRootInstance inst)StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.vcs.ChangesLoaderContext
getOperationRejectedReason, isRecoverableError, shouldCollectChangesForVcsRoot
-
-
-
-
Constructor Detail
-
PeriodicChangesLoaderContext
public PeriodicChangesLoaderContext(@NotNull BuildServerListener multicaster, @NotNull VersionedSettingsManager settingsRootManager, @NotNull BranchSpecs branchSpecs, @NotNull MultiNodesEvents multiNodesEvents, @NotNull VcsChangesLoaderMetrics vcsChangesLoaderMetrics)
-
PeriodicChangesLoaderContext
public PeriodicChangesLoaderContext(@NotNull BuildServerListener multicaster, @NotNull VersionedSettingsManager settingsRootManager, @NotNull BranchSpecs branchSpecs, @NotNull MultiNodesEvents multiNodesEvents, @NotNull PeriodicalCheckParameters checkParameters, @NotNull VcsChangesLoaderMetrics vcsChangesLoaderMetrics)
-
-
Method Detail
-
getRequestor
@NotNull public OperationRequestor getRequestor()
- Specified by:
getRequestorin interfaceChangesLoaderContext
-
getRequestTimestamp
@NotNull public Date getRequestTimestamp()
- Specified by:
getRequestTimestampin interfaceChangesLoaderContext
-
changesCollectingFinished
public void changesCollectingFinished(@NotNull LVcsRootInstance root)Description copied from interface:VcsChangesLoaderCallbackCalled when changes collecting is finished- Specified by:
changesCollectingFinishedin interfaceVcsChangesLoaderCallback- Parameters:
root- root where changes were collected
-
reportCollectChangesProblem
public void reportCollectChangesProblem(@NotNull VcsRootVcsException exception)Description copied from interface:VcsChangesLoaderCallbackUsed to report problems while collecting VCS sources. Related VCS root can be obtained from the exception object.- Specified by:
reportCollectChangesProblemin interfaceVcsChangesLoaderCallback- Parameters:
exception- problem itself.
-
isCanceled
public boolean isCanceled()
- Specified by:
isCanceledin interfaceChangesLoaderContext- Returns:
- true if
ChangesLoaderContexttask was canceled
-
modificationPersisted
public void modificationPersisted(@NotNull VcsModification modification, @NotNull VcsRoot root)Description copied from interface:VcsChangesLoaderCallbackCalled when modification persisted to database- Specified by:
modificationPersistedin interfaceVcsChangesLoaderCallback- Parameters:
modification- modification
-
getUsagesForChangesCollecting
@NotNull public Map<SBuildType,CheckoutRules> getUsagesForChangesCollecting(@NotNull LVcsRootInstance vcsRootInstance)
- Specified by:
getUsagesForChangesCollectingin interfaceChangesLoaderContext
-
getUsagesForChangePersisting
@NotNull public Map<SBuildType,CheckoutRules> getUsagesForChangePersisting(@NotNull ModificationData modificationData)
- Specified by:
getUsagesForChangePersistingin interfaceChangesLoaderContext
-
getBuildTypeVcsRoots
@NotNull public List<VcsRootInstance> getBuildTypeVcsRoots(@NotNull LVcsRootInstanceHolder buildType)
- Specified by:
getBuildTypeVcsRootsin interfaceChangesLoaderContext
-
isSettingsVcsRoot
public boolean isSettingsVcsRoot(@NotNull LVcsRootInstance root)Description copied from interface:ChangesLoaderContextReturns true if the specified VCS root is used for storing versioned settings. The root should be one of the roots for which changes are collected.- Specified by:
isSettingsVcsRootin interfaceChangesLoaderContext- Parameters:
root- VCS root of interest- Returns:
- see above
-
isImplicitSettingsVcsRoot
public boolean isImplicitSettingsVcsRoot(@NotNull LVcsRootInstanceHolder buildType, @NotNull LVcsRootInstance root)- Specified by:
isImplicitSettingsVcsRootin interfaceChangesLoaderContext
-
getVersionedSettingsContentDir
@NotNull public String getVersionedSettingsContentDir()
- Specified by:
getVersionedSettingsContentDirin interfaceChangesLoaderContext
-
getVersionedSettingsRule
@NotNull public String getVersionedSettingsRule(@NotNull LVcsRootInstance root)
- Specified by:
getVersionedSettingsRulein interfaceChangesLoaderContext
-
getChangeRelationCalculator
@NotNull public BuildTypeChangeRelationCalculator getChangeRelationCalculator()
- Specified by:
getChangeRelationCalculatorin interfaceChangesLoaderContext
-
getChangesLoaderCallback
@NotNull public VcsChangesLoaderCallback getChangesLoaderCallback()
- Specified by:
getChangesLoaderCallbackin interfaceChangesLoaderContext
-
performVcsOperationsInCurrentThread
public boolean performVcsOperationsInCurrentThread()
Description copied from interface:ChangesLoaderContextif true, all VCS-related operations will be performed in the same thread, otherwise, changes loader will try to split tasks among other threads if possible- Specified by:
performVcsOperationsInCurrentThreadin interfaceChangesLoaderContext
-
getLogger
@NotNull public ChangesCollectionLogger getLogger()
Description copied from interface:ChangesLoaderContextLogger for changes collecting process- Specified by:
getLoggerin interfaceChangesLoaderContext
-
getPrevSettingsBranchSpecs
@NotNull public Set<BranchSpec> getPrevSettingsBranchSpecs(@NotNull LVcsRootInstance root)
Description copied from interface:ChangesLoaderContextReturns previous branch specs used for changes collecting in the specified VCS root as in versioned settings root. If root is not used for storing settings, then empty set is returned.- Specified by:
getPrevSettingsBranchSpecsin interfaceChangesLoaderContext- Parameters:
root- VCS root of interest- Returns:
- see above
-
getCurrentSettingsBranchSpecs
@NotNull public Set<BranchSpec> getCurrentSettingsBranchSpecs(@NotNull LVcsRootInstance root)
Description copied from interface:ChangesLoaderContextReturns branch specs for the specified VCS root as for settings root. If root is not used for storing settings, then empty set is returned. The implementation saves the returned result in order to store it during a subsequent saveSettingsBranchSpecs() call.- Specified by:
getCurrentSettingsBranchSpecsin interfaceChangesLoaderContext- Parameters:
root- VCS root of interest- Returns:
- see above
-
saveSettingsBranchSpecs
public boolean saveSettingsBranchSpecs(@NotNull LVcsRootInstance root)Description copied from interface:ChangesLoaderContextSaves branch specs of the specified VCS root previously returned by the getCurrentSettingsBranchSpecs() method, so that the subsequent call to getPrevSettingsBranchSpecs() returns them. Returns true if settings VCS root or its branch specification were changed comparing to their previous values in at least one project.- Specified by:
saveSettingsBranchSpecsin interfaceChangesLoaderContext- Parameters:
root- settings root of interest- Returns:
- see above
-
getSettingRootUsages
@NotNull public Map<? extends LVcsRootInstanceHolder,CheckoutRules> getSettingRootUsages(@NotNull LVcsRootInstance root)
Description copied from interface:ChangesLoaderContextReturns all usages of the specified settings VCS root, including the buildTypes where settings root is attached- Specified by:
getSettingRootUsagesin interfaceChangesLoaderContext- Parameters:
root- settings VCS root of interest- Returns:
- see above
-
isSettingsVcsRoot
public boolean isSettingsVcsRoot(@NotNull LVcsRootInstanceHolder buildType, @NotNull LVcsRootInstance root)Description copied from interface:ChangesLoaderContextReturns true if the specified VCS root used to store settings in the given buildType- Specified by:
isSettingsVcsRootin interfaceChangesLoaderContext- Parameters:
buildType- buildType of interestroot- VCS root of interest- Returns:
- see above
-
hasCustomSettings
public boolean hasCustomSettings(@NotNull LVcsRootInstanceHolder buildType, @NotNull LVcsRootInstance root, @NotNull CheckoutRules rules)Description copied from interface:ChangesLoaderContextReturns true if the specified root or checkout rules are different from the one attached to the given buildType- Specified by:
hasCustomSettingsin interfaceChangesLoaderContext- Parameters:
buildType- buildType of interestroot- VCS root instance to checkrules- checkout rules to check- Returns:
- see above
-
shouldWaitForChangesCollectionFinishing
public boolean shouldWaitForChangesCollectionFinishing(@NotNull LVcsRootInstance inst)- Specified by:
shouldWaitForChangesCollectionFinishingin interfaceChangesLoaderContext
-
getReportedProblems
@NotNull public List<VcsRootVcsException> getReportedProblems()
- Specified by:
getReportedProblemsin interfaceChangesLoaderContext- Returns:
- the list of VCS errors reported via the
VcsChangesLoaderCallback.reportCollectChangesProblem(VcsRootVcsException)
-
getVcsChangesLoaderMetrics
@NotNull public VcsChangesLoaderMetrics getVcsChangesLoaderMetrics()
- Specified by:
getVcsChangesLoaderMetricsin interfaceChangesLoaderContext
-
branchesMayHaveChanged
public void branchesMayHaveChanged(@NotNull Collection<LVcsRootInstanceHolder> buildTypes)Description copied from interface:VcsChangesLoaderCallbackIs called for build types where repository state has been changed as a result of changes collecting or a branch specification change has been detected- Specified by:
branchesMayHaveChangedin interfaceVcsChangesLoaderCallback
-
handleBranchesChangedEvent
public static void handleBranchesChangedEvent(@NotNull MultiNodesEvents nodesEvents, @NotNull Collection<LVcsRootInstanceHolder> buildTypes, @NotNull Date requestTimestamp)
-
-