Remove ECOMP in headers
[clamp.git] / src / main / java / org / onap / clamp / clds / client / req / tca / TcaRequestFormatter.java
index 385a4e4..4a07ca3 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP CLAMP
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -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.client.req.tca;
@@ -28,24 +28,24 @@ import com.att.eelf.configuration.EELFManager;
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.fasterxml.jackson.dataformat.yaml.snakeyaml.Yaml;
 
 import java.io.IOException;
 import java.util.Map;
 
+import org.onap.clamp.clds.config.ClampProperties;
 import org.onap.clamp.clds.exception.TcaRequestFormatterException;
-import org.onap.clamp.clds.model.prop.ModelProperties;
-import org.onap.clamp.clds.model.prop.Tca;
-import org.onap.clamp.clds.model.prop.TcaItem;
-import org.onap.clamp.clds.model.prop.TcaThreshold;
-import org.onap.clamp.clds.model.refprop.RefProp;
+import org.onap.clamp.clds.model.properties.ModelProperties;
+import org.onap.clamp.clds.model.properties.Tca;
+import org.onap.clamp.clds.model.properties.TcaItem;
+import org.onap.clamp.clds.model.properties.TcaThreshold;
+import org.yaml.snakeyaml.Yaml;
 
 /**
  * Construct the requests for TCA policy and SDC.
- *
  */
 public class TcaRequestFormatter {
-    protected static final EELFLogger logger        = EELFManager.getInstance().getLogger(TcaRequestFormatter.class);
+
+    protected static final EELFLogger logger = EELFManager.getInstance().getLogger(TcaRequestFormatter.class);
     protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
 
     /**
@@ -64,7 +64,7 @@ public class TcaRequestFormatter {
      *            The Model Prop created from BPMN JSON and BPMN properties JSON
      * @return The Json string containing that should be sent to policy
      */
-    public static String createPolicyJson(RefProp refProp, ModelProperties modelProperties) {
+    public static String createPolicyJson(ClampProperties refProp, ModelProperties modelProperties) {
         try {
             String service = modelProperties.getGlobal().getService();
             Tca tca = modelProperties.getType(Tca.class);
@@ -72,7 +72,6 @@ public class TcaRequestFormatter {
             ObjectNode rootNode = (ObjectNode) refProp.getJsonTemplate("tca.policy.template", service);
             String policyName = modelProperties.getCurrentPolicyScopeAndPolicyName();
             rootNode.put("policyName", policyName);
-            rootNode.put("description", "MicroService vCPE Policy");
             ((ObjectNode) rootNode.get("content")).replace("tca_policy",
                     createPolicyContent(refProp, modelProperties, service, policyName, tca));
             String tcaPolicyReq = rootNode.toString();
@@ -103,7 +102,7 @@ public class TcaRequestFormatter {
      *            modelProperties.setCurrentModelElementId will be used
      * @return The Json node containing what should be sent to policy
      */
-    public static JsonNode createPolicyContent(RefProp refProp, ModelProperties modelProperties, String service,
+    public static JsonNode createPolicyContent(ClampProperties refProp, ModelProperties modelProperties, String service,
             String policyName, Tca tca) {
         try {
             String serviceToUse = service;
@@ -153,7 +152,7 @@ public class TcaRequestFormatter {
      *            The Model Properties created from BPMN JSON and BPMN
      *            properties JSON
      */
-    private static void addThresholds(RefProp refProp, String service, ObjectNode appendToNode, TcaItem tcaItem,
+    private static void addThresholds(ClampProperties refProp, String service, ObjectNode appendToNode, TcaItem tcaItem,
             ModelProperties modelProperties) {
         ArrayNode tcaNodes = appendToNode.withArray("thresholds");
         ObjectNode tcaNode;
@@ -185,7 +184,7 @@ public class TcaRequestFormatter {
      *            The yaml string received from the UI
      * @return The updated YAML as a string
      */
-    public static String updatedBlueprintWithConfiguration(RefProp refProp, ModelProperties modelProperties,
+    public static String updatedBlueprintWithConfiguration(ClampProperties refProp, ModelProperties modelProperties,
             String yamlValue) {
         String jsonPolicy = ((ObjectNode) createPolicyContent(refProp, modelProperties, null, null, null)).toString();
         logger.info("Yaml that will be updated:" + yamlValue);