RequestRateLimitingConfig.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.protocol.sdk.state;

  21. import java.util.HashMap;
  22. import java.util.Map;

  23. import org.openspcoop2.core.constants.TipoPdD;
  24. import org.openspcoop2.core.controllo_traffico.AttivazionePolicy;
  25. import org.openspcoop2.core.controllo_traffico.ConfigurazioneGenerale;
  26. import org.openspcoop2.core.controllo_traffico.ConfigurazionePolicy;
  27. import org.openspcoop2.core.controllo_traffico.ElencoIdPolicyAttive;
  28. import org.openspcoop2.core.controllo_traffico.beans.AbstractPolicyConfiguration;
  29. import org.openspcoop2.core.controllo_traffico.constants.TipoRisorsaPolicyAttiva;
  30. import org.openspcoop2.core.id.IDServizio;
  31. import org.openspcoop2.core.id.IDSoggetto;

  32. /**
  33.  * RequestRateLimitingConfig
  34.  *
  35.  * @author Poli Andrea (apoli@link.it)
  36.  * @author $Author$
  37.  * @version $Rev$, $Date$
  38.  */
  39. public class RequestRateLimitingConfig implements java.io.Serializable {

  40.     /**
  41.      *
  42.      */
  43.     private static final long serialVersionUID = 1L;

  44.     private String key = null;

  45.     private boolean cached = false;
  46.    
  47.     private TipoPdD tipoPdD;
  48.     private String nomePorta;
  49.     private IDServizio idServizio;
  50.     private IDSoggetto idFruitore; // solo nelle porte delegate
  51.    
  52.     private Map<TipoRisorsaPolicyAttiva, ElencoIdPolicyAttive> mapPolicyAttive_dimensioneMessaggi;
  53.     private Map<String, AttivazionePolicy> attivazionePolicies_dimensioneMessaggi = new HashMap<String, AttivazionePolicy>();
  54.     private Map<String, ConfigurazionePolicy> configurazionePolicies_dimensioneMessaggi = new HashMap<String, ConfigurazionePolicy>();
  55.    
  56.     private Map<TipoRisorsaPolicyAttiva, ElencoIdPolicyAttive> mapPolicyAttive;
  57.     private Map<String, AttivazionePolicy> attivazionePolicies = new HashMap<String, AttivazionePolicy>();
  58.     private Map<String, ConfigurazionePolicy> configurazionePolicies = new HashMap<String, ConfigurazionePolicy>();
  59.    
  60.     private ConfigurazioneGenerale configurazioneGenerale;
  61.     private AbstractPolicyConfiguration configurazionePolicyRateLimitingGlobali;
  62.    
  63.     public String getKey() {
  64.         return this.key;
  65.     }
  66.     public void setKey(String key) {
  67.         this.key = key;
  68.     }
  69.    
  70.     public boolean isCached() {
  71.         return this.cached;
  72.     }
  73.     public void setCached(boolean cached) {
  74.         this.cached = cached;
  75.     }
  76.     public void setDatiPorta(TipoPdD tipoPdD, String nomePorta, IDServizio idServizio, IDSoggetto idSoggettoFrutore) {
  77.         this.tipoPdD = tipoPdD;
  78.         this.nomePorta = nomePorta;
  79.         this.idServizio = idServizio;
  80.         this.idFruitore = idSoggettoFrutore;
  81.     }
  82.     public TipoPdD getTipoPdD() {
  83.         return this.tipoPdD;
  84.     }
  85.     public String getNomePorta() {
  86.         return this.nomePorta;
  87.     }
  88.     public IDServizio getIdServizio() {
  89.         return this.idServizio;
  90.     }
  91.     public IDSoggetto getIdFruitore() {
  92.         return this.idFruitore;
  93.     }

  94.     public Map<TipoRisorsaPolicyAttiva, ElencoIdPolicyAttive> getMapPolicyAttive_dimensioneMessaggi() {
  95.         return this.mapPolicyAttive_dimensioneMessaggi;
  96.     }
  97.     public void setMapPolicyAttive_dimensioneMessaggi(
  98.             Map<TipoRisorsaPolicyAttiva, ElencoIdPolicyAttive> mapPolicyAttive_dimensioneMessaggi) {
  99.         this.mapPolicyAttive_dimensioneMessaggi = mapPolicyAttive_dimensioneMessaggi;
  100.     }
  101.     public Map<TipoRisorsaPolicyAttiva, ElencoIdPolicyAttive> getMapPolicyAttive() {
  102.         return this.mapPolicyAttive;
  103.     }
  104.     public void setMapPolicyAttive(Map<TipoRisorsaPolicyAttiva, ElencoIdPolicyAttive> mapPolicyAttive) {
  105.         this.mapPolicyAttive = mapPolicyAttive;
  106.     }
  107.    
  108.     public void addAttivazionePolicy(String id, AttivazionePolicy attivazionePolicy) {
  109.         this.attivazionePolicies.put(id, attivazionePolicy);
  110.     }
  111.     public AttivazionePolicy getAttivazionePolicy(String id) {
  112.         return this.attivazionePolicies.get(id);
  113.     }
  114.     public void addAttivazionePolicy_dimensioneMessaggi(String id, AttivazionePolicy attivazionePolicy) {
  115.         this.attivazionePolicies_dimensioneMessaggi.put(id, attivazionePolicy);
  116.     }
  117.     public AttivazionePolicy getAttivazionePolicy_dimensioneMessaggi(String id) {
  118.         return this.attivazionePolicies_dimensioneMessaggi.get(id);
  119.     }
  120.    
  121.     public void addConfigurazionePolicy(String id, ConfigurazionePolicy configurazionePolicy) {
  122.         this.configurazionePolicies.put(id, configurazionePolicy);
  123.     }
  124.     public ConfigurazionePolicy getConfigurazionePolicy(String id) {
  125.         return this.configurazionePolicies.get(id);
  126.     }
  127.     public void addConfigurazionePolicy_dimensioneMessaggi(String id, ConfigurazionePolicy configurazionePolicy) {
  128.         this.configurazionePolicies_dimensioneMessaggi.put(id, configurazionePolicy);
  129.     }
  130.     public ConfigurazionePolicy getConfigurazionePolicy_dimensioneMessaggi(String id) {
  131.         return this.configurazionePolicies_dimensioneMessaggi.get(id);
  132.     }

  133.     public ConfigurazioneGenerale getConfigurazioneGenerale() {
  134.         return this.configurazioneGenerale;
  135.     }
  136.     public void setConfigurazioneGenerale(ConfigurazioneGenerale configurazioneGenerale) {
  137.         this.configurazioneGenerale = configurazioneGenerale;
  138.     }
  139.     public AbstractPolicyConfiguration getConfigurazionePolicyRateLimitingGlobali() {
  140.         return this.configurazionePolicyRateLimitingGlobali;
  141.     }
  142.     public void setConfigurazionePolicyRateLimitingGlobali(AbstractPolicyConfiguration configurazionePolicyRateLimitingGlobali) {
  143.         this.configurazionePolicyRateLimitingGlobali = configurazionePolicyRateLimitingGlobali;
  144.     }
  145. }