2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
24 package org.onap.clamp.clds.model;
26 import org.onap.clamp.clds.dao.CldsDao;
28 import javax.ws.rs.NotFoundException;
31 * Represent a CLDS Model.
33 public class CldsTemplate {
35 public static final String STATUS_DESIGN = "DESIGN";
36 public static final String STATUS_ACTIVE = "ACTIVE";
37 public static final String STATUS_STOPPED = "STOPPED";
38 public static final String STATUS_DELETING = "DELETING";
39 public static final String STATUS_ERROR = "ERROR"; // manual intervention required
40 public static final String STATUS_UNKNOWN = "UNKNOWN";
44 private String controlNamePrefix;
45 private String controlNameUuid;
46 private String bpmnId;
47 private String bpmnUserid;
48 private String bpmnText;
49 private String imageId;
50 private String imageUserid;
51 private String imageText;
52 private String propId;
53 private String propUserid;
54 private String propText;
57 * Save template to DB.
62 public void save(CldsDao cldsDao, String userid) {
63 cldsDao.setTemplate(this, userid);
73 public static CldsTemplate retrieve(CldsDao cldsDao, String name, boolean okIfNotFound) {
75 CldsTemplate template = cldsDao.getTemplate(name);
76 if (template.getId() == null && !okIfNotFound) {
77 throw new NotFoundException();
82 public String getBpmnUserid() {
86 public void setBpmnUserid(String bpmnUserid) {
87 this.bpmnUserid = bpmnUserid;
90 public String getBpmnText() {
94 public void setBpmnText(String bpmnText) {
95 this.bpmnText = bpmnText;
98 public String getImageUserid() {
102 public void setImageUserid(String imageUserid) {
103 this.imageUserid = imageUserid;
106 public String getImageText() {
110 public void setImageText(String imageText) {
111 this.imageText = imageText;
114 public String getName() {
118 public void setName(String name) {
122 public String getControlNamePrefix() {
123 return controlNamePrefix;
126 public void setControlNamePrefix(String controlNamePrefix) {
127 this.controlNamePrefix = controlNamePrefix;
130 public String getControlNameUuid() {
131 return controlNameUuid;
134 public void setControlNameUuid(String controlNameUuid) {
135 this.controlNameUuid = controlNameUuid;
138 public String getPropId() {
142 public void setPropId(String propId) {
143 this.propId = propId;
146 public String getPropUserid() {
150 public void setPropUserid(String propUserid) {
151 this.propUserid = propUserid;
154 public String getPropText() {
158 public void setPropText(String propText) {
159 this.propText = propText;
162 public String getId() {
166 public void setId(String id) {
170 public String getBpmnId() {
174 public void setBpmnId(String bpmnId) {
175 this.bpmnId = bpmnId;
178 public String getImageId() {
182 public void setImageId(String imageId) {
183 this.imageId = imageId;