Class ConfigGeneratorAdapter

    • Constructor Detail

      • ConfigGeneratorAdapter

        public ConfigGeneratorAdapter()
    • 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 interface ConfigGenerator
        Parameters:
        tmpProjectsDir - temporary projects dir
        removedProjectExtIds - 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 interface ConfigGenerator
        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 interface ConfigGenerator
        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 interface ConfigGenerator
        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 interface ConfigGenerator
        Returns:
        see above