CheckStatoPdDHealthCheckStats.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */

  20. package org.openspcoop2.pdd.services.connector;

  21. import java.io.Serializable;

  22. import org.openspcoop2.pdd.config.OpenSPCoop2Properties;

  23. /**
  24.  * CheckStatoPdDHealthCheckStats
  25.  *
  26.  * @author Poli Andrea (apoli@link.it)
  27.  * @author $Author$
  28.  * @version $Rev$, $Date$
  29.  */
  30. public class CheckStatoPdDHealthCheckStats implements Serializable {

  31.     private static final long serialVersionUID = 1L;

  32.     public static CheckStatoPdDHealthCheckStats readProprietaVerificaInformazioniStatistiche(OpenSPCoop2Properties properties) {
  33.        
  34.         boolean verificaStatisticaOraria = properties.isCheckHealthCheckStatsHourlyEnabled();
  35.         boolean verificaStatisticaGiornaliera = properties.isCheckHealthCheckStatsDailyEnabled();
  36.         boolean verificaStatisticaSettimanale = properties.isCheckHealthCheckStatsWeeklyEnabled();
  37.         boolean verificaStatisticaMensile = properties.isCheckHealthCheckStatsMonthlyEnabled();
  38.         int verificaStatisticaOrariaSoglia = properties.getCheckHealthCheckStatsHourlyThreshold();
  39.         int verificaStatisticaGiornalieraSoglia = properties.getCheckHealthCheckStatsDailyThreshold();
  40.         int verificaStatisticaSettimanaleSoglia = properties.getCheckHealthCheckStatsWeeklyThreshold();
  41.         int verificaStatisticaMensileSoglia =properties.getCheckHealthCheckStatsMonthlyThreshold();
  42.        
  43.         CheckStatoPdDHealthCheckStats check = new CheckStatoPdDHealthCheckStats();
  44.         check.setVerificaStatisticaOraria(verificaStatisticaOraria);
  45.         check.setVerificaStatisticaGiornaliera(verificaStatisticaGiornaliera);
  46.         check.setVerificaStatisticaSettimanale(verificaStatisticaSettimanale);
  47.         check.setVerificaStatisticaMensile(verificaStatisticaMensile);
  48.         check.setVerificaStatisticaOrariaSoglia(verificaStatisticaOrariaSoglia);
  49.         check.setVerificaStatisticaGiornalieraSoglia(verificaStatisticaGiornalieraSoglia);
  50.         check.setVerificaStatisticaSettimanaleSoglia(verificaStatisticaSettimanaleSoglia);
  51.         check.setVerificaStatisticaMensileSoglia(verificaStatisticaMensileSoglia);
  52.        
  53.         return check;
  54.     }
  55.    
  56.     private boolean verificaStatisticaOraria = false;
  57.     private boolean verificaStatisticaGiornaliera = false;
  58.     private boolean verificaStatisticaSettimanale = false;
  59.     private boolean verificaStatisticaMensile = false;
  60.     private int verificaStatisticaOrariaSoglia = 1;
  61.     private int verificaStatisticaGiornalieraSoglia = 1;
  62.     private int verificaStatisticaSettimanaleSoglia = 1;
  63.     private int verificaStatisticaMensileSoglia = 1;
  64.    
  65.     public boolean isVerificaStatisticaOraria() {
  66.         return this.verificaStatisticaOraria;
  67.     }
  68.     public void setVerificaStatisticaOraria(boolean verificaStatisticaOraria) {
  69.         this.verificaStatisticaOraria = verificaStatisticaOraria;
  70.     }
  71.     public boolean isVerificaStatisticaGiornaliera() {
  72.         return this.verificaStatisticaGiornaliera;
  73.     }
  74.     public void setVerificaStatisticaGiornaliera(boolean verificaStatisticaGiornaliera) {
  75.         this.verificaStatisticaGiornaliera = verificaStatisticaGiornaliera;
  76.     }
  77.     public boolean isVerificaStatisticaSettimanale() {
  78.         return this.verificaStatisticaSettimanale;
  79.     }
  80.     public void setVerificaStatisticaSettimanale(boolean verificaStatisticaSettimanale) {
  81.         this.verificaStatisticaSettimanale = verificaStatisticaSettimanale;
  82.     }
  83.     public boolean isVerificaStatisticaMensile() {
  84.         return this.verificaStatisticaMensile;
  85.     }
  86.     public void setVerificaStatisticaMensile(boolean verificaStatisticaMensile) {
  87.         this.verificaStatisticaMensile = verificaStatisticaMensile;
  88.     }
  89.     public int getVerificaStatisticaOrariaSoglia() {
  90.         return this.verificaStatisticaOrariaSoglia;
  91.     }
  92.     public void setVerificaStatisticaOrariaSoglia(int verificaStatisticaOrariaSoglia) {
  93.         this.verificaStatisticaOrariaSoglia = verificaStatisticaOrariaSoglia;
  94.     }
  95.     public int getVerificaStatisticaGiornalieraSoglia() {
  96.         return this.verificaStatisticaGiornalieraSoglia;
  97.     }
  98.     public void setVerificaStatisticaGiornalieraSoglia(int verificaStatisticaGiornalieraSoglia) {
  99.         this.verificaStatisticaGiornalieraSoglia = verificaStatisticaGiornalieraSoglia;
  100.     }
  101.     public int getVerificaStatisticaSettimanaleSoglia() {
  102.         return this.verificaStatisticaSettimanaleSoglia;
  103.     }
  104.     public void setVerificaStatisticaSettimanaleSoglia(int verificaStatisticaSettimanaleSoglia) {
  105.         this.verificaStatisticaSettimanaleSoglia = verificaStatisticaSettimanaleSoglia;
  106.     }
  107.     public int getVerificaStatisticaMensileSoglia() {
  108.         return this.verificaStatisticaMensileSoglia;
  109.     }
  110.     public void setVerificaStatisticaMensileSoglia(int verificaStatisticaMensileSoglia) {
  111.         this.verificaStatisticaMensileSoglia = verificaStatisticaMensileSoglia;
  112.     }
  113.    
  114. }