Skip to content

Commit

Permalink
feat: execute exporters based on entity priority
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcScheib committed Apr 16, 2024
1 parent 5affde9 commit 652a12d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public void export() {
}
}

public int getPriority() {
return getType().getPriority();
}

public abstract EntityType getType();

protected abstract void exportEntity(String entityName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package com.cycrilabs.keycloak.configurator.commands.export.control;

import java.util.Comparator;

import jakarta.enterprise.inject.Instance;
import jakarta.inject.Inject;

import com.cycrilabs.keycloak.configurator.commands.configure.boundary.AbstractImporter;
import com.cycrilabs.keycloak.configurator.commands.export.boundary.AbstractExporter;
import com.cycrilabs.keycloak.configurator.commands.export.entity.ExportEntitiesCommandConfiguration;
import com.cycrilabs.keycloak.configurator.shared.control.KeycloakOptions;
Expand Down Expand Up @@ -45,6 +48,7 @@ public void run() {
}

exporters.stream()
.sorted(Comparator.comparingInt(AbstractExporter::getPriority))
.forEach(AbstractExporter::export);
}
}

0 comments on commit 652a12d

Please sign in to comment.