SEBSLI-9 move init event below admin account create event
This commit is contained in:
parent
4a97e8d32c
commit
32fc2817d4
2 changed files with 7 additions and 11 deletions
|
@ -102,14 +102,16 @@ public class WebserviceInit implements ApplicationListener<ApplicationReadyEvent
|
||||||
SEBServerInit.INIT_LOGGER.info("----> Initialize Services...");
|
SEBServerInit.INIT_LOGGER.info("----> Initialize Services...");
|
||||||
SEBServerInit.INIT_LOGGER.info("----> ");
|
SEBServerInit.INIT_LOGGER.info("----> ");
|
||||||
|
|
||||||
this.applicationEventPublisher.publishEvent(new SEBServerInitEvent(this));
|
|
||||||
|
|
||||||
// Run the database integrity checks and fixes if configured
|
// Run the database integrity checks and fixes if configured
|
||||||
this.dbIntegrityChecker.checkIntegrity();
|
this.dbIntegrityChecker.checkIntegrity();
|
||||||
|
|
||||||
// Create an initial admin account if requested and not already in the database
|
// Create an initial admin account if requested and not already in the database
|
||||||
this.adminUserInitializer.initAdminAccount();
|
this.adminUserInitializer.initAdminAccount();
|
||||||
|
|
||||||
|
//emits SEBServerInitEvent
|
||||||
|
this.applicationEventPublisher.publishEvent(new SEBServerInitEvent(this));
|
||||||
|
|
||||||
|
|
||||||
SEBServerInit.INIT_LOGGER.info("----> *********************************************************");
|
SEBServerInit.INIT_LOGGER.info("----> *********************************************************");
|
||||||
SEBServerInit.INIT_LOGGER.info("----> *** Webservice Info: ***");
|
SEBServerInit.INIT_LOGGER.info("----> *** Webservice Info: ***");
|
||||||
SEBServerInit.INIT_LOGGER.info("----> *********************************************************");
|
SEBServerInit.INIT_LOGGER.info("----> *********************************************************");
|
||||||
|
|
|
@ -3,19 +3,13 @@ package ch.ethz.seb.sebserver.webservice.servicelayer.light.impl;
|
||||||
|
|
||||||
import ch.ethz.seb.sebserver.SEBServerInitEvent;
|
import ch.ethz.seb.sebserver.SEBServerInitEvent;
|
||||||
import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
|
import ch.ethz.seb.sebserver.gbl.model.sebconfig.SEBClientConfig;
|
||||||
import ch.ethz.seb.sebserver.gbl.util.Result;
|
|
||||||
import ch.ethz.seb.sebserver.gbl.util.Utils;
|
|
||||||
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.FilterMap;
|
|
||||||
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.SEBClientConfigDAO;
|
import ch.ethz.seb.sebserver.webservice.servicelayer.dao.SEBClientConfigDAO;
|
||||||
import org.joda.time.DateTime;
|
|
||||||
import org.joda.time.DateTimeZone;
|
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.context.event.EventListener;
|
import org.springframework.context.event.EventListener;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
@Service
|
@Service
|
||||||
|
@ -32,9 +26,9 @@ public class LightInit {
|
||||||
|
|
||||||
@EventListener(SEBServerInitEvent.class)
|
@EventListener(SEBServerInitEvent.class)
|
||||||
public void init() {
|
public void init() {
|
||||||
// if(isConnectionConfigAbsent()){
|
if(isConnectionConfigAbsent()){
|
||||||
// this.sebClientConfigDAO.createNew(createLightConnectionConfiguration()).getOrThrow();
|
this.sebClientConfigDAO.createNew(createLightConnectionConfiguration()).getOrThrow();
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isConnectionConfigAbsent() {
|
private boolean isConnectionConfigAbsent() {
|
||||||
|
|
Loading…
Reference in a new issue