Remove the test flag 79/37479/2
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Wed, 21 Mar 2018 13:59:15 +0000 (14:59 +0100)
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Thu, 22 Mar 2018 08:23:52 +0000 (09:23 +0100)
Remove test flag from deploy and undeploy. Also remove useless variable
definition

Issue-ID: CLAMP-141
Change-Id: I49bd3e88b9a37d891fce243dbadb9a5f890c06cf
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
extra/docker/clamp/config/clds-policy-config-third_party_proxy.properties [deleted file]
src/main/java/org/onap/clamp/clds/service/CldsService.java

diff --git a/extra/docker/clamp/config/clds-policy-config-third_party_proxy.properties b/extra/docker/clamp/config/clds-policy-config-third_party_proxy.properties
deleted file mode 100644 (file)
index 58a89f4..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-###
-# ============LICENSE_START=======================================================
-# ONAP CLAMP
-# ================================================================================
-# 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.
-# 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
-# limitations under the License.
-# ============LICENSE_END============================================
-# ===================================================================
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-###
-
-# Configuration Settings for Policy Engine Components
-PDP_URL1=http://third_party_proxy:8085/pdp/ , testpdp, alpha123
-PDP_URL2=http://third_party_proxy:8085/pdp/ , testpdp, alpha123
-NOTIFICATION_TYPE=websocket
-NOTIFICATION_UEB_SERVERS=localhost
-NOTIFICATION_TOPIC=
-CLIENT_ID=python
-# base64 encoding
-#CLIENT_KEY=ChlakDuk
-CLIENT_KEY=dGVzdA==
-#DEVL for development
-#TEST for Test environments
-#PROD for prod environments
-ENVIRONMENT=TEST
\ No newline at end of file
index 7eff681..bce50e5 100644 (file)
@@ -401,8 +401,72 @@ public class CldsService extends SecureServiceBase {
             @PathParam("modelName") String modelName, @QueryParam("test") String test, CldsModel model)
             throws TransformerException, ParseException, GeneralSecurityException, DecoderException {
         Date startTime = new Date();
+<<<<<<< Upstream, based on f7e5aab99d6c2a0a9d5e56b561ba0513aafd504e
         CldsModel retrievedModel = null;
         Boolean errorCase = false;
+=======
+        LoggingUtils.setRequestContext("CldsService: Process model action", getPrincipalName());
+        String actionCd = action.toUpperCase();
+        SecureServicePermission permisionManage = SecureServicePermission.create(cldsPermissionTypeClManage,
+                cldsPermissionInstance, actionCd);
+        isAuthorized(permisionManage);
+        isAuthorizedForVf(model);
+        String userId = getUserId();
+        String actionStateCd = CldsEvent.ACTION_STATE_INITIATED;
+        logger.info("PUT actionCd={}", actionCd);
+        logger.info("PUT actionStateCd={}", actionStateCd);
+        logger.info("PUT modelName={}", modelName);
+        logger.info("PUT test={}", test);
+        logger.info("PUT bpmnText={}", model.getBpmnText());
+        logger.info("PUT propText={}", model.getPropText());
+        logger.info("PUT userId={}", userId);
+        logger.info("PUT getTypeId={}", model.getTypeId());
+        logger.info("PUT deploymentId={}", model.getDeploymentId());
+        if (model.getTemplateName() != null) {
+            CldsTemplate template = cldsDao.getTemplate(model.getTemplateName());
+            if (template != null) {
+                model.setTemplateId(template.getId());
+                model.setDocText(template.getPropText());
+                // This is to provide the Bpmn XML when Template part in UI is
+                // disabled
+                model.setBpmnText(template.getBpmnText());
+            }
+        }
+        // save model to db
+        model.setName(modelName);
+        model.save(cldsDao, getUserId());
+        // get vars and format if necessary
+        String prop = model.getPropText();
+        String bpmn = model.getBpmnText();
+        String docText = model.getDocText();
+        String controlName = model.getControlName();
+        String bpmnJson = cldsBpmnTransformer.doXslTransformToString(bpmn);
+        logger.info("PUT bpmnJson={}", bpmnJson);
+        // Flag indicates whether it is triggered by Validation Test button from
+        // UI
+        boolean isTest = false;
+        if (test != null && test.equalsIgnoreCase("true")) {
+            isTest = true;
+        } else {
+            String actionTestOverride = refProp.getStringValue("action.test.override");
+            if (actionTestOverride != null && actionTestOverride.equalsIgnoreCase("true")) {
+                logger.info("PUT actionTestOverride={}", actionTestOverride);
+                logger.info("PUT override test indicator and setting it to true");
+                isTest = true;
+            }
+        }
+        logger.info("PUT isTest={}", isTest);
+        boolean isInsertTestEvent = false;
+        String insertTestEvent = refProp.getStringValue("action.insert.test.event");
+        if (insertTestEvent != null && insertTestEvent.equalsIgnoreCase("true")) {
+            isInsertTestEvent = true;
+        }
+        logger.info("PUT isInsertTestEvent={}", isInsertTestEvent);
+        // determine if requested action is permitted
+        model.validateAction(actionCd);
+        logger.info("modelProp - " + prop);
+        logger.info("docText - " + docText);
+>>>>>>> 95a4d95 Remove the test flag
         try {
             LoggingUtils.setRequestContext("CldsService: Process model action", getPrincipalName());
             String actionCd = action.toUpperCase();
@@ -806,8 +870,12 @@ public class CldsService extends SecureServiceBase {
     @Path("/deploy/{modelName}")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
+<<<<<<< Upstream, based on f7e5aab99d6c2a0a9d5e56b561ba0513aafd504e
     public Response deployModel(@PathParam("modelName") String modelName,
             CldsModel model) {
+=======
+    public CldsModel deployModel(@PathParam("modelName") String modelName, CldsModel model) {
+>>>>>>> 95a4d95 Remove the test flag
         Date startTime = new Date();
         LoggingUtils.setRequestContext("CldsService: Deploy model", getPrincipalName());
         Boolean errorCase = false;
@@ -874,8 +942,12 @@ public class CldsService extends SecureServiceBase {
     @Path("/undeploy/{modelName}")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
+<<<<<<< Upstream, based on f7e5aab99d6c2a0a9d5e56b561ba0513aafd504e
     public Response unDeployModel(@PathParam("modelName") String modelName,
             CldsModel model) {
+=======
+    public CldsModel unDeployModel(@PathParam("modelName") String modelName, CldsModel model) {
+>>>>>>> 95a4d95 Remove the test flag
         Date startTime = new Date();
         LoggingUtils.setRequestContext("CldsService: Undeploy model", getPrincipalName());