Remove ECOMP in headers
[clamp.git] / src / main / java / org / onap / clamp / clds / model / properties / ModelProperties.java
index f9b1c25..5b002e7 100644 (file)
@@ -18,7 +18,7 @@
  * limitations under the License.
  * ============LICENSE_END============================================
  * ===================================================================
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * 
  */
 
 package org.onap.clamp.clds.model.properties;
@@ -26,7 +26,6 @@ package org.onap.clamp.clds.model.properties;
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
 import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
 
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
@@ -37,10 +36,13 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.apache.camel.Exchange;
+import org.onap.clamp.clds.client.req.policy.PolicyClient;
+import org.onap.clamp.clds.config.ClampProperties;
 import org.onap.clamp.clds.exception.ModelBpmnException;
 import org.onap.clamp.clds.model.CldsEvent;
 import org.onap.clamp.clds.model.CldsModel;
 import org.onap.clamp.clds.service.CldsService;
+import org.onap.clamp.clds.util.JacksonUtils;
 
 /**
  * Parse model properties.
@@ -96,7 +98,7 @@ public class ModelProperties {
             this.actionCd = actionCd;
             this.testOnly = isATest;
             modelBpmn = ModelBpmn.create(modelBpmnText);
-            modelJson = new ObjectMapper().readTree(modelPropText);
+            modelJson = JacksonUtils.getObjectMapperInstance().readTree(modelPropText);
             instantiateMissingModelElements();
         } catch (IOException e) {
             throw new ModelBpmnException("Exception occurred when trying to decode the BPMN Properties JSON", e);
@@ -141,8 +143,7 @@ public class ModelProperties {
     public static String getVf(CldsModel model) {
         List<String> vfs = null;
         try {
-            ObjectMapper mapper = new ObjectMapper();
-            JsonNode modelJson = mapper.readTree(model.getPropText());
+            JsonNode modelJson = JacksonUtils.getObjectMapperInstance().readTree(model.getPropText());
             Global global = new Global(modelJson);
             vfs = global.getResourceVf();
         } catch (IOException e) {
@@ -223,6 +224,15 @@ public class ModelProperties {
         return normalizePolicyScopeName(modelName + "." + getCurrentPolicyName());
     }
 
+    /**
+     * @return The policyName that wil be used in input parameters of DCAE
+     *         deploy
+     */
+    public String getPolicyNameForDcaeDeploy(ClampProperties refProp) {
+        return normalizePolicyScopeName(modelName + "."
+                + refProp.getStringValue(PolicyClient.POLICY_MS_NAME_PREFIX_PROPERTY_NAME) + getCurrentPolicyName());
+    }
+
     /**
      * @return the policyScopeAndNameWithUniqueId
      */