summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main
diff options
context:
space:
mode:
authorlukegleeson <luke.gleeson@est.tech>2021-08-16 12:30:26 +0100
committerlukegleeson <luke.gleeson@est.tech>2021-08-17 11:54:08 +0100
commit4571ab67d1b3d24d5f046a38055bcf34910cc785 (patch)
treee6b0da17516efb266cafa6df48836ef7698133c8 /cps-ncmp-service/src/main
parentdca30738006c456afd807512a2f80c207b53d3c6 (diff)
Fix Sonar Qube Violations
Issue-ID: CPS-475 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I9673fe8ff5373a1ea50df148ac2a3d8af235e508
Diffstat (limited to 'cps-ncmp-service/src/main')
-rwxr-xr-xcps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java12
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmHandle.java4
2 files changed, 8 insertions, 8 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java
index f97ea029db..d6d1ec75ce 100755
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java
@@ -51,8 +51,6 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService
private static final String NCMP_ANCHOR_NAME = "ncmp-dmi-registry";
- private static final String NCMP_DATA_TOP_PATH = "/dmi-registry";
-
private CpsDataService cpsDataService;
private ObjectMapper objectMapper;
@@ -118,16 +116,16 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService
final List<PersistenceCmHandle> persistenceCmHandles =
new ArrayList<>();
for (final CmHandle cmHandle: dmiPluginRegistration.getCreatedCmHandles()) {
- final PersistenceCmHandle persistenceCmHandle = new PersistenceCmHandle();
+ final var persistenceCmHandle = new PersistenceCmHandle();
persistenceCmHandle.setDmiServiceName(dmiPluginRegistration.getDmiPlugin());
- persistenceCmHandle.setId(cmHandle.getCmHandle());
+ persistenceCmHandle.setId(cmHandle.getCmHandleID());
persistenceCmHandle.setAdditionalProperties(cmHandle.getCmHandleProperties());
persistenceCmHandles.add(persistenceCmHandle);
}
- final PersistenceCmHandlesList persistenceCmHandlesList = new PersistenceCmHandlesList();
+ final var persistenceCmHandlesList = new PersistenceCmHandlesList();
persistenceCmHandlesList.setCmHandles(persistenceCmHandles);
- final String cmHandleJsonData = objectMapper.writeValueAsString(persistenceCmHandlesList);
- cpsDataService.saveListNodeData(NCMP_DATASPACE_NAME, NCMP_ANCHOR_NAME, NCMP_DATA_TOP_PATH,
+ final var cmHandleJsonData = objectMapper.writeValueAsString(persistenceCmHandlesList);
+ cpsDataService.saveListNodeData(NCMP_DATASPACE_NAME, NCMP_ANCHOR_NAME, "/dmi-registry",
cmHandleJsonData);
} catch (final JsonProcessingException e) {
throw new DataValidationException(
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmHandle.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmHandle.java
index 0d1c7693a6..84227ed6b3 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmHandle.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/CmHandle.java
@@ -20,6 +20,7 @@
package org.onap.cps.ncmp.api.models;
+import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;
import lombok.Getter;
import lombok.Setter;
@@ -33,7 +34,8 @@ import org.springframework.validation.annotation.Validated;
@Setter
public class CmHandle {
- private String cmHandle;
+ @JsonProperty("cmHandle")
+ private String cmHandleID;
private Map<String, String> cmHandleProperties;