improved GUI startup info

This commit is contained in:
anhefti 2020-06-10 10:13:43 +02:00
parent b63a8e39b3
commit cc22c94793

View file

@ -10,6 +10,7 @@ package ch.ethz.seb.sebserver.gui;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import ch.ethz.seb.sebserver.SEBServerInit;
@ -20,9 +21,14 @@ import ch.ethz.seb.sebserver.gbl.profile.GuiProfile;
public class GuiInit implements ApplicationListener<ApplicationReadyEvent> {
private final SEBServerInit sebServerInit;
private final Environment environment;
protected GuiInit(
final SEBServerInit sebServerInit,
final Environment environment) {
protected GuiInit(final SEBServerInit sebServerInit) {
this.sebServerInit = sebServerInit;
this.environment = environment;
}
@Override
@ -36,6 +42,29 @@ public class GuiInit implements ApplicationListener<ApplicationReadyEvent> {
SEBServerInit.INIT_LOGGER.info("---->");
SEBServerInit.INIT_LOGGER.info("----> GUI Service successfully successfully started up!");
SEBServerInit.INIT_LOGGER.info("---->");
final String webServiceProtocol = this.environment.getProperty("sebserver.gui.webservice.protocol", "http");
final String webServiceAddress = this.environment.getRequiredProperty("sebserver.gui.webservice.address");
final String webServicePort = this.environment.getProperty("sebserver.gui.webservice.port", "80");
SEBServerInit.INIT_LOGGER.info("----> Webservice connection: " + webServiceProtocol + "://" + webServiceAddress
+ ":" + webServicePort);
final String webServiceAdminAPIEndpoint =
this.environment.getRequiredProperty("sebserver.gui.webservice.apipath");
final String webServiceExamAPIEndpoint =
this.environment.getRequiredProperty("sebserver.webservice.api.exam.endpoint");
SEBServerInit.INIT_LOGGER.info("---->");
SEBServerInit.INIT_LOGGER.info("----> Webservice admin API endpoint: " + webServiceAdminAPIEndpoint);
SEBServerInit.INIT_LOGGER.info("----> Webservice exam API endpoint: " + webServiceExamAPIEndpoint);
final String webServiceAPIBasicAccess =
this.environment.getRequiredProperty("sebserver.webservice.api.admin.clientId");
SEBServerInit.INIT_LOGGER.info("---->");
SEBServerInit.INIT_LOGGER.info("----> Webservice admin API basic access: --" + webServiceAPIBasicAccess + "--");
}
}