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 void
branchesMayHaveChanged(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 detectedvoid
changesCollectingFinished(LVcsRootInstance root)
Called when changes collecting is finishedList<VcsRootInstance>
getBuildTypeVcsRoots(LVcsRootInstanceHolder buildType)
BuildTypeChangeRelationCalculator
getChangeRelationCalculator()
VcsChangesLoaderCallback
getChangesLoaderCallback()
Set<BranchSpec>
getCurrentSettingsBranchSpecs(LVcsRootInstance root)
Returns branch specs for the specified VCS root as for settings root.ChangesCollectionLogger
getLogger()
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()
OperationRequestor
getRequestor()
Date
getRequestTimestamp()
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)
VcsChangesLoaderMetrics
getVcsChangesLoaderMetrics()
String
getVersionedSettingsContentDir()
String
getVersionedSettingsRule(LVcsRootInstance root)
static void
handleBranchesChangedEvent(MultiNodesEvents nodesEvents, Collection<LVcsRootInstanceHolder> buildTypes, Date requestTimestamp)
boolean
hasCustomSettings(LVcsRootInstanceHolder buildType, LVcsRootInstance root, CheckoutRules rules)
Returns true if the specified root or checkout rules are different from the one attached to the given buildTypeboolean
isCanceled()
boolean
isImplicitSettingsVcsRoot(LVcsRootInstanceHolder buildType, LVcsRootInstance root)
boolean
isSettingsVcsRoot(LVcsRootInstanceHolder buildType, LVcsRootInstance root)
Returns true if the specified VCS root used to store settings in the given buildTypeboolean
isSettingsVcsRoot(LVcsRootInstance root)
Returns true if the specified VCS root is used for storing versioned settings.void
modificationPersisted(VcsModification modification, VcsRoot root)
Called when modification persisted to databaseboolean
performVcsOperationsInCurrentThread()
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 possiblevoid
reportCollectChangesProblem(VcsRootVcsException exception)
Used to report problems while collecting VCS sources.boolean
saveSettingsBranchSpecs(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.boolean
shouldWaitForChangesCollectionFinishing(LVcsRootInstance inst)
String
toString()
-
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:
getRequestor
in interfaceChangesLoaderContext
-
getRequestTimestamp
@NotNull public Date getRequestTimestamp()
- Specified by:
getRequestTimestamp
in interfaceChangesLoaderContext
-
changesCollectingFinished
public void changesCollectingFinished(@NotNull LVcsRootInstance root)
Description copied from interface:VcsChangesLoaderCallback
Called when changes collecting is finished- Specified by:
changesCollectingFinished
in interfaceVcsChangesLoaderCallback
- Parameters:
root
- root where changes were collected
-
reportCollectChangesProblem
public void reportCollectChangesProblem(@NotNull VcsRootVcsException exception)
Description copied from interface:VcsChangesLoaderCallback
Used to report problems while collecting VCS sources. Related VCS root can be obtained from the exception object.- Specified by:
reportCollectChangesProblem
in interfaceVcsChangesLoaderCallback
- Parameters:
exception
- problem itself.
-
isCanceled
public boolean isCanceled()
- Specified by:
isCanceled
in interfaceChangesLoaderContext
- Returns:
- true if
ChangesLoaderContext
task was canceled
-
modificationPersisted
public void modificationPersisted(@NotNull VcsModification modification, @NotNull VcsRoot root)
Description copied from interface:VcsChangesLoaderCallback
Called when modification persisted to database- Specified by:
modificationPersisted
in interfaceVcsChangesLoaderCallback
- Parameters:
modification
- modification
-
getUsagesForChangesCollecting
@NotNull public Map<SBuildType,CheckoutRules> getUsagesForChangesCollecting(@NotNull LVcsRootInstance vcsRootInstance)
- Specified by:
getUsagesForChangesCollecting
in interfaceChangesLoaderContext
-
getUsagesForChangePersisting
@NotNull public Map<SBuildType,CheckoutRules> getUsagesForChangePersisting(@NotNull ModificationData modificationData)
- Specified by:
getUsagesForChangePersisting
in interfaceChangesLoaderContext
-
getBuildTypeVcsRoots
@NotNull public List<VcsRootInstance> getBuildTypeVcsRoots(@NotNull LVcsRootInstanceHolder buildType)
- Specified by:
getBuildTypeVcsRoots
in interfaceChangesLoaderContext
-
isSettingsVcsRoot
public boolean isSettingsVcsRoot(@NotNull LVcsRootInstance root)
Description copied from interface:ChangesLoaderContext
Returns 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:
isSettingsVcsRoot
in interfaceChangesLoaderContext
- Parameters:
root
- VCS root of interest- Returns:
- see above
-
isImplicitSettingsVcsRoot
public boolean isImplicitSettingsVcsRoot(@NotNull LVcsRootInstanceHolder buildType, @NotNull LVcsRootInstance root)
- Specified by:
isImplicitSettingsVcsRoot
in interfaceChangesLoaderContext
-
getVersionedSettingsContentDir
@NotNull public String getVersionedSettingsContentDir()
- Specified by:
getVersionedSettingsContentDir
in interfaceChangesLoaderContext
-
getVersionedSettingsRule
@NotNull public String getVersionedSettingsRule(@NotNull LVcsRootInstance root)
- Specified by:
getVersionedSettingsRule
in interfaceChangesLoaderContext
-
getChangeRelationCalculator
@NotNull public BuildTypeChangeRelationCalculator getChangeRelationCalculator()
- Specified by:
getChangeRelationCalculator
in interfaceChangesLoaderContext
-
getChangesLoaderCallback
@NotNull public VcsChangesLoaderCallback getChangesLoaderCallback()
- Specified by:
getChangesLoaderCallback
in interfaceChangesLoaderContext
-
performVcsOperationsInCurrentThread
public boolean performVcsOperationsInCurrentThread()
Description copied from interface:ChangesLoaderContext
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 possible- Specified by:
performVcsOperationsInCurrentThread
in interfaceChangesLoaderContext
-
getLogger
@NotNull public ChangesCollectionLogger getLogger()
Description copied from interface:ChangesLoaderContext
Logger for changes collecting process- Specified by:
getLogger
in interfaceChangesLoaderContext
-
getPrevSettingsBranchSpecs
@NotNull public Set<BranchSpec> getPrevSettingsBranchSpecs(@NotNull LVcsRootInstance root)
Description copied from interface:ChangesLoaderContext
Returns 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:
getPrevSettingsBranchSpecs
in interfaceChangesLoaderContext
- Parameters:
root
- VCS root of interest- Returns:
- see above
-
getCurrentSettingsBranchSpecs
@NotNull public Set<BranchSpec> getCurrentSettingsBranchSpecs(@NotNull LVcsRootInstance root)
Description copied from interface:ChangesLoaderContext
Returns 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:
getCurrentSettingsBranchSpecs
in interfaceChangesLoaderContext
- Parameters:
root
- VCS root of interest- Returns:
- see above
-
saveSettingsBranchSpecs
public boolean saveSettingsBranchSpecs(@NotNull LVcsRootInstance root)
Description copied from interface:ChangesLoaderContext
Saves 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:
saveSettingsBranchSpecs
in 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:ChangesLoaderContext
Returns all usages of the specified settings VCS root, including the buildTypes where settings root is attached- Specified by:
getSettingRootUsages
in 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:ChangesLoaderContext
Returns true if the specified VCS root used to store settings in the given buildType- Specified by:
isSettingsVcsRoot
in 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:ChangesLoaderContext
Returns true if the specified root or checkout rules are different from the one attached to the given buildType- Specified by:
hasCustomSettings
in 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:
shouldWaitForChangesCollectionFinishing
in interfaceChangesLoaderContext
-
getReportedProblems
@NotNull public List<VcsRootVcsException> getReportedProblems()
- Specified by:
getReportedProblems
in interfaceChangesLoaderContext
- Returns:
- the list of VCS errors reported via the
VcsChangesLoaderCallback.reportCollectChangesProblem(VcsRootVcsException)
-
getVcsChangesLoaderMetrics
@NotNull public VcsChangesLoaderMetrics getVcsChangesLoaderMetrics()
- Specified by:
getVcsChangesLoaderMetrics
in interfaceChangesLoaderContext
-
branchesMayHaveChanged
public void branchesMayHaveChanged(@NotNull Collection<LVcsRootInstanceHolder> buildTypes)
Description copied from interface:VcsChangesLoaderCallback
Is 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:
branchesMayHaveChanged
in interfaceVcsChangesLoaderCallback
-
handleBranchesChangedEvent
public static void handleBranchesChangedEvent(@NotNull MultiNodesEvents nodesEvents, @NotNull Collection<LVcsRootInstanceHolder> buildTypes, @NotNull Date requestTimestamp)
-
-