IdServizioApplicativo.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. /** <p>Java class for id-servizio-applicativo 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-servizio-applicativo"&gt;
  34.  *      &lt;sequence&gt;
  35.  *          &lt;element name="id-soggetto" type="{http://www.openspcoop2.org/core/config}id-soggetto" minOccurs="1" maxOccurs="1"/&gt;
  36.  *      &lt;/sequence&gt;
  37.  *      &lt;attribute name="nome" type="{http://www.w3.org/2001/XMLSchema}string" use="required"/&gt;
  38.  * &lt;/complexType&gt;
  39.  * </pre>
  40.  *
  41.  * @version $Rev$, $Date$
  42.  *
  43.  * @author Poli Andrea (poli@link.it)
  44.  * @author $Author$
  45.  * */

  46. @XmlAccessorType(XmlAccessType.FIELD)
  47. @XmlType(name = "id-servizio-applicativo",
  48.   propOrder = {
  49.     "idSoggetto"
  50.   }
  51. )

  52. @XmlRootElement(name = "id-servizio-applicativo")

  53. public class IdServizioApplicativo extends org.openspcoop2.utils.beans.BaseBeanWithId implements Serializable , Cloneable {
  54.   public IdServizioApplicativo() {
  55.     super();
  56.   }

  57.   public IdSoggetto getIdSoggetto() {
  58.     return this.idSoggetto;
  59.   }

  60.   public void setIdSoggetto(IdSoggetto idSoggetto) {
  61.     this.idSoggetto = idSoggetto;
  62.   }

  63.   public java.lang.String getNome() {
  64.     return this.nome;
  65.   }

  66.   public void setNome(java.lang.String nome) {
  67.     this.nome = nome;
  68.   }

  69.   private static final long serialVersionUID = 1L;



  70.   public IdServizioApplicativo(org.openspcoop2.core.id.IDServizioApplicativo idServizioApplicativo){
  71.     if(idServizioApplicativo!=null){
  72.         this.nome = idServizioApplicativo.getNome();
  73.         if(idServizioApplicativo.getIdSoggettoProprietario()!=null){
  74.             this.idSoggetto = new IdSoggetto();
  75.             this.idSoggetto.setNome(idServizioApplicativo.getIdSoggettoProprietario().getNome());
  76.             this.idSoggetto.setTipo(idServizioApplicativo.getIdSoggettoProprietario().getTipo());
  77.         }
  78.     }
  79.   }

  80.   public org.openspcoop2.core.id.IDServizioApplicativo toIDServizioApplicativo() throws org.openspcoop2.core.commons.CoreException{
  81.     if(this.nome==null){
  82.         throw new org.openspcoop2.core.commons.CoreException("Nome undefined");
  83.     }
  84.     if(this.idSoggetto==null){
  85.         throw new org.openspcoop2.core.commons.CoreException("IdSoggetto undefined");
  86.     }
  87.     if(this.idSoggetto.getTipo()==null){
  88.         throw new org.openspcoop2.core.commons.CoreException("IdSoggetto.tipo undefined");
  89.     }
  90.     if(this.idSoggetto.getNome()==null){
  91.         throw new org.openspcoop2.core.commons.CoreException("IdSoggetto.nome undefined");
  92.     }
  93.     org.openspcoop2.core.id.IDServizioApplicativo idSA = new org.openspcoop2.core.id.IDServizioApplicativo();
  94.     idSA.setNome(this.nome);
  95.     idSA.setIdSoggettoProprietario(this.idSoggetto.toIDSoggetto());
  96.     return idSA;
  97.   }

  98.   @XmlElement(name="id-soggetto",required=true,nillable=false)
  99.   protected IdSoggetto idSoggetto;

  100.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  101.   @XmlAttribute(name="nome",required=true)
  102.   protected java.lang.String nome;

  103. }