2 * Copyright 2016 ZTE Corporation.
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.container;
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(List<StFlavorConstituent> stFlavorConstituent) {
221 this.stFlavorConstituent = stFlavorConstituent;
226 @XmlAccessorType(XmlAccessType.NONE)
227 public static class StFlavorConstituent {
229 private String numberOfInstances;
235 private String refNodeFlavor;
238 private String affinity;
241 private String redundancyModel;
244 private String capability;
246 public String getAffinity() {
250 public void setAffinity(String affinity) {
251 this.affinity = affinity;
254 public String getRedundancyModel() {
255 return redundancyModel;
258 public void setRedundancyModel(String redundancyModel) {
259 this.redundancyModel = redundancyModel;
262 public String getCapability() {
266 public void setCapability(String capability) {
267 this.capability = capability;
270 public String getNumberOfInstances() {
271 return numberOfInstances;
274 public void setNumberOfInstances(String numberOfInstances) {
275 this.numberOfInstances = numberOfInstances;
278 public String getName() {
282 public void setName(String name) {
286 public String getRefNodeFlavor() {
287 return refNodeFlavor;
290 public void setRefNodeFlavor(String refNodeFlavor) {
291 this.refNodeFlavor = refNodeFlavor;
295 private Boolean propNullFlag;
297 private boolean isPropNotNull() {
298 if (null == propNullFlag) {
300 null != this.getBoundary() && null != this.getBoundary().getProperties()
301 && null != this.getBoundary().getProperties().getProperty();
306 public String getProductType() {
307 return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getMoc() : null;
310 public String getVendor() {
311 return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getVendor() : null;
314 public String getVersion() {
315 return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getVersion() : null;
318 public String getNfvtype() {
319 return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getNfvType() : null;
322 public String getFlavor() {
323 return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getFlavor() : null;
326 public List<StFlavor> getStFlavorList() {
327 return isPropNotNull() ? this.getBoundary().getProperties().getProperty().getStFlavor() : null;