
package de.ivu.elect.business.system.control;

import javax.inject.Inject;

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

import de.ivu.elect.jee.faces.HttpSecurityHeader;
import de.ivu.elect.jee.startup.PostStartup;

/**
 * HTTP Header konfigurierbar
 */
public class HttpHeaderKonfigurationPostStartup implements PostStartup {

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

  @Inject
  private transient HttpHeaderKonfigurationAktualisieren httpHeaderKonfigurationAktualisieren;

  @Override
  public void postStartup() {
    if (Boolean.TRUE.toString().equalsIgnoreCase(System.getProperty("ivu.elect.skip.init.http.header"))) {
      LOG.warn("HTTP-Header NICHT initialisiert => defaults: " + HttpSecurityHeader.HEADER_MAP);
      return;
    }
    httpHeaderKonfigurationAktualisieren.aktualisiereHttpHeader();
  }

}
