Fix Checkstyle issues
[clamp.git] / src / main / java / org / onap / clamp / clds / model / CldsTemplate.java
index 6e2c8d7..8f34083 100644 (file)
@@ -5,59 +5,62 @@
  * Copyright (C) 2017 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License"); 
- * you may not use this file except in compliance with the License. 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
  * limitations under the License.
  * ============LICENSE_END============================================
  * ===================================================================
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * 
  */
 
 package org.onap.clamp.clds.model;
 
-import org.onap.clamp.clds.dao.CldsDao;
-
 import javax.ws.rs.NotFoundException;
 
+import org.onap.clamp.clds.dao.CldsDao;
+
 /**
  * Represent a CLDS Model.
  */
 public class CldsTemplate {
 
-    public static final String STATUS_DESIGN = "DESIGN";
-    public static final String STATUS_ACTIVE = "ACTIVE";
-    public static final String STATUS_STOPPED = "STOPPED";
+    public static final String STATUS_DESIGN   = "DESIGN";
+    public static final String STATUS_ACTIVE   = "ACTIVE";
+    public static final String STATUS_STOPPED  = "STOPPED";
     public static final String STATUS_DELETING = "DELETING";
-    public static final String STATUS_ERROR = "ERROR"; // manual intervention required
-    public static final String STATUS_UNKNOWN = "UNKNOWN";
-
-    private String id;
-    private String name;
-    private String controlNamePrefix;
-    private String controlNameUuid;
-    private String bpmnId;
-    private String bpmnUserid;
-    private String bpmnText;
-    private String imageId;
-    private String imageUserid;
-    private String imageText;
-    private String propId;
-    private String propUserid;
-    private String propText;
+    // manual intervention required
+    public static final String STATUS_ERROR    = "ERROR";
+    public static final String STATUS_UNKNOWN  = "UNKNOWN";
+
+    private String             id;
+    private String             name;
+    private String             controlNamePrefix;
+    private String             controlNameUuid;
+    private String             bpmnId;
+    private String             bpmnUserid;
+    private String             bpmnText;
+    private String             imageId;
+    private String             imageUserid;
+    private String             imageText;
+    private String             propId;
+    private String             propUserid;
+    private String             propText;
+
+    private boolean            userAuthorizedToUpdate;
 
     /**
      * Save template to DB.
      *
-     * @param cldsDao
-     * @param userid
+     * @param cldsDao The cldsDao
+     * @param userid The user Id
      */
     public void save(CldsDao cldsDao, String userid) {
         cldsDao.setTemplate(this, userid);
@@ -66,9 +69,11 @@ public class CldsTemplate {
     /**
      * Retrieve from DB.
      *
-     * @param cldsDao
-     * @param name
-     * @return
+     * @param cldsDao The cldsDao
+     * @param name The template name to retrieve
+     * @param okIfNotFound 
+     *     The flag indicating whether exception will be returned in case nothing is found
+     * @return Clds template from DB
      */
     public static CldsTemplate retrieve(CldsDao cldsDao, String name, boolean okIfNotFound) {
         // get from db
@@ -183,4 +188,11 @@ public class CldsTemplate {
         this.imageId = imageId;
     }
 
+    public boolean isUserAuthorizedToUpdate() {
+        return userAuthorizedToUpdate;
+    }
+
+    public void setUserAuthorizedToUpdate(boolean userAuthorizedToUpdate) {
+        this.userAuthorizedToUpdate = userAuthorizedToUpdate;
+    }
 }