all apps created
This commit is contained in:
parent
5fa3786c89
commit
7c6a8aa50b
@ -53,24 +53,25 @@ public class ExportAppsToWso2FromV32 extends AbstractProcess {
|
|||||||
executor.submit(() -> processApp(app, token, index, apps.getCount(), false));
|
executor.submit(() -> processApp(app, token, index, apps.getCount(), false));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (adminsDefaultApplication != null) {
|
|
||||||
log.info("Found default application for admins: {}", adminsDefaultApplication.getName());
|
|
||||||
executor.submit(() -> processApp(adminsDefaultApplication, token,
|
|
||||||
appCounter.getAndIncrement(), apps.getCount(), true));
|
|
||||||
}
|
|
||||||
|
|
||||||
executor.shutdown();
|
executor.shutdown();
|
||||||
if (!executor.awaitTermination(10, TimeUnit.MINUTES)) {
|
if (!executor.awaitTermination(10, TimeUnit.MINUTES)) {
|
||||||
log.warn("Timeout waiting for App import tasks to finish");
|
log.warn("Timeout waiting for App import tasks to finish");
|
||||||
}
|
}
|
||||||
log.info("Finished processing Apps.");
|
log.info("Finished processing Apps.");
|
||||||
|
|
||||||
|
if (adminsDefaultApplication != null) {
|
||||||
|
log.info("Found default application for admins: {}", adminsDefaultApplication.getName());
|
||||||
|
processApp(adminsDefaultApplication, token,
|
||||||
|
appCounter.getAndIncrement(), apps.getCount(), true);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Error while exporting Apps.", e);
|
log.error("Error while exporting Apps.", e);
|
||||||
throw new RuntimeException("Export failed", e);
|
throw new RuntimeException("Export failed", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processApp(SearchedArtifact app, TokenResponse tokenResponse, int index, int total, boolean createAdminApp) {
|
private void processApp(SearchedArtifact app, TokenResponse tokenResponse, int index, int total,
|
||||||
|
boolean createAdminApp) {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -90,7 +91,8 @@ public class ExportAppsToWso2FromV32 extends AbstractProcess {
|
|||||||
ApplicationDetail appDetail = mapper
|
ApplicationDetail appDetail = mapper
|
||||||
.readValue(content, ApplicationDetail.class);
|
.readValue(content, ApplicationDetail.class);
|
||||||
|
|
||||||
if (DEFAULT_APPLICATION_NAME.equals(appDetail.getName()) && ADMIN_USERNAME.equals(appDetail.getOwner()) && !createAdminApp) {
|
if (DEFAULT_APPLICATION_NAME.equals(appDetail.getName())
|
||||||
|
&& ADMIN_USERNAME.equals(appDetail.getOwner()) && !createAdminApp) {
|
||||||
adminsDefaultApplication = app;
|
adminsDefaultApplication = app;
|
||||||
deleteWso2ApplicationIfExists(appDetail, tokenResponse);
|
deleteWso2ApplicationIfExists(appDetail, tokenResponse);
|
||||||
log.info(" - Skipping import of admins-default-application for now.");
|
log.info(" - Skipping import of admins-default-application for now.");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user