From 07760c3139584e4a93fc4e4b20fcb43ad1cc84cf Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 13 Jan 2016 14:44:21 +0100 Subject: [server] Make sure meta data is present at first startup This prevents issues where only part of the meta data would be fetched on startup, causing inconsistent behaviour. (Eg we have the OS list, but not the virtualizer list) --- .../src/main/java/org/openslx/bwlp/sat/App.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java index 66062303..2d9e73c9 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/App.java @@ -57,7 +57,7 @@ public class App { LOGGER.fatal("Could not load configuration", e1); System.exit(1); } - + if (Identity.loadCertificate() == null) { LOGGER.error("Could not set up TLS/SSL requirements, exiting"); System.exit(1); @@ -96,9 +96,21 @@ public class App { Configuration.getMasterServerPort(), 30000); // Load useful things from master server - VirtualizerList.get(); - OrganizationList.get(); - OperatingSystemList.get(); + if (VirtualizerList.get() == null || VirtualizerList.get().isEmpty()) { + LOGGER.fatal("Could not get initial virtualizer list from master server." + + " Please make sure this server can connect to the internet."); + return; + } + if (OrganizationList.get() == null || OrganizationList.get().isEmpty()) { + LOGGER.fatal("Could not get initial organization list from master server." + + " Please make sure this server can connect to the internet."); + return; + } + if (OperatingSystemList.get() == null || OperatingSystemList.get().isEmpty()) { + LOGGER.fatal("Could not get initial operating system list from master server." + + " Please make sure this server can connect to the internet."); + return; + } // Start file transfer server if (!FileServer.instance().start()) { -- cgit v1.2.3-55-g7522