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.LoggingUtils;\r
import org.springframework.beans.factory.annotation.Autowired;\r
* @param globalProps\r
* @param cldsServiceData\r
* @return\r
+ * @throws IOException\r
+ * In case of issues during the parsing of the Global Properties\r
*/\r
- public String createPropertiesObjectByUUID(String globalProps, CldsServiceData cldsServiceData) {\r
+ public String createPropertiesObjectByUUID(CldsServiceData cldsServiceData) throws IOException {\r
String totalPropsStr;\r
ObjectMapper mapper = new ObjectMapper();\r
- ObjectNode globalPropsJson;\r
+ ObjectNode globalPropsJson = (ObjectNode) refProp.getJsonTemplate(CldsService.GLOBAL_PROPERTIES_KEY);\r
if (cldsServiceData != null && cldsServiceData.getServiceUUID() != null) {\r
// Objectnode to save all byservice, byvf , byvfc and byalarm nodes\r
ObjectNode byIdObjectNode = mapper.createObjectNode();\r
"alertDescription");\r
ObjectNode alertDescObjectNodeByAlert = createAlarmCondObjectNodeByAlarmKey(mapper, allAlertDescriptions);\r
byIdObjectNode.putPOJO("byAlertDescription", alertDescObjectNodeByAlert);\r
- globalPropsJson = decodeGlobalProp(globalProps, mapper);\r
globalPropsJson.putPOJO("shared", byIdObjectNode);\r
logger.info("Global properties JSON created with SDC info:" + globalPropsJson);\r
- } else {\r
- /**\r
- * to create json with total properties when no serviceUUID passed\r
- */\r
- globalPropsJson = decodeGlobalProp(globalProps, mapper);\r
}\r
totalPropsStr = globalPropsJson.toString();\r
return totalPropsStr;\r
}\r
\r
- private ObjectNode decodeGlobalProp(String globalProps, ObjectMapper mapper) {\r
- try {\r
- return (ObjectNode) mapper.readValue(globalProps, JsonNode.class);\r
- } catch (IOException e) {\r
- logger.error("Exception occurred during decoding of the global props, returning an empty objectNode", e);\r
- return mapper.createObjectNode();\r
- }\r
- }\r
-\r
/**\r
* Method to get alarm conditions/alert description from Service Data.\r
* \r