Class ConfigGeneratorAdapter
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.projects.ConfigGeneratorAdapter
-
- All Implemented Interfaces:
ConfigGenerator
public class ConfigGeneratorAdapter extends Object implements ConfigGenerator
-
-
Constructor Summary
Constructors Constructor Description ConfigGeneratorAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanGenerate(String relativePath)Returns true if generator can generate file with the given path relative to project directory.StringgetDescription()Returns generator description which can be used e.g.LoggergetExtraLogger()Returns a logger to be used during configs update in addition to a logger writing into teamcity-server.log or null if log messages should be written to teamcity-server.log onlyFilegetGenerationDir()Returns directory where configs will be generated or null if directory should be created by the updater.booleanrun(File tmpProjectsDir, Set<String> removedProjectExtIds)Should generate projects in the given empty temporary projects dir and add external ids of the removed projects to the given set.
-
-
-
Method Detail
-
run
public boolean run(@NotNull File tmpProjectsDir, @NotNull Set<String> removedProjectExtIds) throws ConfigGenerationExceptionDescription copied from interface:ConfigGeneratorShould generate projects in the given empty temporary projects dir and add external ids of the removed projects to the given set. Files hierarchy should be the same as in TEAMCITY_DATA_DIR/config/projects, i.e. it should contain folder for each updated project.- Specified by:
runin interfaceConfigGenerator- Parameters:
tmpProjectsDir- temporary projects dirremovedProjectExtIds- accumulator of project ids for removal- Returns:
- true of configs on server should be updated, false if update should not be performed
- Throws:
ConfigGenerationException- in case of any errors, if this error is thrown no changes will be made to TeamCity config files will
-
getDescription
@NotNull public String getDescription()
Description copied from interface:ConfigGeneratorReturns generator description which can be used e.g. in the logs- Specified by:
getDescriptionin interfaceConfigGenerator- Returns:
- see above
-
getExtraLogger
@Nullable public Logger getExtraLogger()
Description copied from interface:ConfigGeneratorReturns a logger to be used during configs update in addition to a logger writing into teamcity-server.log or null if log messages should be written to teamcity-server.log only- Specified by:
getExtraLoggerin interfaceConfigGenerator- Returns:
- see above
-
canGenerate
public boolean canGenerate(@NotNull String relativePath)Description copied from interface:ConfigGeneratorReturns true if generator can generate file with the given path relative to project directory. ConfigFilesUpdater assumes that any generator can generate well-known configs: project, build configuration/template, VCS root configs and plugin settings. Updater backs up these files and restores them in case of an update failure. Generator can expand the set of these files by returning true for some file from this method. Only well-known files and files where canGenerate() returns true will be updated in project config directory, other files will be ignored.- Specified by:
canGeneratein interfaceConfigGenerator- Parameters:
relativePath- path relative to project config dir- Returns:
- see above
-
getGenerationDir
@Nullable public File getGenerationDir()
Description copied from interface:ConfigGeneratorReturns directory where configs will be generated or null if directory should be created by the updater.- Specified by:
getGenerationDirin interfaceConfigGenerator- Returns:
- see above
-
-