aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
diff options
context:
space:
mode:
authorDylanB95EST <dylan.byrne@est.tech>2022-02-21 12:57:08 +0000
committerBruno Sakoto <bruno.sakoto@bell.ca>2022-02-28 21:52:25 +0000
commitd042fcdae75be100f840b6313e078eab278d87ef (patch)
treeee5bba86b3ba00205334a1fe6ca41c0824097afd /cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
parente0643ab5130dde375c229989e216341e623a9c55 (diff)
NCMP Java API depends on NCM-Rest-API (cyclic) through json properties on Java API
Using POJO and new converter class instead of previous object mapper Issue-ID: CPS-893 Change-Id: I75531f386f08cb172d2901a4bbe97ae22cc5937e Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
Diffstat (limited to 'cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java')
-rwxr-xr-xcps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java16
1 files changed, 5 insertions, 11 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
index 9e888fb1c..36991952c 100755
--- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
+++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java
@@ -21,12 +21,9 @@
package org.onap.cps.ncmp.rest.controller;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
import javax.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.onap.cps.ncmp.api.NetworkCmProxyDataService;
-import org.onap.cps.ncmp.api.models.DmiPluginRegistration;
import org.onap.cps.ncmp.rest.api.NetworkCmProxyInventoryApi;
import org.onap.cps.ncmp.rest.model.RestDmiPluginRegistration;
import org.springframework.http.HttpStatus;
@@ -40,7 +37,7 @@ import org.springframework.web.bind.annotation.RestController;
public class NetworkCmProxyInventoryController implements NetworkCmProxyInventoryApi {
private final NetworkCmProxyDataService networkCmProxyDataService;
- private final ObjectMapper objectMapper;
+ private final RestInputMapper restInputMapper;
/**
* Update DMI Plugin Registration (used for first registration also).
@@ -49,14 +46,11 @@ public class NetworkCmProxyInventoryController implements NetworkCmProxyInventor
@Override
public ResponseEntity<Void> updateDmiPluginRegistration(
final @Valid RestDmiPluginRegistration restDmiPluginRegistration) {
- final DmiPluginRegistration dmiPluginRegistration =
- convertRestObjectToJavaApiObject(restDmiPluginRegistration);
- networkCmProxyDataService.updateDmiRegistrationAndSyncModule(dmiPluginRegistration);
+ networkCmProxyDataService.updateDmiRegistrationAndSyncModule(
+ restInputMapper.toDmiPluginRegistration(restDmiPluginRegistration));
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
- private DmiPluginRegistration convertRestObjectToJavaApiObject(
- final RestDmiPluginRegistration restDmiPluginRegistration) {
- return objectMapper.convertValue(restDmiPluginRegistration, DmiPluginRegistration.class);
- }
}
+
+