AbstractPolicyConfiguration.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.controllo_traffico.beans;

  21. import java.io.Serializable;
  22. import java.util.ArrayList;
  23. import java.util.List;
  24. import java.util.Map;

  25. import org.apache.commons.lang.StringUtils;
  26. import org.openspcoop2.core.config.Proprieta;
  27. import org.openspcoop2.core.controllo_traffico.constants.Costanti;
  28. import org.openspcoop2.core.controllo_traffico.driver.PolicyGroupByActiveThreadsType;

  29. /**
  30.  * PolicyConfiguration
  31.  *
  32.  * @author Poli Andrea (apoli@link.it)
  33.  * @author $Author$
  34.  * @version $Rev$, $Date$
  35.  */
  36. public abstract class AbstractPolicyConfiguration implements Serializable {

  37.     /**
  38.      *
  39.      */
  40.     private static final long serialVersionUID = 1L;
  41.    
  42.     // runtime config
  43.     protected boolean gestionePolicyRidefinita = false;
  44.     protected PolicyGroupByActiveThreadsType type;
  45.     private Boolean LOCAL_DIVIDED_BY_NODES_remaining_zeroValue = null;
  46.     private Boolean LOCAL_DIVIDED_BY_NODES_limit_roundingDown = null;
  47.     private Boolean LOCAL_DIVIDED_BY_NODES_limit_normalizedQuota = null;
  48.     protected Boolean getEngineLOCAL_DIVIDED_BY_NODES_remaining_zeroValue() {
  49.         return this.LOCAL_DIVIDED_BY_NODES_remaining_zeroValue;
  50.     }
  51.     public void setLOCAL_DIVIDED_BY_NODES_remaining_zeroValue(Boolean lOCAL_DIVIDED_BY_NODES_remaining_zeroValue) {
  52.         this.LOCAL_DIVIDED_BY_NODES_remaining_zeroValue = lOCAL_DIVIDED_BY_NODES_remaining_zeroValue;
  53.     }
  54.     protected Boolean getEngineLOCAL_DIVIDED_BY_NODES_limit_roundingDown() {
  55.         return this.LOCAL_DIVIDED_BY_NODES_limit_roundingDown;
  56.     }
  57.     public void setLOCAL_DIVIDED_BY_NODES_limit_roundingDown(Boolean lOCAL_DIVIDED_BY_NODES_limit_roundingDown) {
  58.         this.LOCAL_DIVIDED_BY_NODES_limit_roundingDown = lOCAL_DIVIDED_BY_NODES_limit_roundingDown;
  59.     }
  60.     protected Boolean getEngineLOCAL_DIVIDED_BY_NODES_limit_normalizedQuota() {
  61.         return this.LOCAL_DIVIDED_BY_NODES_limit_normalizedQuota;
  62.     }
  63.     public void setLOCAL_DIVIDED_BY_NODES_limit_normalizedQuota(Boolean lOCAL_DIVIDED_BY_NODES_limit_normalizedQuota) {
  64.         this.LOCAL_DIVIDED_BY_NODES_limit_normalizedQuota = lOCAL_DIVIDED_BY_NODES_limit_normalizedQuota;
  65.     }

  66.     protected boolean gestioneHttpHeadersRidefinita = false;
  67.     protected boolean disabledHttpHeaders = false;
  68.     protected boolean disabledHttpHeaders_limit = false;
  69.     protected boolean forceHttpHeaders_limit_no_windows = false;
  70.     protected boolean forceHttpHeaders_limit_windows = false;
  71.     protected boolean disabledHttpHeaders_remaining = false;
  72.     protected boolean disabledHttpHeaders_reset = false;
  73.     protected boolean disabledHttpHeaders_retryAfter = false;
  74.     protected boolean forceDisabledHttpHeaders_retryAfter_backoff = false;
  75.     protected int forceHttpHeaders_retryAfter_backoff = -1;
  76.    
  77.     // console config
  78.     protected String syncMode = Costanti.VALUE_MODALITA_SINCRONIZZAZIONE_DEFAULT;
  79.     protected String impl = null;
  80.     protected String count = null;
  81.     protected String engineType = null;
  82.     protected Long gestorePolicyConfigDate = null;
  83.    
  84.     protected String httpMode = Costanti.VALUE_HTTP_HEADER_DEFAULT;
  85.     protected String httpMode_limit = null;
  86.     protected String httpMode_remaining = null;
  87.     protected String httpMode_reset = null;
  88.     protected String httpMode_retry_after = null;
  89.     protected String httpMode_retry_after_backoff = null;
  90.        
  91.     public AbstractPolicyConfiguration(){
  92.         // usato da console
  93.     }
  94.     public AbstractPolicyConfiguration(boolean runtime) throws Exception{
  95.         this.initRuntimeInfo(runtime);
  96.     }
  97.     public AbstractPolicyConfiguration(List<Proprieta> p) throws Exception{
  98.         this(p, null, true);
  99.     }
  100.     public AbstractPolicyConfiguration(List<Proprieta> p, List<PolicyGroupByActiveThreadsType> tipiSupportati, boolean runtime) throws Exception{
  101.         if(p!=null && !p.isEmpty()) {
  102.            
  103.             if(tipiSupportati==null) {
  104.                 if(runtime) {
  105.                     tipiSupportati = new ArrayList<PolicyGroupByActiveThreadsType>();
  106.                     for (PolicyGroupByActiveThreadsType type : PolicyGroupByActiveThreadsType.values()) {
  107.                         tipiSupportati.add(type);
  108.                     }
  109.                 }
  110.                 else {
  111.                     throw new Exception("Tipi supportati non indicati");
  112.                 }
  113.             }
  114.            
  115.             String gestorePolicyConfigDate = getValue(p, Costanti.GESTORE_CONFIG_DATE, null);
  116.             if(gestorePolicyConfigDate!=null) {
  117.                 this.gestorePolicyConfigDate = Long.valueOf(gestorePolicyConfigDate);
  118.             }
  119.            
  120.             this.syncMode = getValue(p, Costanti.MODALITA_SINCRONIZZAZIONE, Costanti.VALUE_MODALITA_SINCRONIZZAZIONE_DEFAULT);
  121.             if(!Costanti.getVALUES_MODALITA_SINCRONIZZAZIONE(tipiSupportati).contains(this.syncMode)) {
  122.                 throw new Exception("Value '"+this.syncMode+"' unsupported for property '"+Costanti.MODALITA_SINCRONIZZAZIONE+"'");
  123.             }
  124.            
  125.             if(Costanti.VALUE_MODALITA_SINCRONIZZAZIONE_DISTRIBUITA.equals(this.syncMode)) {
  126.                 this.impl = getValue(p, Costanti.MODALITA_IMPLEMENTAZIONE, null);
  127.                 if(this.impl==null) {
  128.                     if(runtime) {
  129.                         throw new Exception("Value undefined for property '"+Costanti.MODALITA_IMPLEMENTAZIONE+"'");
  130.                     }
  131.                     else {
  132.                         // default
  133.                         this.impl = Costanti.getVALUES_MODALITA_IMPLEMENTAZIONE(tipiSupportati).get(0);
  134.                     }
  135.                 }  
  136.                 if(!Costanti.getVALUES_MODALITA_IMPLEMENTAZIONE(tipiSupportati).contains(this.impl)) {
  137.                     throw new Exception("Value '"+this.impl+"' unsupported for property '"+Costanti.MODALITA_IMPLEMENTAZIONE+"'");
  138.                 }
  139.                
  140.                 if(Costanti.VALUE_MODALITA_IMPLEMENTAZIONE_HAZELCAST.equals(this.impl) ||
  141.                         Costanti.VALUE_MODALITA_IMPLEMENTAZIONE_REDIS.equals(this.impl)) {
  142.                    
  143.                     this.count = getValue(p, Costanti.MODALITA_CONTATORI, null);
  144.                     if(this.count==null) {
  145.                         if(runtime) {
  146.                             throw new Exception("Value undefined for property '"+Costanti.MODALITA_CONTATORI+"'");
  147.                         }
  148.                         else {
  149.                             // default
  150.                             this.count = Costanti.getVALUES_MODALITA_CONTATORI(tipiSupportati, this.impl).get(0);
  151.                         }
  152.                     }  
  153.                     if(!Costanti.getVALUES_MODALITA_CONTATORI(tipiSupportati, this.impl).contains(this.count)) {
  154.                         if(runtime) {
  155.                             throw new Exception("Value '"+this.count+"' unsupported for property '"+Costanti.MODALITA_CONTATORI+"'");
  156.                         }
  157.                         else {
  158.                             // default (e' cambiato impl)
  159.                             this.count = Costanti.getVALUES_MODALITA_CONTATORI(tipiSupportati, this.impl).get(0);
  160.                         }
  161.                     }
  162.                    
  163.                     this.engineType = getValue(p, Costanti.MODALITA_TIPOLOGIA, null);
  164.                     if(this.engineType==null) {
  165.                         if(runtime) {
  166.                             throw new Exception("Value undefined for property '"+Costanti.MODALITA_TIPOLOGIA+"'");
  167.                         }
  168.                         else {
  169.                             // default
  170.                             this.engineType = Costanti.getVALUES_MODALITA_TIPOLOGIA(tipiSupportati, this.impl, this.count).get(0);
  171.                         }
  172.                     }  
  173.                     if(!Costanti.getVALUES_MODALITA_TIPOLOGIA(tipiSupportati, this.impl, this.count).contains(this.engineType)) {
  174.                         if(runtime) {
  175.                             throw new Exception("Value '"+this.engineType+"' unsupported for property '"+Costanti.MODALITA_TIPOLOGIA+"'");
  176.                         }
  177.                         else {
  178.                             // default (e' cambiato impl o count)
  179.                             this.engineType = Costanti.getVALUES_MODALITA_TIPOLOGIA(tipiSupportati, this.impl, this.count).get(0);
  180.                         }
  181.                     }
  182.                 }
  183.             }
  184.            
  185.             this.httpMode = getValue(p, Costanti.MODALITA_GENERAZIONE_HEADER_HTTP, Costanti.VALUE_HTTP_HEADER_DEFAULT);
  186.             if(!Costanti.VALUES_MODALITA_GENERAZIONE_HEADER_HTTP.contains(this.httpMode)) {
  187.                 throw new Exception("Value '"+this.httpMode+"' unsupported for property '"+Costanti.MODALITA_GENERAZIONE_HEADER_HTTP+"'");
  188.             }
  189.             if(Costanti.VALUE_HTTP_HEADER_RIDEFINITO.equals(this.httpMode)) {
  190.            
  191.                 this.httpMode_limit = getValue(p, Costanti.MODALITA_GENERAZIONE_HEADER_HTTP_LIMIT, Costanti.VALUE_HTTP_HEADER_DEFAULT);
  192.                 if(!Costanti.VALUES_MODALITA_GENERAZIONE_HEADER_HTTP_LIMIT.contains(this.httpMode_limit)) {
  193.                     throw new Exception("Value '"+this.httpMode_limit+"' unsupported for property '"+Costanti.MODALITA_GENERAZIONE_HEADER_HTTP_LIMIT+"'");
  194.                 }
  195.                
  196.                 this.httpMode_remaining = getValue(p, Costanti.MODALITA_GENERAZIONE_HEADER_HTTP_REMAINING, Costanti.VALUE_HTTP_HEADER_DEFAULT);
  197.                 if(!Costanti.VALUES_MODALITA_GENERAZIONE_HEADER_HTTP_REMAINING.contains(this.httpMode_remaining)) {
  198.                     throw new Exception("Value '"+this.httpMode_remaining+"' unsupported for property '"+Costanti.MODALITA_GENERAZIONE_HEADER_HTTP_REMAINING+"'");
  199.                 }
  200.                
  201.                 this.httpMode_reset = getValue(p, Costanti.MODALITA_GENERAZIONE_HEADER_HTTP_RESET, Costanti.VALUE_HTTP_HEADER_DEFAULT);
  202.                 if(!Costanti.VALUES_MODALITA_GENERAZIONE_HEADER_HTTP_RESET.contains(this.httpMode_reset)) {
  203.                     throw new Exception("Value '"+this.httpMode_reset+"' unsupported for property '"+Costanti.MODALITA_GENERAZIONE_HEADER_HTTP_RESET+"'");
  204.                 }
  205.                
  206.                 this.httpMode_retry_after = getValue(p, Costanti.MODALITA_GENERAZIONE_HEADER_HTTP_RETRY_AFTER, Costanti.VALUE_HTTP_HEADER_DEFAULT);
  207.                 if(!Costanti.VALUES_MODALITA_GENERAZIONE_HEADER_HTTP_RETRY_AFTER.contains(this.httpMode_retry_after)) {
  208.                     throw new Exception("Value '"+this.httpMode_retry_after+"' unsupported for property '"+Costanti.MODALITA_GENERAZIONE_HEADER_HTTP_RETRY_AFTER+"'");
  209.                 }
  210.                
  211.                 if(Costanti.VALUE_HTTP_HEADER_ABILITATO_BACKOFF.equals(this.httpMode_retry_after)) {
  212.                     this.httpMode_retry_after_backoff = getValue(p, Costanti.MODALITA_GENERAZIONE_HEADER_HTTP_RETRY_AFTER_BACKOFF_SECONDS, null);
  213.                 }
  214.             }
  215.         }
  216.         this.initRuntimeInfo(runtime);
  217.     }
  218.    
  219.     private static String getValue(List<Proprieta> p, String name, String defaultV) {
  220.         String tmp = null;
  221.         if(p!=null && !p.isEmpty()) {
  222.             for (Proprieta proprieta : p) {
  223.                 if(proprieta.getNome().equals(name)) {
  224.                     tmp = proprieta.getValore();
  225.                     break;
  226.                 }
  227.             }
  228.         }
  229.         if(tmp!=null) {
  230.             tmp = tmp.trim();
  231.         }
  232.         if(tmp!=null && StringUtils.isNotEmpty(tmp)) {
  233.             return tmp;
  234.         }
  235.         else {
  236.             return defaultV;
  237.         }
  238.     }
  239.    
  240.    
  241.     private static Map<String, PolicyGroupByActiveThreadsType> mappingCostantiToHazelcastExact = Map.of(
  242.             Costanti.VALUE_MODALITA_TIPOLOGIA_HAZELCAST_CONTATORI_ATOMIC_LONG, PolicyGroupByActiveThreadsType.HAZELCAST_ATOMIC_LONG,
  243.             Costanti.VALUE_MODALITA_TIPOLOGIA_HAZELCAST_FULL_SYNC, PolicyGroupByActiveThreadsType.HAZELCAST_MAP
  244.             );
  245.    
  246.    
  247.     private static Map<String, PolicyGroupByActiveThreadsType> mappingCostantiToHazelcastApprox = Map.of(  
  248.             Costanti.VALUE_MODALITA_TIPOLOGIA_HAZELCAST_CONTATORI_PNCOUNTER,  PolicyGroupByActiveThreadsType.HAZELCAST_PNCOUNTER,
  249.             Costanti.VALUE_MODALITA_TIPOLOGIA_HAZELCAST_CONTATORI_ATOMIC_LONG_ASYNC, PolicyGroupByActiveThreadsType.HAZELCAST_ATOMIC_LONG_ASYNC,
  250.             Costanti.VALUE_MODALITA_TIPOLOGIA_HAZELCAST_NEAR_CACHE, PolicyGroupByActiveThreadsType.HAZELCAST_NEAR_CACHE,
  251.             Costanti.VALUE_MODALITA_TIPOLOGIA_HAZELCAST_LOCAL_CACHE, PolicyGroupByActiveThreadsType.HAZELCAST_LOCAL_CACHE
  252.         );
  253.    
  254.     private static Map<String, PolicyGroupByActiveThreadsType> mappingCostantiToHazelcastInconsistent = Map.of(
  255.             Costanti.VALUE_MODALITA_TIPOLOGIA_HAZELCAST_REMOTE_SYNC, PolicyGroupByActiveThreadsType.HAZELCAST_NEAR_CACHE_UNSAFE_SYNC_MAP,
  256.             Costanti.VALUE_MODALITA_TIPOLOGIA_HAZELCAST_REMOTE_ASYNC, PolicyGroupByActiveThreadsType.HAZELCAST_NEAR_CACHE_UNSAFE_ASYNC_MAP,
  257.             Costanti.VALUE_MODALITA_TIPOLOGIA_HAZELCAST_REPLICATED_MAP, PolicyGroupByActiveThreadsType.HAZELCAST_REPLICATED_MAP
  258.         );
  259.    
  260.    
  261.     private static Map<String, PolicyGroupByActiveThreadsType> mappingCostantiToRedisExact = Map.of(
  262.             Costanti.VALUE_MODALITA_TIPOLOGIA_REDIS_CONTATORI_ATOMIC_LONG, PolicyGroupByActiveThreadsType.REDISSON_ATOMIC_LONG,
  263.             Costanti.VALUE_MODALITA_TIPOLOGIA_REDIS_REDDISSON_MAP, PolicyGroupByActiveThreadsType.REDISSON_MAP
  264.         );
  265.            
  266.    
  267.     private static Map<String, PolicyGroupByActiveThreadsType> mappingCostantiToRedisInconsistent= Map.of(
  268.             Costanti.VALUE_MODALITA_TIPOLOGIA_REDIS_CONTATORI_LONGADDER, PolicyGroupByActiveThreadsType.REDISSON_LONGADDER
  269.             );
  270.            
  271.    
  272.     private void initRuntimeInfo(boolean all) throws Exception {
  273.         if(!Costanti.VALUE_MODALITA_SINCRONIZZAZIONE_DEFAULT.equals(this.syncMode)) {
  274.             if(Costanti.VALUE_MODALITA_SINCRONIZZAZIONE_LOCALE.equals(this.syncMode)) {
  275.                 this.type = PolicyGroupByActiveThreadsType.LOCAL;
  276.             }
  277.             else if(Costanti.VALUE_MODALITA_SINCRONIZZAZIONE_LOCALE_SUDDIVISA_TRA_NODI.equals(this.syncMode)) {
  278.                 this.type = PolicyGroupByActiveThreadsType.LOCAL_DIVIDED_BY_NODES;
  279.             }
  280.             else if(Costanti.VALUE_MODALITA_SINCRONIZZAZIONE_DISTRIBUITA.equals(this.syncMode)) {
  281.                 if(Costanti.VALUE_MODALITA_IMPLEMENTAZIONE_DATABASE.equals(this.impl)) {
  282.                     this.type = PolicyGroupByActiveThreadsType.DATABASE;
  283.                 }
  284.                 else if(Costanti.VALUE_MODALITA_IMPLEMENTAZIONE_HAZELCAST.equals(this.impl)) {
  285.                     if(Costanti.VALUE_MODALITA_CONTATORI_EXACT.equals(this.count)) {
  286.                         this.type = mappingCostantiToHazelcastExact.get(this.engineType);
  287.                     }
  288.                     else if(Costanti.VALUE_MODALITA_CONTATORI_APPROXIMATED.equals(this.count)) {
  289.                         this.type = mappingCostantiToHazelcastApprox.get(this.engineType);  
  290.                     }
  291.                     else if(Costanti.VALUE_MODALITA_CONTATORI_INCONSISTENT.equals(this.count)) {
  292.                         this.type = mappingCostantiToHazelcastInconsistent.get(this.engineType);    
  293.                     }
  294.                 }
  295.                 else if(Costanti.VALUE_MODALITA_IMPLEMENTAZIONE_REDIS.equals(this.impl)) {
  296.                     if(Costanti.VALUE_MODALITA_CONTATORI_EXACT.equals(this.count)) {
  297.                         this.type = mappingCostantiToRedisExact.get(this.engineType);
  298.                     }
  299. //                  else if(Costanti.VALUE_MODALITA_CONTATORI_APPROXIMATED.equals(this.count)) {
  300. //                      this.type = mappingCostantiToRedisApprox.get(this.engineType);  
  301. //                  }
  302.                     else if(Costanti.VALUE_MODALITA_CONTATORI_INCONSISTENT.equals(this.count)) {
  303.                         this.type = mappingCostantiToRedisInconsistent.get(this.engineType);    
  304.                     }
  305.                 }
  306.             }
  307.         }
  308.        
  309.         if(all) {
  310.             initRuntimeInfoAll();
  311.         }
  312.    
  313.     }
  314.     protected abstract void initRuntimeInfoAll() throws Exception;
  315.    
  316.     public void saveIn(List<Proprieta> list) throws Exception {
  317.         this.initRuntimeInfo(false);
  318.         if(this.type!=null) {
  319.             list.add(newProprieta(Costanti.GESTORE, this.type.name()));
  320.         }
  321.         if(this.gestorePolicyConfigDate!=null) {
  322.             list.add(newProprieta(Costanti.GESTORE_CONFIG_DATE, this.gestorePolicyConfigDate.longValue()+""));
  323.         }
  324.         list.add(newProprieta(Costanti.MODALITA_SINCRONIZZAZIONE, this.syncMode));
  325.         if(this.impl!=null && StringUtils.isNotEmpty(this.impl)) {
  326.             list.add(newProprieta(Costanti.MODALITA_IMPLEMENTAZIONE, this.impl));
  327.         }
  328.         if(this.count!=null && StringUtils.isNotEmpty(this.count)) {
  329.             list.add(newProprieta(Costanti.MODALITA_CONTATORI, this.count));
  330.         }
  331.         if(this.engineType!=null && StringUtils.isNotEmpty(this.engineType)) {
  332.             list.add(newProprieta(Costanti.MODALITA_TIPOLOGIA, this.engineType));
  333.         }
  334.        
  335.         list.add(newProprieta(Costanti.MODALITA_GENERAZIONE_HEADER_HTTP, this.httpMode));
  336.         if(this.httpMode_limit!=null && StringUtils.isNotEmpty(this.httpMode_limit)) {
  337.             list.add(newProprieta(Costanti.MODALITA_GENERAZIONE_HEADER_HTTP_LIMIT, this.httpMode_limit));
  338.         }
  339.         if(this.httpMode_remaining!=null && StringUtils.isNotEmpty(this.httpMode_remaining)) {
  340.             list.add(newProprieta(Costanti.MODALITA_GENERAZIONE_HEADER_HTTP_REMAINING, this.httpMode_remaining));
  341.         }
  342.         if(this.httpMode_reset!=null && StringUtils.isNotEmpty(this.httpMode_reset)) {
  343.             list.add(newProprieta(Costanti.MODALITA_GENERAZIONE_HEADER_HTTP_RESET, this.httpMode_reset));
  344.         }
  345.         if(this.httpMode_retry_after!=null && StringUtils.isNotEmpty(this.httpMode_retry_after)) {
  346.             list.add(newProprieta(Costanti.MODALITA_GENERAZIONE_HEADER_HTTP_RETRY_AFTER, this.httpMode_retry_after));
  347.         }
  348.         if(this.httpMode_retry_after_backoff!=null && StringUtils.isNotEmpty(this.httpMode_retry_after_backoff)) {
  349.             list.add(newProprieta(Costanti.MODALITA_GENERAZIONE_HEADER_HTTP_RETRY_AFTER_BACKOFF_SECONDS, this.httpMode_retry_after_backoff));
  350.         }
  351.     }
  352.     private Proprieta newProprieta(String nome, String valore) {
  353.         Proprieta p = new Proprieta();
  354.         p.setNome(nome);
  355.         p.setValore(valore);
  356.         return p;
  357.     }
  358.    
  359.     public Long getGestorePolicyConfigDate() {
  360.         return this.gestorePolicyConfigDate;
  361.     }
  362.     public void setGestorePolicyConfigDate(Long gestorePolicyConfigDate) {
  363.         this.gestorePolicyConfigDate = gestorePolicyConfigDate;
  364.     }
  365.     public String getSyncMode() {
  366.         return this.syncMode;
  367.     }
  368.     public void setSyncMode(String syncMode) {
  369.         if(syncMode!=null && StringUtils.isNotEmpty(syncMode)) {
  370.             this.syncMode = syncMode;
  371.         }
  372.         else {
  373.             this.syncMode = Costanti.VALUE_MODALITA_SINCRONIZZAZIONE_DEFAULT;
  374.         }
  375.     }
  376.     public String getImpl() {
  377.         return this.impl;
  378.     }
  379.     public void setImpl(String impl) {
  380.         if(impl!=null && StringUtils.isNotEmpty(impl)) {
  381.             this.impl = impl;
  382.         }
  383.         else {
  384.             this.impl = null;
  385.         }
  386.     }
  387.     public String getCount() {
  388.         return this.count;
  389.     }
  390.     public void setCount(String count) {
  391.         if(count!=null && StringUtils.isNotEmpty(count)) {
  392.             this.count = count;
  393.         }
  394.         else {
  395.             this.count = null;
  396.         }
  397.     }
  398.     public String getEngineType() {
  399.         return this.engineType;
  400.     }
  401.     public void setEngineType(String engineType) {
  402.         if(engineType!=null && StringUtils.isNotEmpty(engineType)) {
  403.             this.engineType = engineType;
  404.         }
  405.         else {
  406.             this.engineType = null;
  407.         }
  408.     }
  409.     public String getHttpMode() {
  410.         return this.httpMode;
  411.     }
  412.     public void setHttpMode(String httpMode) {
  413.         if(httpMode!=null && StringUtils.isNotEmpty(httpMode)) {
  414.             this.httpMode = httpMode;
  415.         }
  416.         else {
  417.             this.httpMode = Costanti.VALUE_HTTP_HEADER_DEFAULT;
  418.         }
  419.     }
  420.     public String getHttpMode_limit() {
  421.         return this.httpMode_limit;
  422.     }
  423.     public void setHttpMode_limit(String httpMode_limit) {
  424.         if(httpMode_limit!=null && StringUtils.isNotEmpty(httpMode_limit)) {
  425.             this.httpMode_limit = httpMode_limit;
  426.         }
  427.         else {
  428.             this.httpMode_limit = null;
  429.         }
  430.     }
  431.     public String getHttpMode_remaining() {
  432.         return this.httpMode_remaining;
  433.     }
  434.     public void setHttpMode_remaining(String httpMode_remaining) {
  435.         if(httpMode_remaining!=null && StringUtils.isNotEmpty(httpMode_remaining)) {
  436.             this.httpMode_remaining = httpMode_remaining;
  437.         }
  438.         else {
  439.             this.httpMode_remaining = null;
  440.         }
  441.     }
  442.     public String getHttpMode_reset() {
  443.         return this.httpMode_reset;
  444.     }
  445.     public void setHttpMode_reset(String httpMode_reset) {
  446.         if(httpMode_reset!=null && StringUtils.isNotEmpty(httpMode_reset)) {
  447.             this.httpMode_reset = httpMode_reset;
  448.         }
  449.         else {
  450.             this.httpMode_reset = null;
  451.         }
  452.     }
  453.     public String getHttpMode_retry_after() {
  454.         return this.httpMode_retry_after;
  455.     }
  456.     public void setHttpMode_retry_after(String httpMode_retry_after) {
  457.         if(httpMode_retry_after!=null && StringUtils.isNotEmpty(httpMode_retry_after)) {
  458.             this.httpMode_retry_after = httpMode_retry_after;
  459.         }
  460.         else {
  461.             this.httpMode_retry_after = null;
  462.         }
  463.     }
  464.     public String getHttpMode_retry_after_backoff() {
  465.         return this.httpMode_retry_after_backoff;
  466.     }
  467.     public void setHttpMode_retry_after_backoff(String httpMode_retry_after_backoff) {
  468.         if(httpMode_retry_after_backoff!=null && StringUtils.isNotEmpty(httpMode_retry_after_backoff)) {
  469.             this.httpMode_retry_after_backoff = httpMode_retry_after_backoff;
  470.         }
  471.         else {
  472.             this.httpMode_retry_after_backoff = null;
  473.         }
  474.     }
  475.    
  476.     public boolean isGestionePolicyRidefinita() {
  477.         return this.gestionePolicyRidefinita;
  478.     }
  479.     public PolicyGroupByActiveThreadsType getType() {
  480.         return this.type;
  481.     }
  482.     public boolean isLOCAL_DIVIDED_BY_NODES_remaining_zeroValue() {
  483.         return this.LOCAL_DIVIDED_BY_NODES_remaining_zeroValue;
  484.     }
  485.     public boolean isLOCAL_DIVIDED_BY_NODES_limit_roundingDown() {
  486.         return this.LOCAL_DIVIDED_BY_NODES_limit_roundingDown;
  487.     }
  488.     public boolean isLOCAL_DIVIDED_BY_NODES_limit_normalizedQuota() {
  489.         return this.LOCAL_DIVIDED_BY_NODES_limit_normalizedQuota;
  490.     }

  491.     public boolean isGestioneHttpHeadersRidefinita() {
  492.         return this.gestioneHttpHeadersRidefinita;
  493.     }
  494.     public boolean isDisabledHttpHeaders() {
  495.         return this.disabledHttpHeaders;
  496.     }
  497.     public boolean isDisabledHttpHeaders_limit() {
  498.         return this.disabledHttpHeaders_limit;
  499.     }
  500.     public boolean isForceHttpHeaders_limit_no_windows() {
  501.         return this.forceHttpHeaders_limit_no_windows;
  502.     }
  503.     public boolean isForceHttpHeaders_limit_windows() {
  504.         return this.forceHttpHeaders_limit_windows;
  505.     }
  506.     public boolean isDisabledHttpHeaders_remaining() {
  507.         return this.disabledHttpHeaders_remaining;
  508.     }
  509.     public boolean isDisabledHttpHeaders_reset() {
  510.         return this.disabledHttpHeaders_reset;
  511.     }
  512.     public boolean isDisabledHttpHeaders_retryAfter() {
  513.         return this.disabledHttpHeaders_retryAfter;
  514.     }
  515.     public boolean isForceDisabledHttpHeaders_retryAfter_backoff() {
  516.         return this.forceDisabledHttpHeaders_retryAfter_backoff;
  517.     }
  518.     public int getForceHttpHeaders_retryAfter_backoff() {
  519.         return this.forceHttpHeaders_retryAfter_backoff;
  520.     }
  521. }