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.
17 package org.openo.commontosca.catalog.model.externalservice.entity.container;
19 import java.util.List;
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.XmlElementWrapper;
26 import javax.xml.bind.annotation.XmlRootElement;
29 @XmlAccessorType(XmlAccessType.NONE)
30 public class ContainerServiceTemplate {
32 private String templateid;
35 private String templatename;
37 @XmlElement(name = "BoundaryDefinitions")
38 private BoundaryDefinitions boundary;
40 public String getTemplateid() {
44 public void setTemplateid(String templateid) {
45 this.templateid = templateid;
48 public String getTemplatename() {
52 public void setTemplatename(String templatename) {
53 this.templatename = templatename;
56 public BoundaryDefinitions getBoundary() {
60 public void setBoundary(BoundaryDefinitions boundary) {
61 this.boundary = boundary;
65 @XmlAccessorType(XmlAccessType.NONE)
66 public static class BoundaryDefinitions {
67 @XmlElement(name = "Properties", namespace = "http://docs.oasis-open.org/tosca/ns/2011/12")
68 private BoundaryProperties properties;
70 public BoundaryProperties getProperties() {
74 public void setProperties(BoundaryProperties properties) {
75 this.properties = properties;
81 @XmlAccessorType(XmlAccessType.NONE)
82 public static class BoundaryProperties {
83 @XmlElement(name = "Properties")
84 private BoundaryProperty property;
86 public BoundaryProperty getProperty() {
90 public void setProperty(BoundaryProperty property) {
91 this.property = property;
96 @XmlAccessorType(XmlAccessType.NONE)
97 public static class BoundaryProperty {
98 public String getTemplateVersion() {
99 return templateVersion;
102 public void setTemplateVersion(String templateVersion) {
103 this.templateVersion = templateVersion;
106 public String getTemplateAuthor() {
107 return templateAuthor;
110 public void setTemplateAuthor(String templateAuthor) {
111 this.templateAuthor = templateAuthor;
114 public String getVendor() {
118 public void setVendor(String vendor) {
119 this.vendor = vendor;
122 public String getVersion() {
126 public void setVersion(String version) {
127 this.version = version;
130 public String getNfvType() {
134 public void setNfvType(String nfvType) {
135 this.nfvType = nfvType;
138 public String getMoc() {
142 public void setMoc(String moc) {
146 public String getFlavor() {
150 public void setFlavor(String flavor) {
151 this.flavor = flavor;
154 public List<StFlavor> getStFlavor() {
158 public void setStFlavor(List<StFlavor> stFlavor) {
159 this.stFlavor = stFlavor;
163 private String templateVersion;
166 private String templateAuthor;
169 private String vendor;
172 private String version;
175 private String nfvType;
181 private String flavor;
183 @XmlElementWrapper(name = "flavorList")
184 @XmlElement(name = "flavor")
185 private List<StFlavor> stFlavor;
189 @XmlAccessorType(XmlAccessType.NONE)
190 public static class StFlavor {
197 @XmlElementWrapper(name = "nodeList")
198 @XmlElement(name = "node")
199 private List<StFlavorConstituent> stFlavorConstituent;
201 public String getName() {
205 public void setName(String name) {
209 public String getDesc() {
213 public void setDesc(String desc) {
217 public List<StFlavorConstituent> getStFlavorConstituent() {
218 return stFlavorConstituent;
221 public void setStFlavorConstituent(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) {
301 null != this.getBoundary() && null != this.getBoundary().getProperties()
302 && null != this.getBoundary().getProperties().getProperty();
307 public String getProductType() {
308 return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getMoc() : null;
311 public String getVendor() {
312 return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getVendor() : null;
315 public String getVersion() {
316 return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getVersion() : null;
319 public String getNfvtype() {
320 return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getNfvType() : null;
323 public String getFlavor() {
324 return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getFlavor() : null;
327 public List<StFlavor> getStFlavorList() {
328 return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getStFlavor() : null;