seb-server/src/main/java/ch/ethz/seb/sebserver/gui/GuiInit.java

87 lines
3.8 KiB
Java
Raw Normal View History

/*
* Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET)
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package ch.ethz.seb.sebserver.gui;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
2020-06-10 10:13:43 +02:00
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import ch.ethz.seb.sebserver.SEBServerInit;
import ch.ethz.seb.sebserver.gbl.profile.GuiProfile;
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.WebserviceURIService;
@Component
@GuiProfile
public class GuiInit implements ApplicationListener<ApplicationReadyEvent> {
private final SEBServerInit sebServerInit;
2020-06-10 10:13:43 +02:00
private final Environment environment;
2020-08-20 19:30:39 +02:00
private final GuiServiceInfo guiServiceInfo;
private final WebserviceURIService webserviceURIService;
2020-06-10 10:13:43 +02:00
protected GuiInit(
final SEBServerInit sebServerInit,
2020-08-20 19:30:39 +02:00
final Environment environment,
final GuiServiceInfo guiServiceInfo,
final WebserviceURIService webserviceURIService) {
this.sebServerInit = sebServerInit;
2020-06-10 10:13:43 +02:00
this.environment = environment;
2020-08-20 19:30:39 +02:00
this.guiServiceInfo = guiServiceInfo;
this.webserviceURIService = webserviceURIService;
}
@Override
public void onApplicationEvent(final ApplicationReadyEvent event) {
this.sebServerInit.init();
2021-12-07 10:41:54 +01:00
SEBServerInit.INIT_LOGGER.info("----> *********************************************************");
SEBServerInit.INIT_LOGGER.info("----> *** GUI Service starting up... ***");
SEBServerInit.INIT_LOGGER.info("----> *********************************************************");
SEBServerInit.INIT_LOGGER.info("----> ");
2020-06-10 10:13:43 +02:00
SEBServerInit.INIT_LOGGER.info(
"----> Webservice connection: {}",
this.webserviceURIService.getURIBuilder().build());
2020-08-20 19:30:39 +02:00
SEBServerInit.INIT_LOGGER.info(
"----> GUI service internal connection : "
+ this.guiServiceInfo.getInternalServerURIBuilder().toUriString());
SEBServerInit.INIT_LOGGER.info(
"----> GUI service external connection : "
+ this.guiServiceInfo.getExternalServerURIBuilder().toUriString());
SEBServerInit.INIT_LOGGER.info(
"----> GUI service endpoint : "
+ this.guiServiceInfo.getEntryPoint());
2020-06-10 10:13:43 +02:00
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 + "--");
2021-12-07 10:41:54 +01:00
SEBServerInit.INIT_LOGGER.info("---->");
SEBServerInit.INIT_LOGGER.info("----> *********************************************************");
SEBServerInit.INIT_LOGGER.info("----> *** GUI Service successfully successfully started up! ***");
SEBServerInit.INIT_LOGGER.info("----> *********************************************************");
}
}