
package de.ivu.elect.business;

import javax.enterprise.inject.Specializes;
import javax.inject.Inject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.ivu.elect.business.gebietsbaum.boundary.NlWasGebietsgruppierungCreator;
import de.ivu.elect.jee.exception.ElectCommonExceptionHandler;

@Specializes
public class NlWasStartup extends WasStartup {

  private static final Logger LOG = LoggerFactory.getLogger(NlWasStartup.class);

  @Inject
  private transient NlVersion version;

  @Inject
  private transient NlWasGebietsgruppierungCreator nlWasGebietsgruppierungCreator;

  public NlWasStartup() {
    super();
  }

  @Override
  public void init() {
    ElectCommonExceptionHandler.PREVENT_ERROR_PAGE.set(true); // ELECTVAPP-1959

    super.init();

    dumpLogo();
    dumpVersion();

    nlWasGebietsgruppierungCreator.createDefaultGebietsgruppierungen(); // ELECT-15447
  }

  private void dumpLogo() {
    NlStartupUtil.dumpLogo(LOG, calculateLogoTab(LOG));
  }

  private void dumpVersion() {
    NlStartupUtil.dumpVersion(LOG, calculateLogoTab(LOG), version);
  }
}
