ModalitaIdentificazione.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.core.commons;

  21. import java.util.ArrayList;
  22. import java.util.List;

  23. /**
  24.  * ModalitaIdentificazione
  25.  *
  26.  * @author apoli@link.it
  27.  * @author $Author$
  28.  * @version $Rev$, $Date$
  29.  */

  30. public enum ModalitaIdentificazione {

  31.     STATIC("Informazione Statica", "Nome"),
  32.     PROTOCOL_BASED("Profilo di Interoperabilità", null),
  33.     REGISTER_BASED("Registro GovWay", null),
  34.     COOKIE_BASED("Cookie", "Nome"),
  35.     HEADER_BASED("Header HTTP", "Nome"),
  36.     URL_BASED("Url di Invocazione", "Espressione Regolare"),
  37.     FORM_BASED("Parametro della Url", "Nome"),
  38.     CONTENT_BASED("Contenuto","Pattern"),
  39.     INTERFACE_BASED("Specifica di Interfaccia dell'API",null),
  40.     SOAP_ACTION_BASED("SOAPAction",null),
  41.     INPUT_BASED("Header di Integrazione",null),
  42.     CONTAINER_BASED("Container",null),
  43.     INDIRIZZO_IP_BASED("Client IP",null),
  44.     X_FORWARD_FOR_BASED("X-Forwarded-For",null),
  45.     TOKEN("Token","Claim"),
  46.     PLUGIN_BASED("Plugin", "Tipo"),
  47.     GOVWAY_TEMPLATE("Template", "Template"),
  48.     FREEMARKER_TEMPLATE("Freemarker Template", "Template"),
  49.     VELOCITY_TEMPLATE("Velocity Template", "Template");
  50.    
  51.     private String label;
  52.     private String labelParametro;
  53.    
  54.     ModalitaIdentificazione(String label, String labelParametro) {
  55.         this.label = label;
  56.         this.labelParametro = labelParametro;
  57.     }

  58.     public String getLabel() {
  59.         return this.label;
  60.     }

  61.     public String getLabelParametro() {
  62.         return this.labelParametro;
  63.     }
  64.    
  65.     public static List<String> getLabels(ModalitaIdentificazione ... modes){
  66.         List<String> l = new ArrayList<>();
  67.         for (ModalitaIdentificazione m : modes) {
  68.             l.add(m.getLabel());
  69.         }
  70.         return l;
  71.     }
  72.    
  73. }