Message.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 org.openspcoop2.core.registry.constants.BindingUse;
  28. import java.io.Serializable;
  29. import java.util.ArrayList;
  30. import java.util.List;


  31. /** <p>Java class for message complex type.
  32.  *
  33.  * <p>The following schema fragment specifies the expected content contained within this class.
  34.  *
  35.  * <pre>
  36.  * &lt;complexType name="message"&gt;
  37.  *      &lt;sequence&gt;
  38.  *          &lt;element name="part" type="{http://www.openspcoop2.org/core/registry}message-part" minOccurs="0" maxOccurs="unbounded"/&gt;
  39.  *      &lt;/sequence&gt;
  40.  *      &lt;attribute name="use" type="{http://www.openspcoop2.org/core/registry}BindingUse" use="optional" default="literal"/&gt;
  41.  *      &lt;attribute name="soap-namespace" type="{http://www.w3.org/2001/XMLSchema}string" use="optional"/&gt;
  42.  * &lt;/complexType&gt;
  43.  * </pre>
  44.  *
  45.  * @version $Rev$, $Date$
  46.  *
  47.  * @author Poli Andrea (poli@link.it)
  48.  * @author $Author$
  49.  * */

  50. @XmlAccessorType(XmlAccessType.FIELD)
  51. @XmlType(name = "message",
  52.   propOrder = {
  53.     "part"
  54.   }
  55. )

  56. @XmlRootElement(name = "message")

  57. public class Message extends org.openspcoop2.utils.beans.BaseBeanWithId implements Serializable , Cloneable {
  58.   public Message() {
  59.     super();
  60.   }

  61.   public void addPart(MessagePart part) {
  62.     this.part.add(part);
  63.   }

  64.   public MessagePart getPart(int index) {
  65.     return this.part.get( index );
  66.   }

  67.   public MessagePart removePart(int index) {
  68.     return this.part.remove( index );
  69.   }

  70.   public List<MessagePart> getPartList() {
  71.     return this.part;
  72.   }

  73.   public void setPartList(List<MessagePart> part) {
  74.     this.part=part;
  75.   }

  76.   public int sizePartList() {
  77.     return this.part.size();
  78.   }

  79.   public void setUseRawEnumValue(String value) {
  80.     this.use = (BindingUse) BindingUse.toEnumConstantFromString(value);
  81.   }

  82.   public String getUseRawEnumValue() {
  83.     if(this.use == null){
  84.         return null;
  85.     }else{
  86.         return this.use.toString();
  87.     }
  88.   }

  89.   public org.openspcoop2.core.registry.constants.BindingUse getUse() {
  90.     return this.use;
  91.   }

  92.   public void setUse(org.openspcoop2.core.registry.constants.BindingUse use) {
  93.     this.use = use;
  94.   }

  95.   public java.lang.String getSoapNamespace() {
  96.     return this.soapNamespace;
  97.   }

  98.   public void setSoapNamespace(java.lang.String soapNamespace) {
  99.     this.soapNamespace = soapNamespace;
  100.   }

  101.   private static final long serialVersionUID = 1L;



  102.   @XmlElement(name="part",required=true,nillable=false)
  103.   private List<MessagePart> part = new ArrayList<>();

  104.   /**
  105.    * Use method getPartList
  106.    * @return List&lt;MessagePart&gt;
  107.   */
  108.   public List<MessagePart> getPart() {
  109.     return this.getPartList();
  110.   }

  111.   /**
  112.    * Use method setPartList
  113.    * @param part List&lt;MessagePart&gt;
  114.   */
  115.   public void setPart(List<MessagePart> part) {
  116.     this.setPartList(part);
  117.   }

  118.   /**
  119.    * Use method sizePartList
  120.    * @return lunghezza della lista
  121.   */
  122.   public int sizePart() {
  123.     return this.sizePartList();
  124.   }

  125.   @javax.xml.bind.annotation.XmlTransient
  126.   protected java.lang.String useRawEnumValue;

  127.   @XmlAttribute(name="use",required=false)
  128.   protected BindingUse use = (BindingUse) BindingUse.toEnumConstantFromString("literal");

  129.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  130.   @XmlAttribute(name="soap-namespace",required=false)
  131.   protected java.lang.String soapNamespace;

  132. }