Search in sources :

Example 1 with MigrationStep

use of org.sonar.server.platform.db.migration.step.MigrationStep in project sonarqube by SonarSource.

the class MigrationContainerPopulatorImpl method populateFromMigrationSteps.

private static void populateFromMigrationSteps(MigrationContainer container) {
    MigrationSteps migrationSteps = container.getComponentByType(MigrationSteps.class);
    Set<Class<? extends MigrationStep>> classes = new HashSet<>();
    migrationSteps.readAll().forEach(step -> {
        Class<? extends MigrationStep> stepClass = step.getStepClass();
        if (!classes.contains(stepClass)) {
            container.add(stepClass);
            classes.add(stepClass);
        }
    });
}
Also used : MigrationStep(org.sonar.server.platform.db.migration.step.MigrationStep) MigrationSteps(org.sonar.server.platform.db.migration.step.MigrationSteps) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 MigrationStep (org.sonar.server.platform.db.migration.step.MigrationStep)1 MigrationSteps (org.sonar.server.platform.db.migration.step.MigrationSteps)1