StatisticByState.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.monitor.engine.statistic;

  21. import org.openspcoop2.monitor.sdk.exceptions.StatisticException;
  22. import org.openspcoop2.monitor.sdk.plugins.StatisticProcessing;
  23. import org.openspcoop2.monitor.sdk.statistic.IStatistic;

  24. /**
  25.  * StatisticByState
  26.  *
  27.  * @author Poli Andrea (apoli@link.it)
  28.  * @author $Author$
  29.  * @version $Rev$, $Date$
  30.  */
  31. public class StatisticByState extends StatisticProcessing {

  32.    
  33.     // plugins ConfigurazioneStatistica
  34.     public static final String ID = "__StatisticByState__";
  35.     public static final String LABEL = "Stati";
  36.     public static final String DESCRIZIONE = "Informazione Statistica sugli Stati associati alle Transazioni";
  37.    

  38.     // popolamento

  39.     @Override
  40.     public void createHourlyStatisticData(IStatistic context) throws StatisticException {
  41.         this.createStatisticData(context);
  42.     }
  43.     @Override
  44.     public void createWeeklyStatisticData(IStatistic context) throws StatisticException {
  45.         this.createStatisticData(context);
  46.     }
  47.     @Override
  48.     public void createMonthlyStatisticData(IStatistic context) throws StatisticException {
  49.         this.createStatisticData(context);
  50.     }
  51.     @Override
  52.     public void createDailyStatisticData(IStatistic context) throws StatisticException {
  53.         this.createStatisticData(context);
  54.     }
  55.     private void createStatisticData(IStatistic context) throws StatisticException {

  56.         try{

  57.             if(context instanceof CustomStatisticsSdkGenerator){
  58.                 ((CustomStatisticsSdkGenerator)context).createStatisticsByStato();
  59.             }
  60.            
  61.         } catch(Exception e) {
  62.             throw new StatisticException(e.getMessage(),e);
  63.         }
  64.     }
  65.    

  66. }