IDSerialGeneratorParameter.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.utils.id.serial;

  21. /**
  22.  * IDSerialGenerator
  23.  *
  24.  * @author Poli Andrea (apoli@link.it)
  25.  * @author $Author$
  26.  * @version $Rev$, $Date$
  27.  */
  28. public class IDSerialGeneratorParameter {

  29.     private IDSerialGeneratorType tipo = IDSerialGeneratorType.DEFAULT;
  30.     private String protocollo = "@DEFAULT@"; // per usare la libreria al di fuori del contesto del protocol della PdD
  31.     private Long maxValue = Long.MAX_VALUE; // value o cifre
  32.     private String informazioneAssociataAlProgressivo= null;
  33.     private boolean wrap = true;
  34.     private Integer size = null;

  35.     private long serializableTimeWaitMs = 60000; // tempo massimo di attesa in millisecondi
  36.     private int serializableNextIntervalTimeMs = 100; // nuovo tentativo ogni 100 millisecondi (random 0-100)
  37.    
  38.     // E' possibile attivare anche il next interval time ms increment mode.
  39.     // Se abilitato il nuovo tenntativo viene effettuato nell'intervallo (0 - (serializableNextIntervalTimeMs+(serializableNextIntervalTimeMsIncrement*iterazione)))
  40.     // fino ad un massimo intervallo destro di maxSerializableNextIntervalTimeMs
  41.     private boolean serializableNextIntervalTimeMsIncrementMode = true;
  42.     private int serializableNextIntervalTimeMsIncrement = 200;
  43.     private int maxSerializableNextIntervalTimeMs = 2000;
  44.    
  45.     private String tableName;
  46.     private String columnPrg;
  47.     private String columnProtocol;
  48.     private String columnRelativeInfo;
  49.    
  50.     private int sizeBuffer = 1;
  51.    
  52.     // Non e' necessario se la riga utilizzata gia' esiste (richiede una init)
  53.     private boolean serializableLevel = true;
  54.    
  55.     public IDSerialGeneratorParameter(){
  56.     }
  57.     public IDSerialGeneratorParameter(String protocollo){
  58.         this.protocollo = protocollo;
  59.     }
  60.     public IDSerialGeneratorParameter(String protocollo,String informazioneAssociataAlProgressivo){
  61.         this.protocollo = protocollo;
  62.         this.informazioneAssociataAlProgressivo = informazioneAssociataAlProgressivo;
  63.     }
  64.    
  65.     public String getProtocollo() {
  66.         return this.protocollo;
  67.     }
  68.     public void setProtocollo(String protocollo) {
  69.         this.protocollo = protocollo;
  70.     }
  71.    
  72.     public Long getMaxValue() {
  73.         return this.maxValue;
  74.     }

  75.     public void setMaxValue(Long maxValue) {
  76.         this.maxValue = maxValue;
  77.     }
  78.    
  79.     public Integer getSize() {
  80.         return this.size;
  81.     }
  82.     public void setSize(Integer size) {
  83.         this.size = size;
  84.     }
  85.    
  86.     public IDSerialGeneratorType getTipo() {
  87.         return this.tipo;
  88.     }

  89.     public void setTipo(IDSerialGeneratorType tipo) {
  90.         this.tipo = tipo;
  91.     }
  92.    
  93.     public String getInformazioneAssociataAlProgressivo() {
  94.         return this.informazioneAssociataAlProgressivo;
  95.     }
  96.     public void setInformazioneAssociataAlProgressivo(
  97.             String informazioneAssociataAlProgressivo) {
  98.         this.informazioneAssociataAlProgressivo = informazioneAssociataAlProgressivo;
  99.     }
  100.    
  101.     public boolean isWrap() {
  102.         return this.wrap;
  103.     }
  104.     public void setWrap(boolean wrap) {
  105.         this.wrap = wrap;
  106.     }
  107.    
  108.     public long getSerializableTimeWaitMs() {
  109.         return this.serializableTimeWaitMs;
  110.     }
  111.     public void setSerializableTimeWaitMs(long serializableTimeWaitMs) {
  112.         this.serializableTimeWaitMs = serializableTimeWaitMs;
  113.     }
  114.    
  115.     public int getSerializableNextIntervalTimeMs() {
  116.         return this.serializableNextIntervalTimeMs;
  117.     }
  118.     public void setSerializableNextIntervalTimeMs(int serializableNextIntervalTimeMs) {
  119.         this.serializableNextIntervalTimeMs = serializableNextIntervalTimeMs;
  120.     }
  121.    
  122.     public boolean isSerializableNextIntervalTimeMsIncrementMode() {
  123.         return this.serializableNextIntervalTimeMsIncrementMode;
  124.     }
  125.     public void setSerializableNextIntervalTimeMsIncrementMode(boolean serializableNextIntervalTimeMsIncrementMode) {
  126.         this.serializableNextIntervalTimeMsIncrementMode = serializableNextIntervalTimeMsIncrementMode;
  127.     }
  128.     public int getSerializableNextIntervalTimeMsIncrement() {
  129.         return this.serializableNextIntervalTimeMsIncrement;
  130.     }
  131.     public void setSerializableNextIntervalTimeMsIncrement(int serializableNextIntervalTimeMsIncrement) {
  132.         this.serializableNextIntervalTimeMsIncrement = serializableNextIntervalTimeMsIncrement;
  133.     }
  134.     public int getMaxSerializableNextIntervalTimeMs() {
  135.         return this.maxSerializableNextIntervalTimeMs;
  136.     }
  137.     public void setMaxSerializableNextIntervalTimeMs(int maxSerializableNextIntervalTimeMs) {
  138.         this.maxSerializableNextIntervalTimeMs = maxSerializableNextIntervalTimeMs;
  139.     }
  140.    
  141.     public String getTableName() {
  142.         return this.tableName;
  143.     }
  144.     public void setTableName(String tableName) {
  145.         this.tableName = tableName;
  146.     }
  147.     public String getColumnPrg() {
  148.         return this.columnPrg;
  149.     }
  150.     public void setColumnPrg(String columnPrg) {
  151.         this.columnPrg = columnPrg;
  152.     }
  153.     public String getColumnProtocol() {
  154.         return this.columnProtocol;
  155.     }
  156.     public void setColumnProtocol(String columnProtocol) {
  157.         this.columnProtocol = columnProtocol;
  158.     }
  159.     public String getColumnRelativeInfo() {
  160.         return this.columnRelativeInfo;
  161.     }
  162.     public void setColumnRelativeInfo(String columnRelativeInfo) {
  163.         this.columnRelativeInfo = columnRelativeInfo;
  164.     }
  165.    
  166.     public int getSizeBuffer() {
  167.         return this.sizeBuffer;
  168.     }
  169.     public void setSizeBuffer(int sizeBuffer) {
  170.         this.sizeBuffer = sizeBuffer;
  171.     }
  172.    
  173.     public boolean isSerializableLevel() {
  174.         return this.serializableLevel;
  175.     }
  176.     public void setSerializableLevel(boolean serializableLevel) {
  177.         this.serializableLevel = serializableLevel;
  178.     }
  179. }