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

import java.util.Collection;

import de.ivu.elect.business.konfiguration.control.AbstractKonfigurationInit;
import de.ivu.elect.business.konfiguration.entity.ElectKonfigurationWerte;
import de.ivu.elect.business.konfiguration.entity.Konfiguration;
import de.ivu.elect.business.konfiguration.entity.KonfigurationInitContext;


import static java.util.Arrays.asList;

/**
 * on 01.12.2015.
 */
public class DatabaseStatistikKonfigurationInit extends AbstractKonfigurationInit {

  public DatabaseStatistikKonfigurationInit() {
    super();
  }

  @Override
  protected Collection<Konfiguration> createDefaultParameters(KonfigurationInitContext konfigurationInitContext) {
    return asList( //
        create(ElectKonfigurationWerte.DATABASE_STATISTIK_CRONTAB, getDefaultCrontab()),
        create(ElectKonfigurationWerte.DATABASE_STATISTIK_ANZAHL_EINTRAEGE, 100),  //
        create(ElectKonfigurationWerte.DATABASE_STATISTIK_LOGGING_ENABLED, Boolean.FALSE) // ELECT-8159
    );
  }

  protected String getDefaultCrontab() {
    return "*/20 * * * * *"; // alle zwanzig Sekunden
  }
}
