Class ConfigFilesUpdaterImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.projects.ConfigFilesUpdaterImpl
-
- All Implemented Interfaces:
ConfigFilesUpdater
public class ConfigFilesUpdaterImpl extends Object implements ConfigFilesUpdater
-
-
Field Summary
Fields Modifier and Type Field Description static String
AUTOMATICALLY_RESTORE_BUILDS_HISTORY
static String
TIMEOUT
-
Constructor Summary
Constructors Constructor Description ConfigFilesUpdaterImpl(BuildServerState serverState, ServerPaths paths, ConfigFileSystem fs, ProjectsLoader projectsLoader, ProjectManagerEx projectManager, ProjectManagerErrors configErrors, ProjectIdentifiersManager projectIdentifiersManager, Trash trash, CentralConfigsRepository centralConfigsRepository)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
isKnownConfig(String relativePath)
PersistTask
scheduleUpdateConfigTask(ConfigGenerator generator, ConfigUpdateCallback callback, ConfigFilesUpdateOptions options, ConfigCauseInfo configCauseInfo)
Schedules execution of the given generator with disabled files changes observer, detects changed configs and reload affected projects.void
setProjectsPersister(ProjectsPersister projectsPersister)
void
updateConfigs(ConfigGenerator generator)
Same asConfigFilesUpdater.scheduleUpdateConfigTask(ConfigGenerator, ConfigUpdateCallback, ConfigFilesUpdateOptions, ConfigCauseInfo)
but with default callback which does nothing and default options.
-
-
-
Field Detail
-
TIMEOUT
public static final String TIMEOUT
- See Also:
- Constant Field Values
-
AUTOMATICALLY_RESTORE_BUILDS_HISTORY
public static final String AUTOMATICALLY_RESTORE_BUILDS_HISTORY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConfigFilesUpdaterImpl
public ConfigFilesUpdaterImpl(@NotNull BuildServerState serverState, @NotNull ServerPaths paths, @NotNull ConfigFileSystem fs, @NotNull ProjectsLoader projectsLoader, @NotNull ProjectManagerEx projectManager, @NotNull ProjectManagerErrors configErrors, @NotNull ProjectIdentifiersManager projectIdentifiersManager, @NotNull Trash trash, @NotNull CentralConfigsRepository centralConfigsRepository)
-
-
Method Detail
-
setProjectsPersister
public void setProjectsPersister(@Nullable ProjectsPersister projectsPersister)
-
updateConfigs
public void updateConfigs(@NotNull ConfigGenerator generator) throws ConfigBackupException, ConfigGenerationException, ConfigUpdateException, ProjectSettingsException
Description copied from interface:ConfigFilesUpdater
Same asConfigFilesUpdater.scheduleUpdateConfigTask(ConfigGenerator, ConfigUpdateCallback, ConfigFilesUpdateOptions, ConfigCauseInfo)
but with default callback which does nothing and default options. This method also waits for the operation to complete- Specified by:
updateConfigs
in interfaceConfigFilesUpdater
- Throws:
ConfigBackupException
- if updater failed to backup project settings before update; this exception is logged by updater into extra loggers provided by the generatorConfigGenerationException
- in case of errors during generation. If the generator throws an ConfigGenerationException, it is rethrown without changes so caller doesn't need to save the error anywhere. If generator throws some other error, it is wrapped in ConfigGenerationException and can be retrieved using getCause() method. This error is not logged by the updater.ConfigUpdateException
- in case of errors during configs update; this exception is logged by the updater into extra loggers provided by the generatorProjectSettingsException
- ifProjectsLoader
failed to load updated projects; this exception is logged by the updater into extra loggers provided by the generator
-
scheduleUpdateConfigTask
@NotNull public PersistTask scheduleUpdateConfigTask(@NotNull ConfigGenerator generator, @NotNull ConfigUpdateCallback callback, @NotNull ConfigFilesUpdateOptions options, @NotNull ConfigCauseInfo configCauseInfo)
Description copied from interface:ConfigFilesUpdater
Schedules execution of the given generator with disabled files changes observer, detects changed configs and reload affected projects. Makes a backup before updating projects, restores projects from backups in case of any errors (rolls back all the changes made by generator).- Specified by:
scheduleUpdateConfigTask
in interfaceConfigFilesUpdater
- Parameters:
generator
- configs generator to runcallback
- callback notified about stages of configs updateoptions
- options for updaterconfigCauseInfo
- contains information about cause of the config update- Returns:
- task which can be used for waiting or cancelling of the operation
-
isKnownConfig
public static boolean isKnownConfig(String relativePath)
-
-