Connettore.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.config;

  21. import javax.xml.bind.annotation.XmlAccessType;
  22. import javax.xml.bind.annotation.XmlAccessorType;
  23. import javax.xml.bind.annotation.XmlAttribute;
  24. import javax.xml.bind.annotation.XmlElement;
  25. import javax.xml.bind.annotation.XmlRootElement;
  26. import javax.xml.bind.annotation.XmlType;
  27. import java.io.Serializable;
  28. import java.util.ArrayList;
  29. import java.util.HashMap;
  30. import java.util.Iterator;
  31. import java.util.List;
  32. import java.util.Map;
  33. import java.util.Set;


  34. /** <p>Java class for connettore complex type.
  35.  *
  36.  * <p>The following schema fragment specifies the expected content contained within this class.
  37.  *
  38.  * <pre>
  39.  * &lt;complexType name="connettore"&gt;
  40.  *      &lt;sequence&gt;
  41.  *          &lt;element name="property" type="{http://www.openspcoop2.org/core/config}Property" minOccurs="0" maxOccurs="unbounded"/&gt;
  42.  *      &lt;/sequence&gt;
  43.  *      &lt;attribute name="nome-registro" type="{http://www.w3.org/2001/XMLSchema}string" use="optional"/&gt;
  44.  *      &lt;attribute name="tipo-destinatario-trasmissione-busta" type="{http://www.w3.org/2001/XMLSchema}string" use="optional"/&gt;
  45.  *      &lt;attribute name="nome-destinatario-trasmissione-busta" type="{http://www.w3.org/2001/XMLSchema}string" use="optional"/&gt;
  46.  *      &lt;attribute name="custom" type="{http://www.w3.org/2001/XMLSchema}string" use="optional" default="false"/&gt;
  47.  *      &lt;attribute name="tipo" type="{http://www.w3.org/2001/XMLSchema}string" use="optional"/&gt;
  48.  *      &lt;attribute name="nome" type="{http://www.w3.org/2001/XMLSchema}string" use="required"/&gt;
  49.  * &lt;/complexType&gt;
  50.  * </pre>
  51.  *
  52.  * @version $Rev$, $Date$
  53.  *
  54.  * @author Poli Andrea (poli@link.it)
  55.  * @author $Author$
  56.  * */

  57. @XmlAccessorType(XmlAccessType.FIELD)
  58. @XmlType(name = "connettore",
  59.   propOrder = {
  60.     "property"
  61.   }
  62. )

  63. @XmlRootElement(name = "connettore")

  64. public class Connettore extends org.openspcoop2.utils.beans.BaseBeanWithId implements Serializable , Cloneable {
  65.   public Connettore() {
  66.     super();
  67.   }

  68.   public void addProperty(Property property) {
  69.     this.property.add(property);
  70.   }

  71.   public Property getProperty(int index) {
  72.     return this.property.get( index );
  73.   }

  74.   public Property removeProperty(int index) {
  75.     return this.property.remove( index );
  76.   }

  77.   public List<Property> getPropertyList() {
  78.     return this.property;
  79.   }

  80.   public void setPropertyList(List<Property> property) {
  81.     this.property=property;
  82.   }

  83.   public int sizePropertyList() {
  84.     return this.property.size();
  85.   }

  86.   public java.lang.String getNomeRegistro() {
  87.     return this.nomeRegistro;
  88.   }

  89.   public void setNomeRegistro(java.lang.String nomeRegistro) {
  90.     this.nomeRegistro = nomeRegistro;
  91.   }

  92.   public java.lang.String getTipoDestinatarioTrasmissioneBusta() {
  93.     return this.tipoDestinatarioTrasmissioneBusta;
  94.   }

  95.   public void setTipoDestinatarioTrasmissioneBusta(java.lang.String tipoDestinatarioTrasmissioneBusta) {
  96.     this.tipoDestinatarioTrasmissioneBusta = tipoDestinatarioTrasmissioneBusta;
  97.   }

  98.   public java.lang.String getNomeDestinatarioTrasmissioneBusta() {
  99.     return this.nomeDestinatarioTrasmissioneBusta;
  100.   }

  101.   public void setNomeDestinatarioTrasmissioneBusta(java.lang.String nomeDestinatarioTrasmissioneBusta) {
  102.     this.nomeDestinatarioTrasmissioneBusta = nomeDestinatarioTrasmissioneBusta;
  103.   }

  104.   public Boolean getCustom() {
  105.     return this.custom;
  106.   }

  107.   public void setCustom(Boolean custom) {
  108.     this.custom = custom;
  109.   }

  110.   public java.lang.String getTipo() {
  111.     return this.tipo;
  112.   }

  113.   public void setTipo(java.lang.String tipo) {
  114.     this.tipo = tipo;
  115.   }

  116.   public java.lang.String getNome() {
  117.     return this.nome;
  118.   }

  119.   public void setNome(java.lang.String nome) {
  120.     this.nome = nome;
  121.   }

  122.   private static final long serialVersionUID = 1L;



  123. public Map<String,String> getProperties(){
  124.    Map<String, String> map = new HashMap<>();
  125.    Iterator<Property> it = this.property.iterator();
  126.    while (it!=null && it.hasNext()){
  127.       Property elem = it.next();
  128.       map.put(elem.getNome(), elem.getValore());
  129.    }
  130.    return map;
  131. }

  132. public void setProperties(Map<String,String> newmap){
  133.     this.property.clear();
  134.     Set<String> keys = newmap.keySet();
  135.     Iterator<String> it = keys.iterator();
  136.     while(it.hasNext()){
  137.         String key = it.next();
  138.         Property cp = new Property();
  139.         cp.setNome(key);
  140.         cp.setValore(newmap.get(key));
  141.         this.property.add(cp);
  142.     }
  143. }

  144.   @XmlElement(name="property",required=true,nillable=false)
  145.   private List<Property> property = new ArrayList<>();

  146.   /**
  147.    * Use method getPropertyList
  148.    * @return List&lt;Property&gt;
  149.   */
  150.   public List<Property> getProperty() {
  151.     return this.getPropertyList();
  152.   }

  153.   /**
  154.    * Use method setPropertyList
  155.    * @param property List&lt;Property&gt;
  156.   */
  157.   public void setProperty(List<Property> property) {
  158.     this.setPropertyList(property);
  159.   }

  160.   /**
  161.    * Use method sizePropertyList
  162.    * @return lunghezza della lista
  163.   */
  164.   public int sizeProperty() {
  165.     return this.sizePropertyList();
  166.   }

  167.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  168.   @XmlAttribute(name="nome-registro",required=false)
  169.   protected java.lang.String nomeRegistro;

  170.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  171.   @XmlAttribute(name="tipo-destinatario-trasmissione-busta",required=false)
  172.   protected java.lang.String tipoDestinatarioTrasmissioneBusta;

  173.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  174.   @XmlAttribute(name="nome-destinatario-trasmissione-busta",required=false)
  175.   protected java.lang.String nomeDestinatarioTrasmissioneBusta;

  176.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  177.   @XmlAttribute(name="custom",required=false)
  178.   protected Boolean custom = Boolean.valueOf("false");

  179.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  180.   @XmlAttribute(name="tipo",required=false)
  181.   protected java.lang.String tipo;

  182.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  183.   @XmlAttribute(name="nome",required=true)
  184.   protected java.lang.String nome;

  185. }