aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorankitbhatt <ankit.bhatt@amdocs.com>2019-09-06 17:06:32 +0530
committerankitbhatt <ankit.bhatt@amdocs.com>2019-09-06 17:07:06 +0530
commit949046b14b13cbe52b7ad3aca7cd6aaf7d4c7038 (patch)
tree1b4d167591c3e2400e3e8082725ca649471ecd43 /src/main/java/org
parent3f8f4a735fe4051f4ed234083028d78994a29051 (diff)
fixed issue with --rundisabled flag
also fixed issues for picking up the migrators without having migrator priority flag Issue-ID: AAI-2387 Signed-off-by: Ankit Bhatt <ankit.bhatt@amdocs.com> Change-Id: I992eea15299cbe10af5196e795f68d4a4b4d21b3
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/onap/aai/migration/MigrationControllerInternal.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/org/onap/aai/migration/MigrationControllerInternal.java b/src/main/java/org/onap/aai/migration/MigrationControllerInternal.java
index b94460a..55b03fb 100644
--- a/src/main/java/org/onap/aai/migration/MigrationControllerInternal.java
+++ b/src/main/java/org/onap/aai/migration/MigrationControllerInternal.java
@@ -317,7 +317,9 @@ public class MigrationControllerInternal {
return engine.asAdmin().getReadOnlyTraversalSource().V().has(AAIProperties.NODE_TYPE, VERTEX_TYPE).has(name, true).hasNext();
}
private Set<Class<? extends Migrator>> findClasses(Reflections reflections) {
- Set<Class<? extends Migrator>> migratorClasses = reflections.getSubTypesOf(Migrator.class);
+ Set<Class<? extends Migrator>> migratorClasses = reflections.getSubTypesOf(Migrator.class).stream()
+ .filter(clazz -> clazz.isAnnotationPresent(MigrationPriority.class))
+ .collect(Collectors.toSet());
/*
* TODO- Change this to make sure only classes in the specific $release are added in the runList
* Or add a annotation like exclude which folks again need to remember to add ??
@@ -353,15 +355,17 @@ public class MigrationControllerInternal {
private List<Class<? extends Migrator>> createMigratorList(CommandLineArgs cArgs,
List<Class<? extends Migrator>> migratorClasses) {
List<Class<? extends Migrator>> migratorClassesToRun = new ArrayList<>();
- if (cArgs.scripts.isEmpty() && cArgs.runDisabled.isEmpty()) {
+ if (cArgs.scripts.isEmpty()) {
return migratorClasses;
-
}
+
for (Class<? extends Migrator> migratorClass : migratorClasses) {
- if (migratorExplicitlySpecified(cArgs, migratorClass.getSimpleName()) || migratorToRunWhenDisabled(cArgs, migratorClass.getSimpleName())) {
+ if (migratorExplicitlySpecified(cArgs, migratorClass.getSimpleName())
+ || migratorToRunWhenDisabled(cArgs, migratorClass.getSimpleName())) {
migratorClassesToRun.add(migratorClass);
}
}
+
return migratorClassesToRun;
}