Class ReloadProjectsConfig
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.projects.ReloadProjectsConfig
-
public class ReloadProjectsConfig extends Object
-
-
Constructor Summary
Constructors Constructor Description ReloadProjectsConfig()
ReloadProjectsConfig(Collection<File> newFiles, Collection<File> changedFiles, Collection<File> removedFiles)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProjectsLoaderCallback
getCallback()
Returns a callback for notifications about project model changes or null if no notifications are neededCollection<File>
getChangedFiles()
Returns changed files to reloadProjectManagerErrors
getConfigErrors()
Returns errors collector or null if default errors collector should be usedBooleanSupplier
getExitSupplier()
Returns an exit supplier, if it returns true projects reload should exit without trying to update projects modelProjectModelVersionSnapshot
getExpectedVersions()
Returns expected versions snapshot or null if it wasn't setLong
getLockTimeoutMillis()
Returns timeout in milliseconds for getting an exclusive lock on a project model or null if it wasn't setCollection<File>
getNewFiles()
Returns new files to reloadString
getOriginNodeId()
ProjectConfigContentProvider
getProjectConfigContentProvider()
Collection<File>
getRemovedFiles()
Returns removed filesUuidChecker
getUuidChecker()
boolean
isAllowCrossHierarchyTemplates()
Returns true if buildTypes can refer templates which are not accessible in their projectsboolean
isIncrementalUpdate()
boolean
isLoadProjectsEvenIfTheirPartsAreBroken()
Returns false if TeamCity should not load the whole project if at least one error is detected in project-related configs (project's roots, buildTypes, templates, project itself), otherwise true.boolean
isRestoreBuildsHistory()
void
setAllowCrossHierarchyTemplates(boolean allowCrossHierarchyTemplates)
Specifies whether buildTypes can refer templates which are not accessible in their projects, by default it is falsevoid
setCallback(ProjectsLoaderCallback callback)
Sets a callback for notification about project model changes, if not specified or null, then notifications will not be sentvoid
setChangedFiles(Collection<File> changedFiles)
Sets changed files to reloadvoid
setConfigErrors(ProjectManagerErrors configErrors)
Sets errors collector, if errors collector is not specified or null, then the default one will be usedvoid
setExitSupplier(BooleanSupplier exitSupplier)
Sets the supplier which result is checked for early exit, e.g.void
setExpectedVersions(ProjectModelVersionSnapshot expectedVersions)
Sets expected versions of project model.void
setIncrementalUpdate(boolean incrementalUpdate)
void
setLoadProjectsEvenIfTheirPartsAreBroken(boolean loadProjectsEvenIfTheirPartsAreBroken)
Specify if TeamCity should take changes in project configs into account if there are errors in some configs related to project.void
setLockTimeoutMillis(Long lockTimeoutMillis)
Sets project model exclusive lock timeout.void
setNewFiles(Collection<File> newFiles)
Sets new files to reloadvoid
setOriginNodeId(String originNodeId)
Sets node id which started changing the project configuration files (via background tasks)void
setProjectConfigContentProvider(ProjectConfigContentProvider projectConfigContentProvider)
void
setRemovedFiles(Collection<File> removedFiles)
Sets removed filesvoid
setRestoreBuildsHistory(boolean restoreBuildsHistory)
Set to true to enable "restore builds history" heuristic.void
setUuidChecker(UuidChecker uuidChecker)
-
-
-
Constructor Detail
-
ReloadProjectsConfig
public ReloadProjectsConfig()
-
ReloadProjectsConfig
public ReloadProjectsConfig(@NotNull Collection<File> newFiles, @NotNull Collection<File> changedFiles, @NotNull Collection<File> removedFiles)
-
-
Method Detail
-
getNewFiles
@NotNull public Collection<File> getNewFiles()
Returns new files to reload- Returns:
- see above
-
setNewFiles
public void setNewFiles(@NotNull Collection<File> newFiles)
Sets new files to reload- Parameters:
newFiles
- new config files
-
getChangedFiles
@NotNull public Collection<File> getChangedFiles()
Returns changed files to reload- Returns:
- see above
-
setChangedFiles
public void setChangedFiles(@NotNull Collection<File> changedFiles)
Sets changed files to reload- Parameters:
changedFiles
- changed config files
-
getRemovedFiles
@NotNull public Collection<File> getRemovedFiles()
Returns removed files- Returns:
- see above
-
setRemovedFiles
public void setRemovedFiles(@NotNull Collection<File> removedFiles)
Sets removed files- Parameters:
removedFiles
- removed files
-
getConfigErrors
@Nullable public ProjectManagerErrors getConfigErrors()
Returns errors collector or null if default errors collector should be used- Returns:
- see above
-
setConfigErrors
public void setConfigErrors(ProjectManagerErrors configErrors)
Sets errors collector, if errors collector is not specified or null, then the default one will be used- Parameters:
configErrors
- errors collector of interest
-
getCallback
@Nullable public ProjectsLoaderCallback getCallback()
Returns a callback for notifications about project model changes or null if no notifications are needed- Returns:
- see above
-
setCallback
public void setCallback(ProjectsLoaderCallback callback)
Sets a callback for notification about project model changes, if not specified or null, then notifications will not be sent- Parameters:
callback
-
-
isLoadProjectsEvenIfTheirPartsAreBroken
public boolean isLoadProjectsEvenIfTheirPartsAreBroken()
Returns false if TeamCity should not load the whole project if at least one error is detected in project-related configs (project's roots, buildTypes, templates, project itself), otherwise true.- Returns:
-
setLoadProjectsEvenIfTheirPartsAreBroken
public void setLoadProjectsEvenIfTheirPartsAreBroken(boolean loadProjectsEvenIfTheirPartsAreBroken)
Specify if TeamCity should take changes in project configs into account if there are errors in some configs related to project. False by default, meaning that if there is at least one error in project-related configs changes for the whole project are ignored.- Parameters:
loadProjectsEvenIfTheirPartsAreBroken
-
-
setExitSupplier
public void setExitSupplier(@NotNull BooleanSupplier exitSupplier)
Sets the supplier which result is checked for early exit, e.g. due to errors. Default supplier always returns false which means TeamCity should try to reload projects even if there are some config errors.- Parameters:
exit
- exit supplier, should return true if projects reload should return
-
getExitSupplier
@NotNull public BooleanSupplier getExitSupplier()
Returns an exit supplier, if it returns true projects reload should exit without trying to update projects model- Returns:
- see above
-
getExpectedVersions
public ProjectModelVersionSnapshot getExpectedVersions()
Returns expected versions snapshot or null if it wasn't set- Returns:
- see above
-
setExpectedVersions
public void setExpectedVersions(ProjectModelVersionSnapshot expectedVersions)
Sets expected versions of project model. Project model won't be updated if any of updated projects were changed since the time snapshot was taken. Update will fail with theOutdatedProjectModelException
containing diff between the expected snapshot and current versions on the moment of update.- Parameters:
expectedVersions
- expected versions snapshot
-
isRestoreBuildsHistory
public boolean isRestoreBuildsHistory()
- Since:
- 2023.03
-
setRestoreBuildsHistory
public void setRestoreBuildsHistory(boolean restoreBuildsHistory)
Set to true to enable "restore builds history" heuristic. If this is enabled then for a removed build configurations without uuid TeamCity will try to guess whether the build configuration was actually removed or whether its external id was changed. In the latter case it will reassign the builds history to the build configuration with the similar settings but new id. The default is 'false'.- Parameters:
restoreBuildsHistory
-- Since:
- 2023.03
-
getLockTimeoutMillis
@Nullable public Long getLockTimeoutMillis()
Returns timeout in milliseconds for getting an exclusive lock on a project model or null if it wasn't set- Returns:
- see above
-
setLockTimeoutMillis
public void setLockTimeoutMillis(Long lockTimeoutMillis)
Sets project model exclusive lock timeout. If lock is not obtained within the specified timeout, then project model won't be updated. If not specified, then Long.MAX_VALUE is used.- Parameters:
lockTimeoutMillis
- timeout in milliseconds
-
isAllowCrossHierarchyTemplates
public boolean isAllowCrossHierarchyTemplates()
Returns true if buildTypes can refer templates which are not accessible in their projects- Returns:
- see above
-
setAllowCrossHierarchyTemplates
public void setAllowCrossHierarchyTemplates(boolean allowCrossHierarchyTemplates)
Specifies whether buildTypes can refer templates which are not accessible in their projects, by default it is false- Parameters:
allowCrossHierarchyTemplates
- whether buildTypes can refer inaccessible templates
-
getUuidChecker
@NotNull public UuidChecker getUuidChecker()
-
setUuidChecker
public void setUuidChecker(@NotNull UuidChecker uuidChecker)
-
getProjectConfigContentProvider
@Nullable public ProjectConfigContentProvider getProjectConfigContentProvider()
-
setProjectConfigContentProvider
public void setProjectConfigContentProvider(@NotNull ProjectConfigContentProvider projectConfigContentProvider)
-
isIncrementalUpdate
public boolean isIncrementalUpdate()
-
setIncrementalUpdate
public void setIncrementalUpdate(boolean incrementalUpdate)
-
getOriginNodeId
@NotNull public String getOriginNodeId()
-
setOriginNodeId
public void setOriginNodeId(@NotNull String originNodeId)
Sets node id which started changing the project configuration files (via background tasks)- Parameters:
originNodeId
-
-
-