Context.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.protocol.manifest;

  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.protocol.manifest.constants.FunctionType;
  28. import org.openspcoop2.protocol.manifest.constants.ServiceBinding;
  29. import java.io.Serializable;
  30. import java.util.ArrayList;
  31. import java.util.List;


  32. /** <p>Java class for Context complex type.
  33.  *
  34.  * <p>The following schema fragment specifies the expected content contained within this class.
  35.  *
  36.  * <pre>
  37.  * &lt;complexType name="Context"&gt;
  38.  *      &lt;sequence&gt;
  39.  *          &lt;element name="subContext" type="{http://www.openspcoop2.org/protocol/manifest}SubContextMapping" minOccurs="0" maxOccurs="unbounded"/&gt;
  40.  *          &lt;element name="emptySubContext" type="{http://www.openspcoop2.org/protocol/manifest}EmptySubContextMapping" minOccurs="0" maxOccurs="1"/&gt;
  41.  *          &lt;element name="soapMediaTypeCollection" type="{http://www.openspcoop2.org/protocol/manifest}SoapMediaTypeCollection" minOccurs="0" maxOccurs="1"/&gt;
  42.  *          &lt;element name="restMediaTypeCollection" type="{http://www.openspcoop2.org/protocol/manifest}RestMediaTypeCollection" minOccurs="0" maxOccurs="1"/&gt;
  43.  *      &lt;/sequence&gt;
  44.  *      &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" use="required"/&gt;
  45.  *      &lt;attribute name="emptyFunction" type="{http://www.openspcoop2.org/protocol/manifest}FunctionType" use="optional"/&gt;
  46.  *      &lt;attribute name="binding" type="{http://www.openspcoop2.org/protocol/manifest}ServiceBinding" use="optional"/&gt;
  47.  * &lt;/complexType&gt;
  48.  * </pre>
  49.  *
  50.  * @version $Rev$, $Date$
  51.  *
  52.  * @author Poli Andrea (poli@link.it)
  53.  * @author $Author$
  54.  * */

  55. @XmlAccessorType(XmlAccessType.FIELD)
  56. @XmlType(name = "Context",
  57.   propOrder = {
  58.     "subContext",
  59.     "emptySubContext",
  60.     "soapMediaTypeCollection",
  61.     "restMediaTypeCollection"
  62.   }
  63. )

  64. @XmlRootElement(name = "Context")

  65. public class Context extends org.openspcoop2.utils.beans.BaseBean implements Serializable , Cloneable {
  66.   public Context() {
  67.     super();
  68.   }

  69.   public void addSubContext(SubContextMapping subContext) {
  70.     this.subContext.add(subContext);
  71.   }

  72.   public SubContextMapping getSubContext(int index) {
  73.     return this.subContext.get( index );
  74.   }

  75.   public SubContextMapping removeSubContext(int index) {
  76.     return this.subContext.remove( index );
  77.   }

  78.   public List<SubContextMapping> getSubContextList() {
  79.     return this.subContext;
  80.   }

  81.   public void setSubContextList(List<SubContextMapping> subContext) {
  82.     this.subContext=subContext;
  83.   }

  84.   public int sizeSubContextList() {
  85.     return this.subContext.size();
  86.   }

  87.   public EmptySubContextMapping getEmptySubContext() {
  88.     return this.emptySubContext;
  89.   }

  90.   public void setEmptySubContext(EmptySubContextMapping emptySubContext) {
  91.     this.emptySubContext = emptySubContext;
  92.   }

  93.   public SoapMediaTypeCollection getSoapMediaTypeCollection() {
  94.     return this.soapMediaTypeCollection;
  95.   }

  96.   public void setSoapMediaTypeCollection(SoapMediaTypeCollection soapMediaTypeCollection) {
  97.     this.soapMediaTypeCollection = soapMediaTypeCollection;
  98.   }

  99.   public RestMediaTypeCollection getRestMediaTypeCollection() {
  100.     return this.restMediaTypeCollection;
  101.   }

  102.   public void setRestMediaTypeCollection(RestMediaTypeCollection restMediaTypeCollection) {
  103.     this.restMediaTypeCollection = restMediaTypeCollection;
  104.   }

  105.   public java.lang.String getName() {
  106.     return this.name;
  107.   }

  108.   public void setName(java.lang.String name) {
  109.     this.name = name;
  110.   }

  111.   public void setEmptyFunctionRawEnumValue(String value) {
  112.     this.emptyFunction = (FunctionType) FunctionType.toEnumConstantFromString(value);
  113.   }

  114.   public String getEmptyFunctionRawEnumValue() {
  115.     if(this.emptyFunction == null){
  116.         return null;
  117.     }else{
  118.         return this.emptyFunction.toString();
  119.     }
  120.   }

  121.   public org.openspcoop2.protocol.manifest.constants.FunctionType getEmptyFunction() {
  122.     return this.emptyFunction;
  123.   }

  124.   public void setEmptyFunction(org.openspcoop2.protocol.manifest.constants.FunctionType emptyFunction) {
  125.     this.emptyFunction = emptyFunction;
  126.   }

  127.   public void setBindingRawEnumValue(String value) {
  128.     this.binding = (ServiceBinding) ServiceBinding.toEnumConstantFromString(value);
  129.   }

  130.   public String getBindingRawEnumValue() {
  131.     if(this.binding == null){
  132.         return null;
  133.     }else{
  134.         return this.binding.toString();
  135.     }
  136.   }

  137.   public org.openspcoop2.protocol.manifest.constants.ServiceBinding getBinding() {
  138.     return this.binding;
  139.   }

  140.   public void setBinding(org.openspcoop2.protocol.manifest.constants.ServiceBinding binding) {
  141.     this.binding = binding;
  142.   }

  143.   private static final long serialVersionUID = 1L;



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

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

  153.   /**
  154.    * Use method setSubContextList
  155.    * @param subContext List&lt;SubContextMapping&gt;
  156.   */
  157.   public void setSubContext(List<SubContextMapping> subContext) {
  158.     this.setSubContextList(subContext);
  159.   }

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

  167.   @XmlElement(name="emptySubContext",required=false,nillable=false)
  168.   protected EmptySubContextMapping emptySubContext;

  169.   @XmlElement(name="soapMediaTypeCollection",required=false,nillable=false)
  170.   protected SoapMediaTypeCollection soapMediaTypeCollection;

  171.   @XmlElement(name="restMediaTypeCollection",required=false,nillable=false)
  172.   protected RestMediaTypeCollection restMediaTypeCollection;

  173.   @javax.xml.bind.annotation.XmlSchemaType(name="string")
  174.   @XmlAttribute(name="name",required=true)
  175.   protected java.lang.String name;

  176.   @javax.xml.bind.annotation.XmlTransient
  177.   protected java.lang.String emptyFunctionRawEnumValue;

  178.   @XmlAttribute(name="emptyFunction",required=false)
  179.   protected FunctionType emptyFunction;

  180.   @javax.xml.bind.annotation.XmlTransient
  181.   protected java.lang.String bindingRawEnumValue;

  182.   @XmlAttribute(name="binding",required=false)
  183.   protected ServiceBinding binding;

  184. }