IdAccordoServizioParteSpecifica.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.registry;

  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. /** <p>Java class for id-accordo-servizio-parte-specifica complex type.
  29.  *
  30.  * <p>The following schema fragment specifies the expected content contained within this class.
  31.  *
  32.  * <pre>
  33.  * &lt;complexType name="id-accordo-servizio-parte-specifica"&gt;
  34.  *      &lt;sequence&gt;
  35.  *          &lt;element name="soggetto-erogatore" type="{http://www.openspcoop2.org/core/registry}id-soggetto" minOccurs="1" maxOccurs="1"/&gt;
  36.  *      &lt;/sequence&gt;
  37.  *      &lt;attribute name="tipo" type="{http://www.w3.org/2001/XMLSchema}string" use="required"/&gt;
  38.  *      &lt;attribute name="nome" type="{http://www.w3.org/2001/XMLSchema}string" use="required"/&gt;
  39.  *      &lt;attribute name="versione" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" use="optional" default="1"/&gt;
  40.  * &lt;/complexType&gt;
  41.  * </pre>
  42.  *
  43.  * @version $Rev$, $Date$
  44.  *
  45.  * @author Poli Andrea (poli@link.it)
  46.  * @author $Author$
  47.  * */

  48. @XmlAccessorType(XmlAccessType.FIELD)
  49. @XmlType(name = "id-accordo-servizio-parte-specifica",
  50.   propOrder = {
  51.     "soggettoErogatore"
  52.   }
  53. )

  54. @XmlRootElement(name = "id-accordo-servizio-parte-specifica")

  55. public class IdAccordoServizioParteSpecifica extends org.openspcoop2.utils.beans.BaseBeanWithId implements Serializable , Cloneable {
  56.   public IdAccordoServizioParteSpecifica() {
  57.     super();
  58.   }

  59.   public IdSoggetto getSoggettoErogatore() {
  60.     return this.soggettoErogatore;
  61.   }

  62.   public void setSoggettoErogatore(IdSoggetto soggettoErogatore) {
  63.     this.soggettoErogatore = soggettoErogatore;
  64.   }

  65.   public java.lang.String getTipo() {
  66.     return this.tipo;
  67.   }

  68.   public void setTipo(java.lang.String tipo) {
  69.     this.tipo = tipo;
  70.   }

  71.   public java.lang.String getNome() {
  72.     return this.nome;
  73.   }

  74.   public void setNome(java.lang.String nome) {
  75.     this.nome = nome;
  76.   }

  77.   public java.lang.Integer getVersione() {
  78.     return this.versione;
  79.   }

  80.   public void setVersione(java.lang.Integer versione) {
  81.     this.versione = versione;
  82.   }

  83.   private static final long serialVersionUID = 1L;



  84.   public IdAccordoServizioParteSpecifica(org.openspcoop2.core.id.IDServizio idServizio){
  85.     if(idServizio!=null){
  86.         this.tipo = idServizio.getTipo();
  87.         this.nome = idServizio.getNome();
  88.         this.versione = idServizio.getVersione();
  89.         if(idServizio.getSoggettoErogatore()!=null){
  90.             this.soggettoErogatore = new IdSoggetto();
  91.             this.soggettoErogatore.setNome(idServizio.getSoggettoErogatore().getNome());
  92.             this.soggettoErogatore.setTipo(idServizio.getSoggettoErogatore().getTipo());
  93.         }
  94.     }
  95.   }

  96.   @SuppressWarnings("deprecation")
  97.   public org.openspcoop2.core.id.IDServizio toIDServizio() throws org.openspcoop2.core.commons.CoreException{
  98.     if(this.tipo==null){
  99.         throw new org.openspcoop2.core.commons.CoreException("Tipo undefined");
  100.     }
  101.     if(this.nome==null){
  102.         throw new org.openspcoop2.core.commons.CoreException("Nome undefined");
  103.     }
  104.     if(this.versione==null){
  105.         throw new org.openspcoop2.core.commons.CoreException("Versione undefined");
  106.     }
  107.     if(this.soggettoErogatore==null){
  108.         throw new org.openspcoop2.core.commons.CoreException("SoggettoErogatore undefined");
  109.     }
  110.     if(this.soggettoErogatore.getTipo()==null){
  111.         throw new org.openspcoop2.core.commons.CoreException("TipoSoggettoErogatore undefined");
  112.     }
  113.     if(this.soggettoErogatore.getNome()==null){
  114.         throw new org.openspcoop2.core.commons.CoreException("NomeSoggettoErogatore undefined");
  115.     }
  116.     try{
  117.         org.openspcoop2.core.id.IDServizio id = new org.openspcoop2.core.id.IDServizio();
  118.         id.setTipo(this.tipo);
  119.         id.setNome(this.nome);
  120.         id.setVersione(this.versione);
  121.         if(this.soggettoErogatore!=null){
  122.             id.setSoggettoErogatore(new org.openspcoop2.core.id.IDSoggetto(this.soggettoErogatore.getTipo(),this.soggettoErogatore.getNome()));
  123.         }
  124.         return id;
  125.     }catch(Exception e){
  126.         throw new org.openspcoop2.core.commons.CoreException(e.getMessage(),e);
  127.     }
  128.   }

  129.   @XmlElement(name="soggetto-erogatore",required=true,nillable=false)
  130.   protected IdSoggetto soggettoErogatore;

  131.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  132.   @XmlAttribute(name="tipo",required=true)
  133.   protected java.lang.String tipo;

  134.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  135.   @XmlAttribute(name="nome",required=true)
  136.   protected java.lang.String nome;

  137.   @javax.xml.bind.annotation.XmlSchemaType(name="unsignedInt")
  138.   @XmlAttribute(name="versione",required=false)
  139.   protected java.lang.Integer versione = java.lang.Integer.valueOf("1");

  140. }