diff options
Diffstat (limited to 'cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistence.java')
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistence.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistence.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistence.java index 7a7ef6666..9174dc7a7 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistence.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/InventoryPersistence.java @@ -103,16 +103,15 @@ public class InventoryPersistence { /** * Save all cm handles states in batch. * - * @param cmHandleStates contains cm handle id and updated state + * @param cmHandleStatePerCmHandleId contains cm handle id and updated state */ - public void saveCmHandleStates(final Map<String, CompositeState> cmHandleStates) { + public void saveCmHandleStateBatch(final Map<String, CompositeState> cmHandleStatePerCmHandleId) { final Map<String, String> cmHandlesJsonDataMap = new HashMap<>(); - cmHandleStates.entrySet().stream().forEach(cmHandleEntry -> - cmHandlesJsonDataMap.put(String.format(CM_HANDLE_XPATH_TEMPLATE, cmHandleEntry.getKey()), - String.format("{\"state\":%s}", - jsonObjectMapper.asJsonString(cmHandleEntry.getValue())))); + cmHandleStatePerCmHandleId.forEach((cmHandleId, compositeState) -> cmHandlesJsonDataMap.put( + String.format(CM_HANDLE_XPATH_TEMPLATE, cmHandleId), + String.format("{\"state\":%s}", jsonObjectMapper.asJsonString(compositeState)))); cpsDataService.updateDataNodesAndDescendants(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR, - cmHandlesJsonDataMap, OffsetDateTime.now()); + cmHandlesJsonDataMap, OffsetDateTime.now()); } /** |