2020-03-03 09:36:43 +01:00
|
|
|
/*
|
|
|
|
* 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;
|
2020-03-03 09:36:43 +01:00
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import ch.ethz.seb.sebserver.SEBServerInit;
|
|
|
|
import ch.ethz.seb.sebserver.gbl.profile.GuiProfile;
|
2021-04-30 15:59:15 +02:00
|
|
|
import ch.ethz.seb.sebserver.gui.service.remote.webservice.auth.WebserviceURIService;
|
2020-03-03 09:36:43 +01:00
|
|
|
|
|
|
|
@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;
|
2021-04-30 15:59:15 +02:00
|
|
|
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,
|
2021-04-30 15:59:15 +02:00
|
|
|
final GuiServiceInfo guiServiceInfo,
|
|
|
|
final WebserviceURIService webserviceURIService) {
|
2020-03-03 09:36:43 +01:00
|
|
|
|
|
|
|
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;
|
2021-04-30 15:59:15 +02:00
|
|
|
this.webserviceURIService = webserviceURIService;
|
2020-03-03 09:36:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@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
|
|
|
|
2021-04-30 15:59:15 +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("----> *********************************************************");
|
|
|
|
|
2020-03-03 09:36:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|