Interface ConfigFilesUpdater
-
- All Known Implementing Classes:
ConfigFilesUpdaterImpl
public interface ConfigFilesUpdater
Updates TeamCity configs
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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
updateConfigs(ConfigGenerator generator)
Same asscheduleUpdateConfigTask(ConfigGenerator, ConfigUpdateCallback, ConfigFilesUpdateOptions, ConfigCauseInfo)
but with default callback which does nothing and default options.
-
-
-
Method Detail
-
updateConfigs
void updateConfigs(@NotNull ConfigGenerator generator) throws ConfigBackupException, ConfigGenerationException, ConfigUpdateException, ProjectSettingsException
Same asscheduleUpdateConfigTask(ConfigGenerator, ConfigUpdateCallback, ConfigFilesUpdateOptions, ConfigCauseInfo)
but with default callback which does nothing and default options. This method also waits for the operation to complete- 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.ProjectSettingsException
- ifProjectsLoader
failed to load updated projects; this exception is logged by the updater into extra loggers provided by the generatorConfigRollbackException
- if updater failed to rollback changes after unsuccessful update, contains details for manual rollback; this exception is logged by the updater into extra loggers provided by the generatorConfigUpdateException
- in case of errors during configs update; this exception is logged by the updater into extra loggers provided by the generator
-
scheduleUpdateConfigTask
@NotNull PersistTask scheduleUpdateConfigTask(@NotNull ConfigGenerator generator, @NotNull ConfigUpdateCallback callback, @NotNull ConfigFilesUpdateOptions options, @NotNull ConfigCauseInfo configCauseInfo)
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).- 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
-
-