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 javax.ws.rs.NotFoundException;
28 import org.onap.clamp.clds.dao.CldsDao;
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
42 public static final String STATUS_UNKNOWN = "UNKNOWN";
46 private String controlNamePrefix;
47 private String controlNameUuid;
48 private String bpmnId;
49 private String bpmnUserid;
50 private String bpmnText;
51 private String imageId;
52 private String imageUserid;
53 private String imageText;
54 private String propId;
55 private String propUserid;
56 private String propText;
58 private boolean userAuthorizedToUpdate;
61 * Save template to DB.
66 public void save(CldsDao cldsDao, String userid) {
67 cldsDao.setTemplate(this, userid);
77 public static CldsTemplate retrieve(CldsDao cldsDao, String name, boolean okIfNotFound) {
79 CldsTemplate template = cldsDao.getTemplate(name);
80 if (template.getId() == null && !okIfNotFound) {
81 throw new NotFoundException();
86 public String getBpmnUserid() {
90 public void setBpmnUserid(String bpmnUserid) {
91 this.bpmnUserid = bpmnUserid;
94 public String getBpmnText() {
98 public void setBpmnText(String bpmnText) {
99 this.bpmnText = bpmnText;
102 public String getImageUserid() {
106 public void setImageUserid(String imageUserid) {
107 this.imageUserid = imageUserid;
110 public String getImageText() {
114 public void setImageText(String imageText) {
115 this.imageText = imageText;
118 public String getName() {
122 public void setName(String name) {
126 public String getControlNamePrefix() {
127 return controlNamePrefix;
130 public void setControlNamePrefix(String controlNamePrefix) {
131 this.controlNamePrefix = controlNamePrefix;
134 public String getControlNameUuid() {
135 return controlNameUuid;
138 public void setControlNameUuid(String controlNameUuid) {
139 this.controlNameUuid = controlNameUuid;
142 public String getPropId() {
146 public void setPropId(String propId) {
147 this.propId = propId;
150 public String getPropUserid() {
154 public void setPropUserid(String propUserid) {
155 this.propUserid = propUserid;
158 public String getPropText() {
162 public void setPropText(String propText) {
163 this.propText = propText;
166 public String getId() {
170 public void setId(String id) {
174 public String getBpmnId() {
178 public void setBpmnId(String bpmnId) {
179 this.bpmnId = bpmnId;
182 public String getImageId() {
186 public void setImageId(String imageId) {
187 this.imageId = imageId;
190 public boolean isUserAuthorizedToUpdate() {
191 return userAuthorizedToUpdate;
194 public void setUserAuthorizedToUpdate(boolean userAuthorizedToUpdate) {
195 this.userAuthorizedToUpdate = userAuthorizedToUpdate;