MonitorMethods.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.web.ctrlstat.servlet.monitor;

  21. import java.util.ArrayList;

  22. /**
  23.  * MonitorMethods
  24.  *
  25.  * @author Andrea Poli (apoli@link.it)
  26.  * @author Stefano Corallo (corallo@link.it)
  27.  * @author Sandra Giangrandi (sandra@link.it)
  28.  * @author $Author$
  29.  * @version $Rev$, $Date$
  30.  *
  31.  */
  32. public enum MonitorMethods {

  33.     STATO_CONSEGNE_ASINCRONE("Stato"),
  34.     LISTA_RICHIESTE_PENDENTI("Lista"),
  35.     STATO_RICHIESTE("Stato Generale"),
  36.     RICONSEGNA_IMMEDIATA_RICHIESTE_PENDENTI(MonitorCostanti.LABEL_ACTION_RICONSEGNA_IMMEDIATA),
  37.     ELIMINAZIONE_RICHIESTE_PENDENTI("Eliminazione");

  38.     private String nome;

  39.     private static ArrayList<String> methodNames;

  40.     static boolean stato = false; // RIVEDERNE LE FUNZIONALITA
  41.    
  42.     // inizializzo la lista dei nomi
  43.     static {
  44.         MonitorMethods.methodNames = new ArrayList<>();
  45.         MonitorMethods[] methods = MonitorMethods.values();
  46.         for (MonitorMethods method : methods) {
  47.             if(STATO_RICHIESTE.equals(method) && !stato) {
  48.                 continue;
  49.             }
  50.             MonitorMethods.methodNames.add(method.getNome());
  51.         }
  52.     }

  53.     MonitorMethods(String nome) {
  54.         this.nome = nome;
  55.     }

  56.     public String getNome() {
  57.         return this.nome;
  58.     }

  59.     public static String[] getMethodsNames() {
  60.         return MonitorMethods.methodNames.toArray(new String[1]);
  61.     }

  62.     public static ArrayList<String> getMethodNames() {
  63.         return new ArrayList<>(MonitorMethods.methodNames);
  64.     }
  65. }