Merge "Automatic Config Policy Ui generation"
[clamp.git] / src / main / java / org / onap / clamp / clds / client / req / sdc / SdcCatalogServices.java
index 240094e..37c6257 100644 (file)
  * ============LICENSE_END============================================\r
  * Modifications copyright (c) 2018 Nokia\r
  * ===================================================================\r
- * \r
+ *\r
  */\r
 \r
 package org.onap.clamp.clds.client.req.sdc;\r
 \r
 import com.att.eelf.configuration.EELFLogger;\r
 import com.att.eelf.configuration.EELFManager;\r
-import com.fasterxml.jackson.databind.JsonNode;\r
-import com.fasterxml.jackson.databind.ObjectMapper;\r
-import com.fasterxml.jackson.databind.node.ArrayNode;\r
-import com.fasterxml.jackson.databind.node.ObjectNode;\r
-import com.fasterxml.jackson.databind.node.TextNode;\r
 \r
+import com.google.gson.JsonArray;\r
+import com.google.gson.JsonElement;\r
+import com.google.gson.JsonObject;\r
+import com.google.gson.JsonParseException;\r
+import com.google.gson.reflect.TypeToken;\r
 import java.io.BufferedReader;\r
-import java.io.DataOutputStream;\r
 import java.io.IOException;\r
 import java.io.InputStream;\r
 import java.io.InputStreamReader;\r
 import java.io.Reader;\r
 import java.io.StringReader;\r
+import java.lang.reflect.Type;\r
 import java.net.HttpURLConnection;\r
 import java.net.URL;\r
 import java.nio.charset.StandardCharsets;\r
@@ -50,10 +50,7 @@ import java.util.Date;
 import java.util.Iterator;\r
 import java.util.List;\r
 \r
-import javax.ws.rs.BadRequestException;\r
-\r
 import org.apache.commons.codec.DecoderException;\r
-import org.apache.commons.codec.digest.DigestUtils;\r
 import org.apache.commons.csv.CSVFormat;\r
 import org.apache.commons.csv.CSVRecord;\r
 import org.apache.commons.io.IOUtils;\r
@@ -66,16 +63,13 @@ import org.onap.clamp.clds.model.CldsServiceData;
 import org.onap.clamp.clds.model.CldsVfData;\r
 import org.onap.clamp.clds.model.CldsVfKPIData;\r
 import org.onap.clamp.clds.model.CldsVfcData;\r
-import org.onap.clamp.clds.model.properties.Global;\r
-import org.onap.clamp.clds.model.properties.ModelProperties;\r
-import org.onap.clamp.clds.model.sdc.SdcArtifact;\r
 import org.onap.clamp.clds.model.sdc.SdcResource;\r
 import org.onap.clamp.clds.model.sdc.SdcResourceBasicInfo;\r
 import org.onap.clamp.clds.model.sdc.SdcServiceDetail;\r
 import org.onap.clamp.clds.model.sdc.SdcServiceInfo;\r
 import org.onap.clamp.clds.service.CldsService;\r
 import org.onap.clamp.clds.util.CryptoUtils;\r
-import org.onap.clamp.clds.util.JacksonUtils;\r
+import org.onap.clamp.clds.util.JsonUtils;\r
 import org.onap.clamp.clds.util.LoggingUtils;\r
 import org.springframework.beans.factory.annotation.Autowired;\r
 import org.springframework.context.annotation.Primary;\r
@@ -97,6 +91,14 @@ public class SdcCatalogServices {
     private static final String SDC_SERVICE_URL_PROPERTY_NAME = "sdc.serviceUrl";\r
     private static final String SDC_INSTANCE_ID_CLAMP = "CLAMP-Tool";\r
     private static final String RESOURCE_URL_PREFIX = "resources";\r
+    private static final LoggingUtils utils = new LoggingUtils(logger);\r
+\r
+    private static final Type LIST_SDC_SERVICE_INFO_TYPE = new TypeToken<List<SdcServiceInfo>>() {\r
+    }.getType();\r
+\r
+    private static final Type LIST_SDC_RESOURCE_BASIC_INFO_TYPE = new TypeToken<List<SdcResourceBasicInfo>>() {\r
+    }.getType();\r
+\r
     @Autowired\r
     private ClampProperties refProp;\r
 \r
@@ -106,11 +108,11 @@ public class SdcCatalogServices {
      *\r
      * @return The String with Basic Auth and password\r
      * @throws GeneralSecurityException\r
-     *             In case of issue when decryting the SDC password\r
+     *         In case of issue when decryting the SDC password\r
      * @throws DecoderException\r
-     *             In case of issues with the decoding of the HexString message\r
+     *         In case of issues with the decoding of the HexString message\r
      */\r
-    private String getSdcBasicAuth() throws GeneralSecurityException, DecoderException {\r
+    public String getSdcBasicAuth() throws GeneralSecurityException, DecoderException {\r
         String sdcId = refProp.getStringValue("sdc.serviceUsername");\r
         String sdcPw = refProp.getStringValue("sdc.servicePassword");\r
         String password = CryptoUtils.decrypt(sdcPw);\r
@@ -119,22 +121,21 @@ public class SdcCatalogServices {
     }\r
 \r
     /**\r
-     * This method get the SDC services Information with the corresponding\r
-     * Service UUID.\r
-     * \r
+     * This method get the SDC services Information with the corresponding Service\r
+     * UUID.\r
+     *\r
      * @param uuid\r
-     *            The service UUID\r
+     *        The service UUID\r
      * @return A Json String with all the service list\r
      * @throws GeneralSecurityException\r
-     *             In case of issue when decryting the SDC password\r
+     *         In case of issue when decryting the SDC password\r
      * @throws DecoderException\r
-     *             In case of issues with the decoding of the Hex String\r
+     *         In case of issues with the decoding of the Hex String\r
      */\r
     public String getSdcServicesInformation(String uuid) throws GeneralSecurityException, DecoderException {\r
         Date startTime = new Date();\r
         String baseUrl = refProp.getStringValue(SDC_SERVICE_URL_PROPERTY_NAME);\r
         String basicAuth = getSdcBasicAuth();\r
-        LoggingUtils.setTargetContext("SDC", "getSdcServicesInformation");\r
         try {\r
             String url = baseUrl;\r
             if (uuid != null && !uuid.isEmpty()) {\r
@@ -142,6 +143,7 @@ public class SdcCatalogServices {
             }\r
             URL urlObj = new URL(url);\r
             HttpURLConnection conn = (HttpURLConnection) urlObj.openConnection();\r
+            conn = utils.invoke(conn, "SDC", "getSdcServicesInformation");\r
             conn.setRequestProperty(refProp.getStringValue(SDC_INSTANCE_ID_PROPERTY_NAME), SDC_INSTANCE_ID_CLAMP);\r
             conn.setRequestProperty(HttpHeaders.AUTHORIZATION, basicAuth);\r
             conn.setRequestProperty(HttpHeaders.CONTENT_TYPE, "application/json;charset=UTF-8");\r
@@ -149,8 +151,7 @@ public class SdcCatalogServices {
             conn.setRequestMethod("GET");\r
             String resp = getResponse(conn);\r
             logger.debug("Services list received from SDC:" + resp);\r
-            // metrics log\r
-            LoggingUtils.setResponseContext("0", "Get sdc services success", this.getClass().getName());\r
+            utils.invokeReturn();\r
             return resp;\r
         } catch (IOException e) {\r
             LoggingUtils.setResponseContext("900", "Get sdc services failed", this.getClass().getName());\r
@@ -160,14 +161,15 @@ public class SdcCatalogServices {
             LoggingUtils.setTimeContext(startTime, new Date());\r
             metricsLogger.info("getSdcServicesInformation complete");\r
         }\r
+        utils.invokeReturn();\r
         return "";\r
     }\r
 \r
     /**\r
      * To remove duplicate serviceUUIDs from sdc services List.\r
-     * \r
+     *\r
      * @param rawCldsSdcServiceList\r
-     *            A list of CldsSdcServiceInfo\r
+     *        A list of CldsSdcServiceInfo\r
      * @return A list of CldsSdcServiceInfo without duplicate service UUID\r
      */\r
     public List<SdcServiceInfo> removeDuplicateServices(List<SdcServiceInfo> rawCldsSdcServiceList) {\r
@@ -194,7 +196,7 @@ public class SdcCatalogServices {
 \r
     /**\r
      * To remove duplicate serviceUUIDs from sdc resources List.\r
-     * \r
+     *\r
      * @param rawCldsSdcResourceList\r
      * @return List of CldsSdcResource\r
      */\r
@@ -222,12 +224,12 @@ public class SdcCatalogServices {
 \r
     /**\r
      * To remove duplicate basic resources with same resourceUUIDs.\r
-     * \r
+     *\r
      * @param rawCldsSdcResourceListBasicList\r
      * @return List of CldsSdcResourceBasicInfo\r
      */\r
     public List<SdcResourceBasicInfo> removeDuplicateSdcResourceBasicInfo(\r
-            List<SdcResourceBasicInfo> rawCldsSdcResourceListBasicList) {\r
+        List<SdcResourceBasicInfo> rawCldsSdcResourceListBasicList) {\r
         List<SdcResourceBasicInfo> cldsSdcResourceBasicInfoList = new ArrayList<>();\r
         if (rawCldsSdcResourceListBasicList != null && !rawCldsSdcResourceListBasicList.isEmpty()) {\r
             // sort list\r
@@ -244,24 +246,24 @@ public class SdcCatalogServices {
             }\r
             // add the last in the list\r
             cldsSdcResourceBasicInfoList\r
-                    .add(rawCldsSdcResourceListBasicList.get(rawCldsSdcResourceListBasicList.size() - 1));\r
+                .add(rawCldsSdcResourceListBasicList.get(rawCldsSdcResourceListBasicList.size() - 1));\r
         }\r
         return cldsSdcResourceBasicInfoList;\r
     }\r
 \r
     /**\r
      * To get ServiceUUID by using serviceInvariantUUID.\r
-     * \r
+     *\r
      * @param invariantId\r
-     *            The invariant ID\r
+     *        The invariant ID\r
      * @return The service UUID\r
      * @throws GeneralSecurityException\r
-     *             In case of issue when decryting the SDC password\r
+     *         In case of issue when decryting the SDC password\r
      * @throws DecoderException\r
-     *             In case of issues with the decoding of the Hex String\r
+     *         In case of issues with the decoding of the Hex String\r
      */\r
     public String getServiceUuidFromServiceInvariantId(String invariantId)\r
-            throws GeneralSecurityException, DecoderException {\r
+        throws GeneralSecurityException, DecoderException {\r
         String serviceUuid = "";\r
         String responseStr = getSdcServicesInformation(null);\r
         List<SdcServiceInfo> rawCldsSdcServicesList = getCldsSdcServicesListFromJson(responseStr);\r
@@ -269,7 +271,7 @@ public class SdcCatalogServices {
         if (cldsSdcServicesList != null && !cldsSdcServicesList.isEmpty()) {\r
             for (SdcServiceInfo currCldsSdcServiceInfo : cldsSdcServicesList) {\r
                 if (currCldsSdcServiceInfo != null && currCldsSdcServiceInfo.getInvariantUUID() != null\r
-                        && currCldsSdcServiceInfo.getInvariantUUID().equalsIgnoreCase(invariantId)) {\r
+                    && currCldsSdcServiceInfo.getInvariantUUID().equalsIgnoreCase(invariantId)) {\r
                     serviceUuid = currCldsSdcServiceInfo.getUuid();\r
                     break;\r
                 }\r
@@ -280,20 +282,19 @@ public class SdcCatalogServices {
 \r
     /**\r
      * To get CldsAsdsServiceInfo class by parsing json string.\r
-     * \r
+     *\r
      * @param jsonStr\r
-     *            The Json string that must be decoded\r
-     * @return The list of CldsSdcServiceInfo, if there is a failure it return\r
-     *         an empty list\r
+     *        The Json string that must be decoded\r
+     * @return The list of CldsSdcServiceInfo, if there is a failure it return an\r
+     *         empty list\r
      */\r
     private List<SdcServiceInfo> getCldsSdcServicesListFromJson(String jsonStr) {\r
         if (StringUtils.isBlank(jsonStr)) {\r
             return new ArrayList<>();\r
         }\r
         try {\r
-            return JacksonUtils.getObjectMapperInstance().readValue(jsonStr, JacksonUtils.getObjectMapperInstance()\r
-                    .getTypeFactory().constructCollectionType(List.class, SdcServiceInfo.class));\r
-        } catch (IOException e) {\r
+            return JsonUtils.GSON.fromJson(jsonStr, LIST_SDC_SERVICE_INFO_TYPE);\r
+        } catch (JsonParseException e) {\r
             logger.error("Error when attempting to decode the JSON containing CldsSdcServiceInfo", e);\r
             return new ArrayList<>();\r
         }\r
@@ -303,18 +304,16 @@ public class SdcCatalogServices {
      * To get List of CldsSdcResourceBasicInfo class by parsing json string.\r
      *\r
      * @param jsonStr\r
-     *            The JSOn string that must be decoded\r
-     * @return The list of CldsSdcResourceBasicInfo, an empty list in case of\r
-     *         issues\r
+     *        The JSOn string that must be decoded\r
+     * @return The list of CldsSdcResourceBasicInfo, an empty list in case of issues\r
      */\r
     private List<SdcResourceBasicInfo> getAllSdcResourcesListFromJson(String jsonStr) {\r
         if (StringUtils.isBlank(jsonStr)) {\r
             return new ArrayList<>();\r
         }\r
         try {\r
-            return JacksonUtils.getObjectMapperInstance().readValue(jsonStr, JacksonUtils.getObjectMapperInstance()\r
-                    .getTypeFactory().constructCollectionType(List.class, SdcResourceBasicInfo.class));\r
-        } catch (IOException e) {\r
+            return JsonUtils.GSON.fromJson(jsonStr, LIST_SDC_RESOURCE_BASIC_INFO_TYPE);\r
+        } catch (JsonParseException e) {\r
             logger.error("Exception occurred when attempting to decode the list of CldsSdcResourceBasicInfo JSON", e);\r
             return new ArrayList<>();\r
         }\r
@@ -322,84 +321,20 @@ public class SdcCatalogServices {
 \r
     /**\r
      * To get CldsSdcServiceDetail by parsing json string.\r
-     * \r
+     *\r
      * @param jsonStr\r
      * @return\r
      */\r
     public SdcServiceDetail decodeCldsSdcServiceDetailFromJson(String jsonStr) {\r
         try {\r
-            return JacksonUtils.getObjectMapperInstance().readValue(jsonStr, SdcServiceDetail.class);\r
-        } catch (IOException e) {\r
+            return JsonUtils.GSON.fromJson(jsonStr, SdcServiceDetail.class);\r
+        } catch (JsonParseException e) {\r
             logger.error("Exception when attempting to decode the CldsSdcServiceDetail JSON", e);\r
             return null;\r
         }\r
     }\r
 \r
-    // upload artifact to sdc based on serviceUUID and resource name on url\r
-    private String uploadArtifactToSdc(ModelProperties prop, String userid, String url, String formattedSdcReq) {\r
-        // Verify whether it is triggered by Validation Test button from UI\r
-        if (prop.isTestOnly()) {\r
-            return "sdc artifact upload not executed for test action";\r
-        }\r
-        try {\r
-            logger.info("userid=" + userid);\r
-            byte[] postData = formattedSdcReq.getBytes(StandardCharsets.UTF_8);\r
-            int postDataLength = postData.length;\r
-            HttpURLConnection conn = getSdcHttpUrlConnection(userid, postDataLength, url, formattedSdcReq);\r
-            try (DataOutputStream wr = new DataOutputStream(conn.getOutputStream())) {\r
-                wr.write(postData);\r
-            }\r
-            boolean requestFailed = true;\r
-            int responseCode = conn.getResponseCode();\r
-            logger.info("responseCode=" + responseCode);\r
-            if (responseCode == 200) {\r
-                requestFailed = false;\r
-            }\r
-            String responseStr = getResponse(conn);\r
-            if (responseStr != null && requestFailed) {\r
-                logger.error("requestFailed - responseStr=" + responseStr);\r
-                throw new BadRequestException(responseStr);\r
-            }\r
-            return responseStr;\r
-        } catch (IOException e) {\r
-            logger.error("Exception when attempting to communicate with SDC", e);\r
-            throw new SdcCommunicationException("Exception when attempting to communicate with SDC", e);\r
-        }\r
-    }\r
-\r
-    private HttpURLConnection getSdcHttpUrlConnection(String userid, int postDataLength, String url, String content) {\r
-        try {\r
-            logger.info("userid=" + userid);\r
-            String basicAuth = getSdcBasicAuth();\r
-            String sdcXonapInstanceId = refProp.getStringValue("sdc.sdcX-InstanceID");\r
-            URL urlObj = new URL(url);\r
-            HttpURLConnection conn = (HttpURLConnection) urlObj.openConnection();\r
-            conn.setDoOutput(true);\r
-            conn.setRequestProperty(refProp.getStringValue(SDC_INSTANCE_ID_PROPERTY_NAME), sdcXonapInstanceId);\r
-            conn.setRequestProperty(HttpHeaders.AUTHORIZATION, basicAuth);\r
-            conn.setRequestProperty(HttpHeaders.CONTENT_TYPE, "application/json");\r
-            conn.setRequestProperty(HttpHeaders.CONTENT_MD5,\r
-                    Base64.getEncoder().encodeToString(DigestUtils.md5Hex(content).getBytes("UTF-8")));\r
-            conn.setRequestProperty("USER_ID", userid);\r
-            conn.setRequestMethod("POST");\r
-            conn.setRequestProperty("charset", "utf-8");\r
-            conn.setRequestProperty(HttpHeaders.CONTENT_LENGTH, Integer.toString(postDataLength));\r
-            conn.setUseCaches(false);\r
-            conn.setRequestProperty(refProp.getStringValue(SDC_REQUESTID_PROPERTY_NAME), LoggingUtils.getRequestId());\r
-            return conn;\r
-        } catch (IOException e) {\r
-            logger.error("Exception when attempting to open connection with SDC", e);\r
-            throw new SdcCommunicationException("Exception when attempting to open connection with SDC", e);\r
-        } catch (DecoderException e) {\r
-            logger.error("Exception when attempting to decode the Hex string", e);\r
-            throw new SdcCommunicationException("Exception when attempting to decode the Hex string", e);\r
-        } catch (GeneralSecurityException e) {\r
-            logger.error("Exception when attempting to decrypt the encrypted password", e);\r
-            throw new SdcCommunicationException("Exception when attempting to decrypt the encrypted password", e);\r
-        }\r
-    }\r
-\r
-    private String getResponse(HttpURLConnection conn) {\r
+    public String getResponse(HttpURLConnection conn) {\r
         try (InputStream is = getInputStream(conn)) {\r
             try (BufferedReader in = new BufferedReader(new InputStreamReader(is))) {\r
                 return IOUtils.toString(in);\r
@@ -425,46 +360,45 @@ public class SdcCatalogServices {
 \r
     /**\r
      * Check if the SDC Info in cache has expired.\r
-     * \r
+     *\r
      * @param cldsServiceData\r
-     *            The object representing the service data\r
+     *        The object representing the service data\r
      * @return boolean flag\r
      * @throws GeneralSecurityException\r
-     *             In case of issues with the decryting the encrypted password\r
+     *         In case of issues with the decryting the encrypted password\r
      * @throws DecoderException\r
-     *             In case of issues with the decoding of the Hex String\r
+     *         In case of issues with the decoding of the Hex String\r
      */\r
     public boolean isCldsSdcCacheDataExpired(CldsServiceData cldsServiceData)\r
-            throws GeneralSecurityException, DecoderException {\r
+        throws GeneralSecurityException, DecoderException {\r
         if (cldsServiceData != null && cldsServiceData.getServiceUUID() != null) {\r
             String cachedServiceUuid = cldsServiceData.getServiceUUID();\r
             String latestServiceUuid = getServiceUuidFromServiceInvariantId(cldsServiceData.getServiceInvariantUUID());\r
             String configuredMaxAge = refProp.getStringValue("clds.service.cache.invalidate.after.seconds");\r
             if (configuredMaxAge == null) {\r
                 logger.warn(\r
-                        "clds.service.cache.invalidate.after.seconds NOT set in clds-reference.properties file, taking 60s as default");\r
+                    "clds.service.cache.invalidate.after.seconds NOT set in clds-reference.properties file, taking 60s as default");\r
                 configuredMaxAge = "60";\r
             }\r
             return (!cachedServiceUuid.equalsIgnoreCase(latestServiceUuid)) || (cldsServiceData.getAgeOfRecord() != null\r
-                    && cldsServiceData.getAgeOfRecord() > Long.parseLong(configuredMaxAge));\r
+                && cldsServiceData.getAgeOfRecord() > Long.parseLong(configuredMaxAge));\r
         } else {\r
             return true;\r
         }\r
     }\r
 \r
     /**\r
-     * Get the Service Data with Alarm Conditions for a given\r
-     * invariantServiceUuid.\r
-     * \r
+     * Get the Service Data with Alarm Conditions for a given invariantServiceUuid.\r
+     *\r
      * @param invariantServiceUuid\r
      * @return The CldsServiceData\r
      * @throws GeneralSecurityException\r
-     *             In case of issues with the decryting the encrypted password\r
+     *         In case of issues with the decryting the encrypted password\r
      * @throws DecoderException\r
-     *             In case of issues with the decoding of the Hex String\r
+     *         In case of issues with the decoding of the Hex String\r
      */\r
     public CldsServiceData getCldsServiceDataWithAlarmConditions(String invariantServiceUuid)\r
-            throws GeneralSecurityException, DecoderException {\r
+        throws GeneralSecurityException, DecoderException {\r
         String url = refProp.getStringValue(SDC_SERVICE_URL_PROPERTY_NAME);\r
         String catalogUrl = refProp.getStringValue(SDC_CATALOG_URL_PROPERTY_NAME);\r
         String serviceUuid = getServiceUuidFromServiceInvariantId(invariantServiceUuid);\r
@@ -474,9 +408,8 @@ public class SdcCatalogServices {
         if (responseStr != null) {\r
             SdcServiceDetail cldsSdcServiceDetail;\r
             try {\r
-                cldsSdcServiceDetail = JacksonUtils.getObjectMapperInstance().readValue(responseStr,\r
-                        SdcServiceDetail.class);\r
-            } catch (IOException e) {\r
+                cldsSdcServiceDetail = JsonUtils.GSON.fromJson(responseStr, SdcServiceDetail.class);\r
+            } catch (JsonParseException e) {\r
                 logger.error("Exception when decoding the CldsServiceData JSON from SDC", e);\r
                 throw new SdcCommunicationException("Exception when decoding the CldsServiceData JSON from SDC", e);\r
             }\r
@@ -486,12 +419,12 @@ public class SdcCatalogServices {
                 cldsServiceData.setServiceUUID(cldsSdcServiceDetail.getUuid());\r
                 cldsServiceData.setServiceInvariantUUID(cldsSdcServiceDetail.getInvariantUUID());\r
                 List<SdcResource> cldsSdcResourceList = removeDuplicateSdcResourceInstances(\r
-                        cldsSdcServiceDetail.getResources());\r
+                    cldsSdcServiceDetail.getResources());\r
                 if (cldsSdcResourceList != null && !cldsSdcResourceList.isEmpty()) {\r
                     List<CldsVfData> cldsVfDataList = new ArrayList<>();\r
                     for (SdcResource currCldsSdcResource : cldsSdcResourceList) {\r
                         if (currCldsSdcResource != null && currCldsSdcResource.getResoucreType() != null\r
-                                && "VF".equalsIgnoreCase(currCldsSdcResource.getResoucreType())) {\r
+                            && "VF".equalsIgnoreCase(currCldsSdcResource.getResoucreType())) {\r
                             CldsVfData currCldsVfData = new CldsVfData();\r
                             currCldsVfData.setVfName(currCldsSdcResource.getResourceInstanceName());\r
                             currCldsVfData.setVfInvariantResourceUUID(currCldsSdcResource.getResourceInvariantUUID());\r
@@ -509,20 +442,20 @@ public class SdcCatalogServices {
     }\r
 \r
     private void getAllVfcForVfList(List<CldsVfData> cldsVfDataList, String catalogUrl)\r
-            throws GeneralSecurityException {\r
+        throws GeneralSecurityException {\r
         // todo : refact this..\r
         if (cldsVfDataList != null && !cldsVfDataList.isEmpty()) {\r
             List<SdcResourceBasicInfo> allVfResources = getAllSdcVForVfcResourcesBasedOnResourceType(RESOURCE_VF_TYPE);\r
             List<SdcResourceBasicInfo> allVfcResources = getAllSdcVForVfcResourcesBasedOnResourceType(\r
-                    RESOURCE_VFC_TYPE);\r
+                RESOURCE_VFC_TYPE);\r
             allVfcResources.addAll(getAllSdcVForVfcResourcesBasedOnResourceType(RESOURCE_CVFC_TYPE));\r
             for (CldsVfData currCldsVfData : cldsVfDataList) {\r
                 if (currCldsVfData != null && currCldsVfData.getVfInvariantResourceUUID() != null) {\r
                     String resourceUuid = getResourceUuidFromResourceInvariantUuid(\r
-                            currCldsVfData.getVfInvariantResourceUUID(), allVfResources);\r
+                        currCldsVfData.getVfInvariantResourceUUID(), allVfResources);\r
                     if (resourceUuid != null) {\r
                         String vfResourceUuidUrl = catalogUrl + RESOURCE_URL_PREFIX + "/" + resourceUuid\r
-                                + SDC_METADATA_URL_PREFIX;\r
+                            + SDC_METADATA_URL_PREFIX;\r
                         String vfResponse = getCldsServicesOrResourcesBasedOnURL(vfResourceUuidUrl);\r
                         if (vfResponse != null) {\r
                             // Below 2 line are to get the KPI(field path) data\r
@@ -537,22 +470,22 @@ public class SdcCatalogServices {
                                     // alarm conditions from artifact\r
                                     for (CldsVfcData currCldsVfcData : vfcDataListFromVfResponse) {\r
                                         if (currCldsVfcData != null\r
-                                                && currCldsVfcData.getVfcInvariantResourceUUID() != null) {\r
+                                            && currCldsVfcData.getVfcInvariantResourceUUID() != null) {\r
                                             String resourceVfcUuid = getResourceUuidFromResourceInvariantUuid(\r
-                                                    currCldsVfcData.getVfcInvariantResourceUUID(), allVfcResources);\r
+                                                currCldsVfcData.getVfcInvariantResourceUUID(), allVfcResources);\r
                                             if (resourceVfcUuid != null) {\r
                                                 String vfcResourceUuidUrl = catalogUrl + RESOURCE_URL_PREFIX + "/"\r
-                                                        + resourceVfcUuid + SDC_METADATA_URL_PREFIX;\r
+                                                    + resourceVfcUuid + SDC_METADATA_URL_PREFIX;\r
                                                 String vfcResponse = getCldsServicesOrResourcesBasedOnURL(\r
-                                                        vfcResourceUuidUrl);\r
+                                                    vfcResourceUuidUrl);\r
                                                 if (vfcResponse != null) {\r
                                                     List<CldsAlarmCondition> alarmCondtionsFromVfc = getAlarmCondtionsFromVfc(\r
-                                                            vfcResponse);\r
+                                                        vfcResponse);\r
                                                     currCldsVfcData.setCldsAlarmConditions(alarmCondtionsFromVfc);\r
                                                 }\r
                                             } else {\r
                                                 logger.info("No resourceVFC UUID found for given invariantID:"\r
-                                                        + currCldsVfcData.getVfcInvariantResourceUUID());\r
+                                                    + currCldsVfcData.getVfcInvariantResourceUUID());\r
                                             }\r
                                         }\r
                                     }\r
@@ -561,7 +494,7 @@ public class SdcCatalogServices {
                         }\r
                     } else {\r
                         logger.info("No resourceUUID found for given invariantREsourceUUID:"\r
-                                + currCldsVfData.getVfInvariantResourceUUID());\r
+                            + currCldsVfData.getVfInvariantResourceUUID());\r
                     }\r
                 }\r
             }\r
@@ -569,41 +502,43 @@ public class SdcCatalogServices {
     }\r
 \r
     private List<CldsVfcData> getVfcDataListFromVfResponse(String vfResponse) {\r
-        ObjectNode vfResponseNode;\r
+        JsonObject vfResponseNode;\r
         try {\r
-            vfResponseNode = (ObjectNode) JacksonUtils.getObjectMapperInstance().readTree(vfResponse);\r
-        } catch (IOException e) {\r
+            vfResponseNode = JsonUtils.GSON.fromJson(vfResponse, JsonObject.class);\r
+        } catch (JsonParseException e) {\r
             logger.error("Exception when decoding the JSON list of CldsVfcData", e);\r
             return new ArrayList<>();\r
         }\r
-        ArrayNode vfcArrayNode = (ArrayNode) vfResponseNode.get("resources");\r
+        JsonArray vfcArrayNode = vfResponseNode.get("resources").getAsJsonArray();\r
         List<CldsVfcData> cldsVfcDataList = new ArrayList<>();\r
         if (vfcArrayNode != null) {\r
-            for (JsonNode vfcjsonNode : vfcArrayNode) {\r
-                ObjectNode currVfcNode = (ObjectNode) vfcjsonNode;\r
-                TextNode resourceTypeNode = (TextNode) currVfcNode.get("resoucreType");\r
-                if (resourceTypeNode != null && "VFC".equalsIgnoreCase(resourceTypeNode.textValue())) {\r
-                    handleVFCtypeNode(currVfcNode, cldsVfcDataList);\r
-                } else if (resourceTypeNode != null && "CVFC".equalsIgnoreCase(resourceTypeNode.textValue())) {\r
-                    handleCVFCtypeNode(currVfcNode, cldsVfcDataList);\r
+            for (JsonElement vfcjsonNode : vfcArrayNode) {\r
+                JsonObject currVfcNode = vfcjsonNode.getAsJsonObject();\r
+                JsonElement resourceTypeNode = currVfcNode.get("resoucreType");\r
+                if (resourceTypeNode != null && resourceTypeNode.isJsonPrimitive()) {\r
+                    if ("VFC".equalsIgnoreCase(resourceTypeNode.getAsString())) {\r
+                        handleVFCtypeNode(currVfcNode, cldsVfcDataList);\r
+                    } else if ("CVFC".equalsIgnoreCase(resourceTypeNode.getAsString())) {\r
+                        handleCVFCtypeNode(currVfcNode, cldsVfcDataList);\r
+                    }\r
                 }\r
             }\r
         }\r
         return cldsVfcDataList;\r
     }\r
 \r
-    private void handleVFCtypeNode(ObjectNode currVfcNode, List<CldsVfcData> cldsVfcDataList) {\r
+    private void handleVFCtypeNode(JsonObject currVfcNode, List<CldsVfcData> cldsVfcDataList) {\r
         CldsVfcData currCldsVfcData = new CldsVfcData();\r
-        TextNode vfcResourceName = (TextNode) currVfcNode.get("resourceInstanceName");\r
-        TextNode vfcInvariantResourceUuid = (TextNode) currVfcNode.get("resourceInvariantUUID");\r
-        currCldsVfcData.setVfcName(vfcResourceName.textValue());\r
-        currCldsVfcData.setVfcInvariantResourceUUID(vfcInvariantResourceUuid.textValue());\r
+        String vfcResourceName = currVfcNode.get("resourceInstanceName").getAsString();\r
+        String vfcInvariantResourceUuid = currVfcNode.get("resourceInvariantUUID").getAsString();\r
+        currCldsVfcData.setVfcName(vfcResourceName);\r
+        currCldsVfcData.setVfcInvariantResourceUUID(vfcInvariantResourceUuid);\r
         cldsVfcDataList.add(currCldsVfcData);\r
     }\r
 \r
-    private void handleCVFCtypeNode(ObjectNode currVfcNode, List<CldsVfcData> cldsVfcDataList) {\r
+    private void handleCVFCtypeNode(JsonObject currVfcNode, List<CldsVfcData> cldsVfcDataList) {\r
         handleVFCtypeNode(currVfcNode, cldsVfcDataList);\r
-        cldsVfcDataList.addAll(getVFCfromCVFC(currVfcNode.get("resourceUUID").textValue()));\r
+        cldsVfcDataList.addAll(getVFCfromCVFC(currVfcNode.get("resourceUUID").getAsString()));\r
     }\r
 \r
     private List<CldsVfcData> getVFCfromCVFC(String resourceUUID) {\r
@@ -613,18 +548,18 @@ public class SdcCatalogServices {
             String vfcResourceUUIDUrl = catalogUrl + RESOURCE_URL_PREFIX + "/" + resourceUUID + SDC_METADATA_URL_PREFIX;\r
             try {\r
                 String vfcResponse = getCldsServicesOrResourcesBasedOnURL(vfcResourceUUIDUrl);\r
-                ObjectNode vfResponseNode = (ObjectNode) JacksonUtils.getObjectMapperInstance().readTree(vfcResponse);\r
-                ArrayNode vfcArrayNode = (ArrayNode) vfResponseNode.get("resources");\r
+                JsonObject vfResponseNode = JsonUtils.GSON.fromJson(vfcResponse, JsonObject.class);\r
+                JsonArray vfcArrayNode = vfResponseNode.get("resources").getAsJsonArray();\r
                 if (vfcArrayNode != null) {\r
-                    for (JsonNode vfcjsonNode : vfcArrayNode) {\r
-                        ObjectNode currVfcNode = (ObjectNode) vfcjsonNode;\r
-                        TextNode resourceTypeNode = (TextNode) currVfcNode.get("resoucreType");\r
-                        if (resourceTypeNode != null && "VFC".equalsIgnoreCase(resourceTypeNode.textValue())) {\r
+                    for (JsonElement vfcjsonNode : vfcArrayNode) {\r
+                        JsonObject currVfcNode = vfcjsonNode.getAsJsonObject();\r
+                        JsonElement resourceTypeNode = currVfcNode.get("resoucreType");\r
+                        if (resourceTypeNode != null && resourceTypeNode.isJsonPrimitive() && "VFC".equalsIgnoreCase(resourceTypeNode.getAsString())) {\r
                             handleVFCtypeNode(currVfcNode, cldsVfcDataList);\r
                         }\r
                     }\r
                 }\r
-            } catch (IOException e) {\r
+            } catch (JsonParseException e) {\r
                 logger.error("Exception during JSON analyzis", e);\r
             }\r
         }\r
@@ -637,20 +572,21 @@ public class SdcCatalogServices {
 \r
     private List<CldsAlarmCondition> getAlarmCondtionsFromVfc(String vfcResponse) throws GeneralSecurityException {\r
         List<CldsAlarmCondition> cldsAlarmConditionList = new ArrayList<>();\r
-        ObjectNode vfcResponseNode;\r
+        JsonObject vfcResponseNode;\r
         try {\r
-            vfcResponseNode = (ObjectNode) JacksonUtils.getObjectMapperInstance().readTree(vfcResponse);\r
-        } catch (IOException e) {\r
+            vfcResponseNode = JsonUtils.GSON.fromJson(vfcResponse, JsonObject.class);\r
+        } catch (JsonParseException e) {\r
             logger.error("Exception when decoding the JSON list of CldsAlarmCondition", e);\r
             return cldsAlarmConditionList;\r
         }\r
-        ArrayNode artifactsArrayNode = (ArrayNode) vfcResponseNode.get("artifacts");\r
-        if (artifactsArrayNode != null && artifactsArrayNode.size() > 0) {\r
-            for (int index = 0; index < artifactsArrayNode.size(); index++) {\r
-                ObjectNode currArtifactNode = (ObjectNode) artifactsArrayNode.get(index);\r
-                TextNode artifactUrlNode = (TextNode) currArtifactNode.get("artifactURL");\r
-                if (artifactUrlNode != null) {\r
-                    String responsesFromArtifactUrl = getResponsesFromArtifactUrl(artifactUrlNode.textValue());\r
+        JsonElement artifactsNode = vfcResponseNode.get("artifacts");\r
+        if (artifactsNode != null && artifactsNode.isJsonArray() && artifactsNode.getAsJsonArray().size() > 0) {\r
+            JsonArray artifactsList = artifactsNode.getAsJsonArray();\r
+            for (int index = 0; index < artifactsList.size(); index++) {\r
+                JsonObject currArtifactNode = artifactsList.get(index).getAsJsonObject();\r
+                JsonElement artifactUrlNode = currArtifactNode.get("artifactURL");\r
+                if (artifactUrlNode != null && artifactUrlNode.isJsonPrimitive()) {\r
+                    String responsesFromArtifactUrl = getResponsesFromArtifactUrl(artifactUrlNode.getAsString());\r
                     cldsAlarmConditionList.addAll(parseCsvToGetAlarmConditions(responsesFromArtifactUrl));\r
                     logger.info(responsesFromArtifactUrl);\r
                 }\r
@@ -681,26 +617,26 @@ public class SdcCatalogServices {
     // Method to get the artifact for any particular VF\r
     private List<CldsVfKPIData> getFieldPathFromVF(String vfResponse) throws GeneralSecurityException {\r
         List<CldsVfKPIData> cldsVfKPIDataList = new ArrayList<>();\r
-        ObjectNode vfResponseNode;\r
+        JsonObject vfResponseNode;\r
         try {\r
-            vfResponseNode = (ObjectNode) JacksonUtils.getObjectMapperInstance().readTree(vfResponse);\r
-        } catch (IOException e) {\r
+            vfResponseNode = JsonUtils.GSON.fromJson(vfResponse, JsonObject.class);\r
+        } catch (JsonParseException e) {\r
             logger.error("Exception when decoding the JSON list of CldsVfKPIData", e);\r
             return cldsVfKPIDataList;\r
         }\r
-        ArrayNode artifactsArrayNode = (ArrayNode) vfResponseNode.get("artifacts");\r
+        JsonArray artifactsArrayNode = vfResponseNode.get("artifacts").getAsJsonArray();\r
         if (artifactsArrayNode != null && artifactsArrayNode.size() > 0) {\r
             for (int index = 0; index < artifactsArrayNode.size(); index++) {\r
-                ObjectNode currArtifactNode = (ObjectNode) artifactsArrayNode.get(index);\r
-                TextNode artifactUrlNode = (TextNode) currArtifactNode.get("artifactURL");\r
-                TextNode artifactNameNode = (TextNode) currArtifactNode.get("artifactName");\r
+                JsonObject currArtifactNode = artifactsArrayNode.get(index).getAsJsonObject();\r
+                JsonElement artifactUrlNode = currArtifactNode.get("artifactURL");\r
+                JsonElement artifactNameNode = currArtifactNode.get("artifactName");\r
                 String artifactName = "";\r
                 if (artifactNameNode != null) {\r
-                    artifactName = artifactNameNode.textValue();\r
+                    artifactName = artifactNameNode.getAsString();\r
                     artifactName = artifactName.substring(artifactName.lastIndexOf('.') + 1);\r
                 }\r
                 if (artifactUrlNode != null && "csv".equalsIgnoreCase(artifactName)) {\r
-                    String responsesFromArtifactUrl = getResponsesFromArtifactUrl(artifactUrlNode.textValue());\r
+                    String responsesFromArtifactUrl = getResponsesFromArtifactUrl(artifactUrlNode.getAsString());\r
                     cldsVfKPIDataList.addAll(parseCsvToGetFieldPath(responsesFromArtifactUrl));\r
                     logger.info(responsesFromArtifactUrl);\r
                 }\r
@@ -715,7 +651,7 @@ public class SdcCatalogServices {
             return null;\r
         }\r
         if (StringUtils.isBlank(record.get(1)) || StringUtils.isBlank(record.get(3))\r
-                || StringUtils.isBlank(record.get(5))) {\r
+            || StringUtils.isBlank(record.get(5))) {\r
             logger.debug("Invalid csv field path Record,one of column is having blank value : " + record);\r
             return null;\r
         }\r
@@ -759,7 +695,7 @@ public class SdcCatalogServices {
             return;\r
         }\r
         if (StringUtils.isBlank(record.get(1)) || StringUtils.isBlank(record.get(3))\r
-                || StringUtils.isBlank(record.get(4))) {\r
+            || StringUtils.isBlank(record.get(4))) {\r
             logger.debug("invalid csv alarm Record,one of column is having blank value : " + record);\r
             return;\r
         }\r
@@ -783,11 +719,11 @@ public class SdcCatalogServices {
     }\r
 \r
     /**\r
-     * Service to services/resources/artifacts from sdc.Pass alarmConditions as\r
-     * true to get alarm conditons from artifact url and else it is false\r
-     * \r
+     * Service to services/resources/artifacts from sdc.Pass alarmConditions as true\r
+     * to get alarm conditons from artifact url and else it is false\r
+     *\r
      * @param url\r
-     *            The URL to trigger\r
+     *        The URL to trigger\r
      * @return The String containing the payload\r
      */\r
     public String getCldsServicesOrResourcesBasedOnURL(String url) {\r
@@ -797,6 +733,7 @@ public class SdcCatalogServices {
             String urlReworked = removeUnwantedBracesFromString(url);\r
             URL urlObj = new URL(urlReworked);\r
             HttpURLConnection conn = (HttpURLConnection) urlObj.openConnection();\r
+            conn = utils.invoke(conn, "SDC", "getSdcResources");\r
             String basicAuth = getSdcBasicAuth();\r
             conn.setRequestProperty(refProp.getStringValue(SDC_INSTANCE_ID_PROPERTY_NAME), SDC_INSTANCE_ID_CLAMP);\r
             conn.setRequestProperty(HttpHeaders.AUTHORIZATION, basicAuth);\r
@@ -807,64 +744,56 @@ public class SdcCatalogServices {
             logger.info("Sdc resource url - " + urlReworked + " , responseCode=" + responseCode);\r
             try (BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()))) {\r
                 String response = IOUtils.toString(in);\r
-                LoggingUtils.setResponseContext("0", "Get sdc resources success", this.getClass().getName());\r
                 return response;\r
             }\r
         } catch (IOException e) {\r
-            LoggingUtils.setResponseContext("900", "Get sdc resources failed", this.getClass().getName());\r
             LoggingUtils.setErrorContext("900", "Get sdc resources error");\r
             logger.error("Exception occurred during query to SDC", e);\r
             return "";\r
         } catch (DecoderException e) {\r
-            LoggingUtils.setResponseContext("900", "Get sdc resources failed", this.getClass().getName());\r
             LoggingUtils.setErrorContext("900", "Get sdc resources error");\r
             logger.error("Exception when attempting to decode the Hex string", e);\r
             throw new SdcCommunicationException("Exception when attempting to decode the Hex string", e);\r
         } catch (GeneralSecurityException e) {\r
-            LoggingUtils.setResponseContext("900", "Get sdc resources failed", this.getClass().getName());\r
             LoggingUtils.setErrorContext("900", "Get sdc resources error");\r
             logger.error("Exception when attempting to decrypt the encrypted password", e);\r
             throw new SdcCommunicationException("Exception when attempting to decrypt the encrypted password", e);\r
         } finally {\r
             LoggingUtils.setTimeContext(startTime, new Date());\r
             metricsLogger.info("getCldsServicesOrResourcesBasedOnURL completed");\r
+            utils.invokeReturn();\r
         }\r
     }\r
 \r
     /**\r
      * To create properties object by using cldsServicedata.\r
      *\r
-     * @param globalProps\r
-     * @param cldsServiceData\r
-     * @return\r
-     * @throws IOException\r
-     *             In case of issues during the parsing of the Global Properties\r
+     * @throws IOException In case of issues during the parsing of the Global Properties\r
      */\r
     public String createPropertiesObjectByUUID(CldsServiceData cldsServiceData) throws IOException {\r
         String totalPropsStr;\r
-        ObjectMapper mapper = JacksonUtils.getObjectMapperInstance();\r
-        ObjectNode globalPropsJson = (ObjectNode) refProp.getJsonTemplate(CldsService.GLOBAL_PROPERTIES_KEY);\r
+        JsonObject globalPropsJson = refProp.getJsonTemplate(CldsService.GLOBAL_PROPERTIES_KEY).getAsJsonObject();\r
         if (cldsServiceData != null && cldsServiceData.getServiceUUID() != null) {\r
             // Objectnode to save all byservice, byvf , byvfc and byalarm nodes\r
-            ObjectNode byIdObjectNode = mapper.createObjectNode();\r
+            JsonObject byIdObjectNode = new JsonObject();\r
             // To create vf ResourceUUID node with serviceInvariantUUID\r
-            ObjectNode invariantUuidObjectNodeWithVf = createVfObjectNodeByServiceInvariantUuid(cldsServiceData);\r
-            byIdObjectNode.putPOJO("byService", invariantUuidObjectNodeWithVf);\r
+            JsonObject invariantUuidObjectNodeWithVf = createVfObjectNodeByServiceInvariantUuid(cldsServiceData);\r
+            byIdObjectNode.add("byService", invariantUuidObjectNodeWithVf);\r
             // To create byVf and vfcResourceNode with vfResourceUUID\r
-            ObjectNode vfcObjectNodeByVfUuid = createVfcObjectNodeByVfUuid(cldsServiceData.getCldsVfs());\r
-            byIdObjectNode.putPOJO("byVf", vfcObjectNodeByVfUuid);\r
+            JsonObject vfcObjectNodeByVfUuid = createVfcObjectNodeByVfUuid(cldsServiceData.getCldsVfs());\r
+            byIdObjectNode.add("byVf", vfcObjectNodeByVfUuid);\r
             // To create byKpi\r
-            ObjectNode kpiObjectNode = mapper.createObjectNode();\r
+            JsonObject kpiJsonObject = new JsonObject();\r
             if (cldsServiceData.getCldsVfs() != null && !cldsServiceData.getCldsVfs().isEmpty()) {\r
                 for (CldsVfData currCldsVfData : cldsServiceData.getCldsVfs()) {\r
                     if (currCldsVfData != null) {\r
-                        createKpiObjectNodeByVfUuid(kpiObjectNode, currCldsVfData.getCldsKPIList());\r
+                        createKpiObjectNodeByVfUuid(kpiJsonObject, currCldsVfData.getCldsKPIList());\r
                     }\r
                 }\r
             }\r
-            byIdObjectNode.putPOJO("byKpi", kpiObjectNode);\r
+            byIdObjectNode.add("byKpi", kpiJsonObject);\r
             // To create byVfc and alarmCondition with vfcResourceUUID\r
-            ObjectNode vfcResourceUuidObjectNode = mapper.createObjectNode();\r
+            JsonObject vfcResourceUuidObjectNode = new JsonObject();\r
             if (cldsServiceData.getCldsVfs() != null && !cldsServiceData.getCldsVfs().isEmpty()) {\r
                 for (CldsVfData currCldsVfData : cldsServiceData.getCldsVfs()) {\r
                     if (currCldsVfData != null) {\r
@@ -872,18 +801,18 @@ public class SdcCatalogServices {
                     }\r
                 }\r
             }\r
-            byIdObjectNode.putPOJO("byVfc", vfcResourceUuidObjectNode);\r
+            byIdObjectNode.add("byVfc", vfcResourceUuidObjectNode);\r
             // To create byAlarmCondition with alarmConditionKey\r
             List<CldsAlarmCondition> allAlarmConditions = getAllAlarmConditionsFromCldsServiceData(cldsServiceData,\r
-                    "alarmCondition");\r
-            ObjectNode alarmCondObjectNodeByAlarmKey = createAlarmCondObjectNodeByAlarmKey(allAlarmConditions);\r
-            byIdObjectNode.putPOJO("byAlarmCondition", alarmCondObjectNodeByAlarmKey);\r
+                "alarmCondition");\r
+            JsonObject alarmCondObjectNodeByAlarmKey = createAlarmCondObjectNodeByAlarmKey(allAlarmConditions);\r
+            byIdObjectNode.add("byAlarmCondition", alarmCondObjectNodeByAlarmKey);\r
             // To create byAlertDescription with AlertDescription\r
             List<CldsAlarmCondition> allAlertDescriptions = getAllAlarmConditionsFromCldsServiceData(cldsServiceData,\r
-                    "alertDescription");\r
-            ObjectNode alertDescObjectNodeByAlert = createAlarmCondObjectNodeByAlarmKey(allAlertDescriptions);\r
-            byIdObjectNode.putPOJO("byAlertDescription", alertDescObjectNodeByAlert);\r
-            globalPropsJson.putPOJO("shared", byIdObjectNode);\r
+                "alertDescription");\r
+            JsonObject alertDescObjectNodeByAlert = createAlarmCondObjectNodeByAlarmKey(allAlertDescriptions);\r
+            byIdObjectNode.add("byAlertDescription", alertDescObjectNodeByAlert);\r
+            globalPropsJson.add("shared", byIdObjectNode);\r
             logger.info("Global properties JSON created with SDC info:" + globalPropsJson);\r
         }\r
         totalPropsStr = globalPropsJson.toString();\r
@@ -892,19 +821,18 @@ public class SdcCatalogServices {
 \r
     /**\r
      * Method to get alarm conditions/alert description from Service Data.\r
-     * \r
+     *\r
      * @param cldsServiceData\r
-     *            CldsServiceData the Service Data to analyze\r
+     *        CldsServiceData the Service Data to analyze\r
      * @param eventName\r
-     *            The String event name that will be used to filter the alarm\r
-     *            list\r
+     *        The String event name that will be used to filter the alarm list\r
      * @return The list of CldsAlarmCondition for the event name specified\r
      */\r
     public List<CldsAlarmCondition> getAllAlarmConditionsFromCldsServiceData(CldsServiceData cldsServiceData,\r
-            String eventName) {\r
+        String eventName) {\r
         List<CldsAlarmCondition> alarmCondList = new ArrayList<>();\r
         if (cldsServiceData != null && cldsServiceData.getCldsVfs() != null\r
-                && !cldsServiceData.getCldsVfs().isEmpty()) {\r
+            && !cldsServiceData.getCldsVfs().isEmpty()) {\r
             for (CldsVfData currCldsVfData : cldsServiceData.getCldsVfs()) {\r
                 alarmCondList.addAll(getAllAlarmConditionsFromCldsVfData(currCldsVfData, eventName));\r
             }\r
@@ -914,12 +842,11 @@ public class SdcCatalogServices {
 \r
     /**\r
      * Method to get alarm conditions/alert description from VF Data.\r
-     * \r
+     *\r
      * @param currCldsVfData\r
-     *            The Vf Data to analyze\r
+     *        The Vf Data to analyze\r
      * @param eventName\r
-     *            The String event name that will be used to filter the alarm\r
-     *            list\r
+     *        The String event name that will be used to filter the alarm list\r
      * @return The list of CldsAlarmCondition for the event name specified\r
      */\r
     private List<CldsAlarmCondition> getAllAlarmConditionsFromCldsVfData(CldsVfData currCldsVfData, String eventName) {\r
@@ -934,22 +861,21 @@ public class SdcCatalogServices {
 \r
     /**\r
      * Method to get alarm conditions/alert description from VFC Data.\r
-     * \r
+     *\r
      * @param currCldsVfcData\r
-     *            The VfC Data to analyze\r
+     *        The VfC Data to analyze\r
      * @param eventName\r
-     *            The String event name that will be used to filter the alarm\r
-     *            list\r
+     *        The String event name that will be used to filter the alarm list\r
      * @return The list of CldsAlarmCondition for the event name specified\r
      */\r
     private List<CldsAlarmCondition> getAllAlarmConditionsFromCldsVfcData(CldsVfcData currCldsVfcData,\r
-            String eventName) {\r
+        String eventName) {\r
         List<CldsAlarmCondition> alarmCondList = new ArrayList<>();\r
         if (currCldsVfcData != null && currCldsVfcData.getCldsAlarmConditions() != null\r
-                && !currCldsVfcData.getCldsAlarmConditions().isEmpty()) {\r
+            && !currCldsVfcData.getCldsAlarmConditions().isEmpty()) {\r
             for (CldsAlarmCondition currCldsAlarmCondition : currCldsVfcData.getCldsAlarmConditions()) {\r
                 if (currCldsAlarmCondition != null\r
-                        && currCldsAlarmCondition.getEventName().equalsIgnoreCase(eventName)) {\r
+                    && currCldsAlarmCondition.getEventName().equalsIgnoreCase(eventName)) {\r
                     alarmCondList.add(currCldsAlarmCondition);\r
                 }\r
             }\r
@@ -957,187 +883,148 @@ public class SdcCatalogServices {
         return alarmCondList;\r
     }\r
 \r
-    private ObjectNode createAlarmCondObjectNodeByAlarmKey(List<CldsAlarmCondition> cldsAlarmCondList) {\r
-        ObjectMapper mapper = JacksonUtils.getObjectMapperInstance();\r
-        ObjectNode alarmCondKeyNode = mapper.createObjectNode();\r
+    private JsonObject createAlarmCondObjectNodeByAlarmKey(List<CldsAlarmCondition> cldsAlarmCondList) {\r
+        JsonObject alarmCondKeyNode = new JsonObject();\r
         if (cldsAlarmCondList != null && !cldsAlarmCondList.isEmpty()) {\r
             for (CldsAlarmCondition currCldsAlarmCondition : cldsAlarmCondList) {\r
                 if (currCldsAlarmCondition != null) {\r
-                    ObjectNode alarmCondNode = mapper.createObjectNode();\r
-                    alarmCondNode.put("eventSourceType", currCldsAlarmCondition.getEventSourceType());\r
-                    alarmCondNode.put("eventSeverity", currCldsAlarmCondition.getSeverity());\r
-                    alarmCondKeyNode.putPOJO(currCldsAlarmCondition.getAlarmConditionKey(), alarmCondNode);\r
+                    JsonObject alarmCondNode = new JsonObject();\r
+                    alarmCondNode.addProperty("eventSourceType", currCldsAlarmCondition.getEventSourceType());\r
+                    alarmCondNode.addProperty("eventSeverity", currCldsAlarmCondition.getSeverity());\r
+                    alarmCondKeyNode.add(currCldsAlarmCondition.getAlarmConditionKey(), alarmCondNode);\r
                 }\r
             }\r
         } else {\r
-            ObjectNode alarmCondNode = mapper.createObjectNode();\r
-            alarmCondNode.put("eventSourceType", "");\r
-            alarmCondNode.put("eventSeverity", "");\r
-            alarmCondKeyNode.putPOJO("", alarmCondNode);\r
+            JsonObject alarmCondNode = new JsonObject();\r
+            alarmCondNode.addProperty("eventSourceType", "");\r
+            alarmCondNode.addProperty("eventSeverity", "");\r
+            alarmCondKeyNode.add("", alarmCondNode);\r
         }\r
         return alarmCondKeyNode;\r
     }\r
 \r
-    private ObjectNode createVfObjectNodeByServiceInvariantUuid(CldsServiceData cldsServiceData) {\r
-        ObjectMapper mapper = JacksonUtils.getObjectMapperInstance();\r
-        ObjectNode invariantUuidObjectNode = mapper.createObjectNode();\r
-        ObjectNode vfObjectNode = mapper.createObjectNode();\r
-        ObjectNode vfUuidNode = mapper.createObjectNode();\r
+    private JsonObject createVfObjectNodeByServiceInvariantUuid(CldsServiceData cldsServiceData) {\r
+        JsonObject invariantUuidObjectNode = new JsonObject();\r
+        JsonObject vfObjectNode = new JsonObject();\r
+        JsonObject vfUuidNode = new JsonObject();\r
         List<CldsVfData> cldsVfsList = cldsServiceData.getCldsVfs();\r
         if (cldsVfsList != null && !cldsVfsList.isEmpty()) {\r
             for (CldsVfData currCldsVfData : cldsVfsList) {\r
                 if (currCldsVfData != null) {\r
-                    vfUuidNode.put(currCldsVfData.getVfInvariantResourceUUID(), currCldsVfData.getVfName());\r
+                    vfUuidNode.addProperty(currCldsVfData.getVfInvariantResourceUUID(), currCldsVfData.getVfName());\r
                 }\r
             }\r
         } else {\r
-            vfUuidNode.put("", "");\r
+            vfUuidNode.addProperty("", "");\r
         }\r
-        vfObjectNode.putPOJO("vf", vfUuidNode);\r
-        invariantUuidObjectNode.putPOJO(cldsServiceData.getServiceInvariantUUID(), vfObjectNode);\r
+        vfObjectNode.add("vf", vfUuidNode);\r
+        invariantUuidObjectNode.add(cldsServiceData.getServiceInvariantUUID(), vfObjectNode);\r
         return invariantUuidObjectNode;\r
     }\r
 \r
-    private void createKpiObjectNodeByVfUuid(ObjectNode vfResourceUuidObjectNode,\r
-            List<CldsVfKPIData> cldsVfKpiDataList) {\r
-        ObjectMapper mapper = JacksonUtils.getObjectMapperInstance();\r
+    private void createKpiObjectNodeByVfUuid(JsonObject vfResourceUuidObjectNode,\r
+        List<CldsVfKPIData> cldsVfKpiDataList) {\r
         if (cldsVfKpiDataList != null && !cldsVfKpiDataList.isEmpty()) {\r
             for (CldsVfKPIData currCldsVfKpiData : cldsVfKpiDataList) {\r
                 if (currCldsVfKpiData != null) {\r
-                    ObjectNode thresholdNameObjectNode = mapper.createObjectNode();\r
-                    ObjectNode fieldPathObjectNode = mapper.createObjectNode();\r
-                    ObjectNode nfNamingCodeNode = mapper.createObjectNode();\r
-                    fieldPathObjectNode.put(currCldsVfKpiData.getFieldPathValue(),\r
-                            currCldsVfKpiData.getFieldPathValue());\r
-                    nfNamingCodeNode.put(currCldsVfKpiData.getNfNamingValue(), currCldsVfKpiData.getNfNamingValue());\r
-                    thresholdNameObjectNode.putPOJO("fieldPath", fieldPathObjectNode);\r
-                    thresholdNameObjectNode.putPOJO("nfNamingCode", nfNamingCodeNode);\r
-                    vfResourceUuidObjectNode.putPOJO(currCldsVfKpiData.getThresholdValue(), thresholdNameObjectNode);\r
+                    JsonObject thresholdNameObjectNode = new JsonObject();\r
+                    JsonObject fieldPathObjectNode = new JsonObject();\r
+                    JsonObject nfNamingCodeNode = new JsonObject();\r
+                    fieldPathObjectNode.addProperty(currCldsVfKpiData.getFieldPathValue(),\r
+                        currCldsVfKpiData.getFieldPathValue());\r
+                    nfNamingCodeNode.addProperty(currCldsVfKpiData.getNfNamingValue(), currCldsVfKpiData.getNfNamingValue());\r
+                    thresholdNameObjectNode.add("fieldPath", fieldPathObjectNode);\r
+                    thresholdNameObjectNode.add("nfNamingCode", nfNamingCodeNode);\r
+                    vfResourceUuidObjectNode.add(currCldsVfKpiData.getThresholdValue(), thresholdNameObjectNode);\r
                 }\r
             }\r
         }\r
     }\r
 \r
-    private void createAlarmCondObjectNodeByVfcUuid(ObjectNode vfcResourceUuidObjectNode,\r
-            List<CldsVfcData> cldsVfcDataList) {\r
-        ObjectMapper mapper = JacksonUtils.getObjectMapperInstance();\r
-        ObjectNode vfcObjectNode = mapper.createObjectNode();\r
-        ObjectNode alarmCondNode = mapper.createObjectNode();\r
-        ObjectNode alertDescNode = mapper.createObjectNode();\r
+    private void createAlarmCondObjectNodeByVfcUuid(JsonObject vfcResourceUuidObjectNode,\r
+        List<CldsVfcData> cldsVfcDataList) {\r
+        JsonObject vfcObjectNode = new JsonObject();\r
+        JsonObject alarmCondNode = new JsonObject();\r
+        JsonObject alertDescNode = new JsonObject();\r
         if (cldsVfcDataList != null && !cldsVfcDataList.isEmpty()) {\r
             for (CldsVfcData currCldsVfcData : cldsVfcDataList) {\r
                 if (currCldsVfcData != null) {\r
                     if (currCldsVfcData.getCldsAlarmConditions() != null\r
-                            && !currCldsVfcData.getCldsAlarmConditions().isEmpty()) {\r
+                        && !currCldsVfcData.getCldsAlarmConditions().isEmpty()) {\r
                         for (CldsAlarmCondition currCldsAlarmCondition : currCldsVfcData.getCldsAlarmConditions()) {\r
                             if ("alarmCondition".equalsIgnoreCase(currCldsAlarmCondition.getEventName())) {\r
-                                alarmCondNode.put(currCldsAlarmCondition.getAlarmConditionKey(),\r
-                                        currCldsAlarmCondition.getAlarmConditionKey());\r
+                                alarmCondNode.addProperty(currCldsAlarmCondition.getAlarmConditionKey(),\r
+                                    currCldsAlarmCondition.getAlarmConditionKey());\r
                             } else {\r
-                                alertDescNode.put(currCldsAlarmCondition.getAlarmConditionKey(),\r
-                                        currCldsAlarmCondition.getAlarmConditionKey());\r
+                                alertDescNode.addProperty(currCldsAlarmCondition.getAlarmConditionKey(),\r
+                                    currCldsAlarmCondition.getAlarmConditionKey());\r
                             }\r
                         }\r
                     }\r
-                    vfcObjectNode.putPOJO("alarmCondition", alarmCondNode);\r
-                    vfcObjectNode.putPOJO("alertDescription", alertDescNode);\r
-                    vfcResourceUuidObjectNode.putPOJO(currCldsVfcData.getVfcInvariantResourceUUID(), vfcObjectNode);\r
+                    vfcObjectNode.add("alarmCondition", alarmCondNode);\r
+                    vfcObjectNode.add("alertDescription", alertDescNode);\r
+                    vfcResourceUuidObjectNode.add(currCldsVfcData.getVfcInvariantResourceUUID(), vfcObjectNode);\r
                 }\r
             }\r
         } else {\r
-            alarmCondNode.put("", "");\r
-            vfcObjectNode.putPOJO("alarmCondition", alarmCondNode);\r
-            alertDescNode.put("", "");\r
-            vfcObjectNode.putPOJO("alertDescription", alarmCondNode);\r
-            vfcResourceUuidObjectNode.putPOJO("", vfcObjectNode);\r
+            alarmCondNode.addProperty("", "");\r
+            vfcObjectNode.add("alarmCondition", alarmCondNode);\r
+            alertDescNode.addProperty("", "");\r
+            vfcObjectNode.add("alertDescription", alarmCondNode);\r
+            vfcResourceUuidObjectNode.add("", vfcObjectNode);\r
         }\r
     }\r
 \r
     /**\r
      * Method to create vfc and kpi nodes inside vf node\r
-     * \r
+     *\r
      * @param mapper\r
      * @param cldsVfDataList\r
      * @return\r
      */\r
-    private ObjectNode createVfcObjectNodeByVfUuid(List<CldsVfData> cldsVfDataList) {\r
-        ObjectMapper mapper = JacksonUtils.getObjectMapperInstance();\r
-        ObjectNode vfUuidObjectNode = mapper.createObjectNode();\r
+    private JsonObject createVfcObjectNodeByVfUuid(List<CldsVfData> cldsVfDataList) {\r
+        JsonObject vfUuidObjectNode = new JsonObject();\r
         if (cldsVfDataList != null && !cldsVfDataList.isEmpty()) {\r
             for (CldsVfData currCldsVfData : cldsVfDataList) {\r
                 if (currCldsVfData != null) {\r
-                    ObjectNode vfObjectNode = mapper.createObjectNode();\r
-                    ObjectNode vfcUuidNode = mapper.createObjectNode();\r
-                    ObjectNode kpiObjectNode = mapper.createObjectNode();\r
+                    JsonObject vfObjectNode = new JsonObject();\r
+                    JsonObject vfcUuidNode = new JsonObject();\r
+                    JsonObject kpiObjectNode = new JsonObject();\r
                     if (currCldsVfData.getCldsVfcs() != null && !currCldsVfData.getCldsVfcs().isEmpty()) {\r
                         for (CldsVfcData currCldsVfcData : currCldsVfData.getCldsVfcs()) {\r
                             if (currCldsVfcData.getCldsAlarmConditions() != null\r
-                                    && !currCldsVfcData.getCldsAlarmConditions().isEmpty()) {\r
-                                vfcUuidNode.put(currCldsVfcData.getVfcInvariantResourceUUID(),\r
-                                        currCldsVfcData.getVfcName());\r
+                                && !currCldsVfcData.getCldsAlarmConditions().isEmpty()) {\r
+                                vfcUuidNode.addProperty(currCldsVfcData.getVfcInvariantResourceUUID(),\r
+                                    currCldsVfcData.getVfcName());\r
                             }\r
                         }\r
                     } else {\r
-                        vfcUuidNode.put("", "");\r
+                        vfcUuidNode.addProperty("", "");\r
                     }\r
                     if (currCldsVfData.getCldsKPIList() != null && !currCldsVfData.getCldsKPIList().isEmpty()) {\r
                         for (CldsVfKPIData currCldsVfKPIData : currCldsVfData.getCldsKPIList()) {\r
-                            kpiObjectNode.put(currCldsVfKPIData.getThresholdValue(),\r
-                                    currCldsVfKPIData.getThresholdValue());\r
+                            // ToDo: something wrong happened here\r
+                            kpiObjectNode.addProperty(currCldsVfKPIData.getThresholdValue(),\r
+                                currCldsVfKPIData.getThresholdValue());\r
                         }\r
                     } else {\r
-                        kpiObjectNode.put("", "");\r
+                        kpiObjectNode.addProperty("", "");\r
                     }\r
-                    vfObjectNode.putPOJO("vfc", vfcUuidNode);\r
-                    vfObjectNode.putPOJO("kpi", kpiObjectNode);\r
-                    vfUuidObjectNode.putPOJO(currCldsVfData.getVfInvariantResourceUUID(), vfObjectNode);\r
+                    vfObjectNode.add("vfc", vfcUuidNode);\r
+                    vfObjectNode.add("kpi", kpiObjectNode);\r
+                    vfUuidObjectNode.add(currCldsVfData.getVfInvariantResourceUUID(), vfObjectNode);\r
                 }\r
             }\r
         } else {\r
-            ObjectNode vfcUuidNode = mapper.createObjectNode();\r
-            vfcUuidNode.put("", "");\r
-            ObjectNode vfcObjectNode = mapper.createObjectNode();\r
-            vfcObjectNode.putPOJO("vfc", vfcUuidNode);\r
-            vfUuidObjectNode.putPOJO("", vfcObjectNode);\r
+            JsonObject vfcUuidNode = new JsonObject();\r
+            vfcUuidNode.addProperty("", "");\r
+            JsonObject vfcObjectNode = new JsonObject();\r
+            vfcObjectNode.add("vfc", vfcUuidNode);\r
+            vfUuidObjectNode.add("", vfcObjectNode);\r
         }\r
         return vfUuidObjectNode;\r
     }\r
 \r
-    /**\r
-     * This method searches the equivalent artifact UUID for a specific\r
-     * artifactName in a SdcServiceDetail.\r
-     * \r
-     * @param cldsSdcServiceDetail\r
-     *            The SdcServiceDetail that will be analyzed\r
-     * @param artifactName\r
-     *            The artifact name that will be searched\r
-     * @return The artifact UUID found\r
-     */\r
-    public String getArtifactIdIfArtifactAlreadyExists(SdcServiceDetail cldsSdcServiceDetail, String artifactName) {\r
-        String artifactUuid = null;\r
-        boolean artifactExists = false;\r
-        if (cldsSdcServiceDetail != null && cldsSdcServiceDetail.getResources() != null\r
-                && !cldsSdcServiceDetail.getResources().isEmpty()) {\r
-            for (SdcResource currCldsSdcResource : cldsSdcServiceDetail.getResources()) {\r
-                if (artifactExists) {\r
-                    break;\r
-                }\r
-                if (currCldsSdcResource != null && currCldsSdcResource.getArtifacts() != null\r
-                        && !currCldsSdcResource.getArtifacts().isEmpty()) {\r
-                    for (SdcArtifact currCldsSdcArtifact : currCldsSdcResource.getArtifacts()) {\r
-                        if (currCldsSdcArtifact != null && currCldsSdcArtifact.getArtifactName() != null\r
-                                && currCldsSdcArtifact.getArtifactName().equalsIgnoreCase(artifactName)) {\r
-                            artifactUuid = currCldsSdcArtifact.getArtifactUUID();\r
-                            artifactExists = true;\r
-                            break;\r
-                        }\r
-                    }\r
-                }\r
-            }\r
-        }\r
-        return artifactUuid;\r
-    }\r
-\r
     // To get all sdc VF/VFC Resources basic info.\r
     private List<SdcResourceBasicInfo> getAllSdcVForVfcResourcesBasedOnResourceType(String resourceType) {\r
         String catalogUrl = refProp.getStringValue(SDC_CATALOG_URL_PROPERTY_NAME);\r
@@ -1147,12 +1034,12 @@ public class SdcCatalogServices {
     }\r
 \r
     private String getResourceUuidFromResourceInvariantUuid(String resourceInvariantUuid,\r
-            List<SdcResourceBasicInfo> resourceInfoList) {\r
+        List<SdcResourceBasicInfo> resourceInfoList) {\r
         String resourceUuid = null;\r
         if (resourceInfoList != null && !resourceInfoList.isEmpty()) {\r
             for (SdcResourceBasicInfo currResource : resourceInfoList) {\r
                 if (currResource != null && currResource.getInvariantUUID() != null && currResource.getUuid() != null\r
-                        && currResource.getInvariantUUID().equalsIgnoreCase(resourceInvariantUuid)) {\r
+                    && currResource.getInvariantUUID().equalsIgnoreCase(resourceInvariantUuid)) {\r
                     resourceUuid = currResource.getUuid();\r
                     break;\r
                 }\r
@@ -1160,146 +1047,4 @@ public class SdcCatalogServices {
         }\r
         return resourceUuid;\r
     }\r
-\r
-    // Method to get service invariant uuid from model properties.\r
-    private String getServiceInvariantUuidFromProps(ModelProperties props) {\r
-        String invariantUuid = "";\r
-        Global globalProps = props.getGlobal();\r
-        if (globalProps != null && globalProps.getService() != null) {\r
-            invariantUuid = globalProps.getService();\r
-        }\r
-        return invariantUuid;\r
-    }\r
-\r
-    /**\r
-     * This method upload the BluePrint to SDC.\r
-     * \r
-     * @param prop\r
-     *            The Clds model Properties\r
-     * @param userid\r
-     *            The user id for SDC\r
-     * @param sdcReqUrlsList\r
-     *            The list of SDC URL to try\r
-     * @param formattedSdcReq\r
-     *            The blueprint to upload\r
-     * @param formattedSdcLocationReq\r
-     *            THe location Blueprint to upload\r
-     * @param artifactName\r
-     *            The artifact name from where we can get the Artifact UUID\r
-     * @param locationArtifactName\r
-     *            The location artifact name from where we can get the Artifact\r
-     *            UUID\r
-     * @throws GeneralSecurityException\r
-     *             In case of issues with the decryting the encrypted password\r
-     * @throws DecoderException\r
-     *             In case of issues with the decoding of the Hex String\r
-     */\r
-    public void uploadToSdc(ModelProperties prop, String userid, List<String> sdcReqUrlsList, String formattedSdcReq,\r
-            String formattedSdcLocationReq, String artifactName, String locationArtifactName)\r
-            throws GeneralSecurityException, DecoderException {\r
-        logger.info("userid=" + userid);\r
-        String serviceInvariantUuid = getServiceInvariantUuidFromProps(prop);\r
-        if (sdcReqUrlsList != null && !sdcReqUrlsList.isEmpty()) {\r
-            for (String url : sdcReqUrlsList) {\r
-                if (url != null) {\r
-                    String originalServiceUuid = getServiceUuidFromServiceInvariantId(serviceInvariantUuid);\r
-                    logger.info("ServiceUUID used before upload in url:" + originalServiceUuid);\r
-                    String sdcServicesInformation = getSdcServicesInformation(originalServiceUuid);\r
-                    SdcServiceDetail cldsSdcServiceDetail = decodeCldsSdcServiceDetailFromJson(sdcServicesInformation);\r
-                    String uploadedArtifactUuid = getArtifactIdIfArtifactAlreadyExists(cldsSdcServiceDetail,\r
-                            artifactName);\r
-                    // Upload artifacts to sdc\r
-                    String updateUrl = uploadedArtifactUuid != null ? url + "/" + uploadedArtifactUuid : url;\r
-                    String responseStr = uploadArtifactToSdc(prop, userid, updateUrl, formattedSdcReq);\r
-                    logger.info("value of sdc Response of uploading to sdc :" + responseStr);\r
-                    String updatedServiceUuid = getServiceUuidFromServiceInvariantId(serviceInvariantUuid);\r
-                    if (!originalServiceUuid.equalsIgnoreCase(updatedServiceUuid)) {\r
-                        url = url.replace(originalServiceUuid, updatedServiceUuid);\r
-                    }\r
-                    logger.info("ServiceUUID used after upload in ulr:" + updatedServiceUuid);\r
-                    sdcServicesInformation = getSdcServicesInformation(updatedServiceUuid);\r
-                    cldsSdcServiceDetail = decodeCldsSdcServiceDetailFromJson(sdcServicesInformation);\r
-                    uploadedArtifactUuid = getArtifactIdIfArtifactAlreadyExists(cldsSdcServiceDetail,\r
-                            locationArtifactName);\r
-                    // To send location information also to sdc\r
-                    updateUrl = uploadedArtifactUuid != null ? url + "/" + uploadedArtifactUuid : url;\r
-                    responseStr = uploadArtifactToSdc(prop, userid, updateUrl, formattedSdcLocationReq);\r
-                    logger.info("value of sdc Response of uploading location to sdc :" + responseStr);\r
-                }\r
-            }\r
-        }\r
-    }\r
-\r
-    /**\r
-     * Method to delete blueprint and location json artifacts from sdc\r
-     * \r
-     * @param prop\r
-     * @param userid\r
-     * @param sdcReqUrlsList\r
-     * @param artifactName\r
-     * @param locationArtifactName\r
-     * @throws GeneralSecurityException\r
-     * @throws DecoderException\r
-     */\r
-    public void deleteArtifactsFromSdc(ModelProperties prop, String userid, List<String> sdcReqUrlsList,\r
-            String artifactName, String locationArtifactName) throws GeneralSecurityException, DecoderException {\r
-        String serviceInvariantUuid = getServiceInvariantUuidFromProps(prop);\r
-        for (String url : sdcReqUrlsList) {\r
-            String originalServiceUuid = getServiceUuidFromServiceInvariantId(serviceInvariantUuid);\r
-            logger.info("ServiceUUID used before deleting in url:" + originalServiceUuid);\r
-            String sdcServicesInformation = getSdcServicesInformation(originalServiceUuid);\r
-            SdcServiceDetail cldsSdcServiceDetail = decodeCldsSdcServiceDetailFromJson(sdcServicesInformation);\r
-            String uploadedArtifactUuid = getArtifactIdIfArtifactAlreadyExists(cldsSdcServiceDetail, artifactName);\r
-            String responseStr = deleteArtifact(userid, url, uploadedArtifactUuid);\r
-            logger.info("value of sdc Response of deleting blueprint from sdc :" + responseStr);\r
-            String updatedServiceUuid = getServiceUuidFromServiceInvariantId(serviceInvariantUuid);\r
-            if (!originalServiceUuid.equalsIgnoreCase(updatedServiceUuid)) {\r
-                url = url.replace(originalServiceUuid, updatedServiceUuid);\r
-            }\r
-            logger.info("ServiceUUID used after delete in ulr:" + updatedServiceUuid);\r
-            sdcServicesInformation = getSdcServicesInformation(updatedServiceUuid);\r
-            cldsSdcServiceDetail = decodeCldsSdcServiceDetailFromJson(sdcServicesInformation);\r
-            uploadedArtifactUuid = getArtifactIdIfArtifactAlreadyExists(cldsSdcServiceDetail, locationArtifactName);\r
-            responseStr = deleteArtifact(userid, url, uploadedArtifactUuid);\r
-            logger.info("value of sdc Response of deleting location json from sdc :" + responseStr);\r
-        }\r
-    }\r
-\r
-    private String deleteArtifact(String userid, String url, String uploadedArtifactUuid) {\r
-        try {\r
-            String responseStr = "";\r
-            if (uploadedArtifactUuid != null && !uploadedArtifactUuid.isEmpty()) {\r
-                logger.info("userid=" + userid);\r
-                String basicAuth = getSdcBasicAuth();\r
-                String sdcXonapInstanceId = refProp.getStringValue("sdc.sdcX-InstanceID");\r
-                url = url + "/" + uploadedArtifactUuid;\r
-                URL urlObj = new URL(url);\r
-                HttpURLConnection conn = (HttpURLConnection) urlObj.openConnection();\r
-                conn.setDoOutput(true);\r
-                conn.setRequestProperty(refProp.getStringValue(SDC_INSTANCE_ID_PROPERTY_NAME), sdcXonapInstanceId);\r
-                conn.setRequestProperty(HttpHeaders.AUTHORIZATION, basicAuth);\r
-                conn.setRequestProperty("USER_ID", userid);\r
-                conn.setRequestMethod("DELETE");\r
-                conn.setRequestProperty("charset", "utf-8");\r
-                conn.setUseCaches(false);\r
-                conn.setRequestProperty(refProp.getStringValue(SDC_REQUESTID_PROPERTY_NAME),\r
-                        LoggingUtils.getRequestId());\r
-                boolean requestFailed = true;\r
-                int responseCode = conn.getResponseCode();\r
-                logger.info("responseCode=" + responseCode);\r
-                if (responseCode == 200) {\r
-                    requestFailed = false;\r
-                }\r
-                responseStr = getResponse(conn);\r
-                if (responseStr != null && requestFailed) {\r
-                    logger.error("requestFailed - responseStr=" + responseStr);\r
-                    throw new BadRequestException(responseStr);\r
-                }\r
-            }\r
-            return responseStr;\r
-        } catch (IOException | DecoderException | GeneralSecurityException e) {\r
-            logger.error("Exception when attempting to communicate with SDC", e);\r
-            throw new SdcCommunicationException("Exception when attempting to communicate with SDC", e);\r
-        }\r
-    }\r
 }\r