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 boolean
canGenerate(String relativePath)
Returns true if generator can generate file with the given path relative to project directory.String
getDescription()
Returns generator description which can be used e.g.Logger
getExtraLogger()
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 onlyFile
getGenerationDir()
Returns directory where configs will be generated or null if directory should be created by the updater.boolean
run(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 ConfigGenerationException
Description copied from interface:ConfigGenerator
Should 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:
run
in 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:ConfigGenerator
Returns generator description which can be used e.g. in the logs- Specified by:
getDescription
in interfaceConfigGenerator
- Returns:
- see above
-
getExtraLogger
@Nullable public Logger getExtraLogger()
Description copied from interface:ConfigGenerator
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 only- Specified by:
getExtraLogger
in interfaceConfigGenerator
- Returns:
- see above
-
canGenerate
public boolean canGenerate(@NotNull String relativePath)
Description copied from interface:ConfigGenerator
Returns 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:
canGenerate
in interfaceConfigGenerator
- Parameters:
relativePath
- path relative to project config dir- Returns:
- see above
-
getGenerationDir
@Nullable public File getGenerationDir()
Description copied from interface:ConfigGenerator
Returns directory where configs will be generated or null if directory should be created by the updater.- Specified by:
getGenerationDir
in interfaceConfigGenerator
- Returns:
- see above
-
-