2 * Copyright 2016 [ZTE] and others.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.openo.commontosca.catalog.model.externalservice.entity.containerEntity;
18 import java.util.List;
20 import javax.xml.bind.annotation.XmlAccessType;
21 import javax.xml.bind.annotation.XmlAccessorType;
22 import javax.xml.bind.annotation.XmlAttribute;
23 import javax.xml.bind.annotation.XmlElement;
24 import javax.xml.bind.annotation.XmlElementWrapper;
25 import javax.xml.bind.annotation.XmlRootElement;
28 @XmlAccessorType(XmlAccessType.NONE)
29 public class ContainerServiceTemplate {
31 private String templateid;
34 private String templatename;
36 @XmlElement(name = "BoundaryDefinitions")
37 private BoundaryDefinitions boundary;
39 public String getTemplateid() {
43 public void setTemplateid(String templateid) {
44 this.templateid = templateid;
47 public String getTemplatename() {
51 public void setTemplatename(String templatename) {
52 this.templatename = templatename;
55 public BoundaryDefinitions getBoundary() {
59 public void setBoundary(BoundaryDefinitions boundary) {
60 this.boundary = boundary;
64 @XmlAccessorType(XmlAccessType.NONE)
65 public static class BoundaryDefinitions {
66 @XmlElement(name = "Properties", namespace = "http://docs.oasis-open.org/tosca/ns/2011/12")
67 private BoundaryProperties properties;
69 public BoundaryProperties getProperties() {
73 public void setProperties(BoundaryProperties properties) {
74 this.properties = properties;
80 @XmlAccessorType(XmlAccessType.NONE)
81 public static class BoundaryProperties {
82 @XmlElement(name = "Properties")
83 private BoundaryProperty property;
85 public BoundaryProperty getProperty() {
89 public void setProperty(BoundaryProperty property) {
90 this.property = property;
95 @XmlAccessorType(XmlAccessType.NONE)
96 public static class BoundaryProperty {
97 public String getTemplateVersion() {
98 return templateVersion;
101 public void setTemplateVersion(String templateVersion) {
102 this.templateVersion = templateVersion;
105 public String getTemplateAuthor() {
106 return templateAuthor;
109 public void setTemplateAuthor(String templateAuthor) {
110 this.templateAuthor = templateAuthor;
113 public String getVendor() {
117 public void setVendor(String vendor) {
118 this.vendor = vendor;
121 public String getVersion() {
125 public void setVersion(String version) {
126 this.version = version;
129 public String getNfvType() {
133 public void setNfvType(String nfvType) {
134 this.nfvType = nfvType;
137 public String getMoc() {
141 public void setMoc(String moc) {
145 public String getFlavor() {
149 public void setFlavor(String flavor) {
150 this.flavor = flavor;
153 public List<STFlavor> getStFlavor() {
157 public void setStFlavor(List<STFlavor> stFlavor) {
158 this.stFlavor = stFlavor;
162 private String templateVersion;
165 private String templateAuthor;
168 private String vendor;
171 private String version;
174 private String nfvType;
180 private String flavor;
182 @XmlElementWrapper(name = "flavorList")
183 @XmlElement(name = "flavor")
184 private List<STFlavor> stFlavor;
188 @XmlAccessorType(XmlAccessType.NONE)
189 public static class STFlavor {
196 @XmlElementWrapper(name = "nodeList")
197 @XmlElement(name = "node")
198 private List<STFlavorConstituent> stFlavorConstituent;
200 public String getName() {
204 public void setName(String name) {
208 public String getDesc() {
212 public void setDesc(String desc) {
216 public List<STFlavorConstituent> getStFlavorConstituent() {
217 return stFlavorConstituent;
220 public void setStFlavorConstituent(
221 List<STFlavorConstituent> stFlavorConstituent) {
222 this.stFlavorConstituent = stFlavorConstituent;
227 @XmlAccessorType(XmlAccessType.NONE)
228 public static class STFlavorConstituent {
230 private String numberOfInstances;
236 private String refNodeFlavor;
239 private String affinity;
242 private String redundancyModel;
245 private String capability;
247 public String getAffinity() {
251 public void setAffinity(String affinity) {
252 this.affinity = affinity;
255 public String getRedundancyModel() {
256 return redundancyModel;
259 public void setRedundancyModel(String redundancyModel) {
260 this.redundancyModel = redundancyModel;
263 public String getCapability() {
267 public void setCapability(String capability) {
268 this.capability = capability;
271 public String getNumberOfInstances() {
272 return numberOfInstances;
275 public void setNumberOfInstances(String numberOfInstances) {
276 this.numberOfInstances = numberOfInstances;
279 public String getName() {
283 public void setName(String name) {
287 public String getRefNodeFlavor() {
288 return refNodeFlavor;
291 public void setRefNodeFlavor(String refNodeFlavor) {
292 this.refNodeFlavor = refNodeFlavor;
296 private Boolean propNullFlag;
298 private boolean isPropNotNull() {
299 if (null == propNullFlag) {
300 propNullFlag = null != this.getBoundary()
301 && null != this.getBoundary().getProperties()
302 && null != this.getBoundary().getProperties().getProperty();
307 public String getProductType() {
308 return isPropNotNull() ? this.getBoundary().getProperties()
309 .getProperty().getMoc() : null;
312 public String getVendor() {
313 return isPropNotNull() ? this.getBoundary().getProperties()
314 .getProperty().getVendor() : null;
317 public String getVersion() {
318 return isPropNotNull() ? this.getBoundary().getProperties()
319 .getProperty().getVersion() : null;
322 public String getNfvtype() {
323 return isPropNotNull() ? this.getBoundary().getProperties()
324 .getProperty().getNfvType() : null;
327 public String getFlavor() {
328 return isPropNotNull() ? this.getBoundary().getProperties()
329 .getProperty().getFlavor() : null;
332 public List<STFlavor> getSTFlavorList() {
333 return isPropNotNull() ? this.getBoundary().getProperties()
334 .getProperty().getStFlavor() : null;