diff options
author | david.mcweeney <david.mcweeney@est.tech> | 2024-05-08 15:11:12 +0100 |
---|---|---|
committer | david.mcweeney <david.mcweeney@est.tech> | 2024-05-20 16:33:59 +0100 |
commit | bc0db430759636133d4b01734b1faf5c4688bc0b (patch) | |
tree | 9f1535436277f975fbabf50a08677ea2650f99d1 /dmi-plugin-demo-and-csit-stub | |
parent | d17b32a61d54a07c8ee8b31235e48d127553df96 (diff) |
CPS-2182 - #4 Add module Set tag to NCMPs DMI Batch Data interface
Change-Id: I46b261e0a0ef2d37a307291931ba67762fb7767d
Signed-off-by: david.mcweeney <david.mcweeney@est.tech>
Issue-ID: CPS-2182
Diffstat (limited to 'dmi-plugin-demo-and-csit-stub')
-rw-r--r-- | dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java | 10 | ||||
-rw-r--r-- | dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/model/data/operational/DataOperationRequest.java | 2 | ||||
-rw-r--r-- | dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/model/data/operational/DmiOperationCmHandle.java (renamed from dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/model/data/operational/CmHandle.java) | 3 |
3 files changed, 9 insertions, 6 deletions
diff --git a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java index 08bcee732f..a596afdce2 100644 --- a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java +++ b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java @@ -37,9 +37,9 @@ import lombok.extern.slf4j.Slf4j; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; import org.onap.cps.ncmp.api.impl.utils.EventDateTimeFormatter; -import org.onap.cps.ncmp.dmi.rest.stub.model.data.operational.CmHandle; import org.onap.cps.ncmp.dmi.rest.stub.model.data.operational.DataOperationRequest; import org.onap.cps.ncmp.dmi.rest.stub.model.data.operational.DmiDataOperationRequest; +import org.onap.cps.ncmp.dmi.rest.stub.model.data.operational.DmiOperationCmHandle; import org.onap.cps.ncmp.dmi.rest.stub.utils.ResourceFileReaderUtil; import org.onap.cps.ncmp.events.async1_0_0.Data; import org.onap.cps.ncmp.events.async1_0_0.DataOperationEvent; @@ -238,8 +238,9 @@ public class DmiRestStubController { } dmiDataOperationRequest.getOperations().forEach(dmiDataOperation -> { final DataOperationEvent dataOperationEvent = getDataOperationEvent(dmiDataOperation); - dmiDataOperation.getCmHandles().forEach(cmHandle -> { - dataOperationEvent.getData().getResponses().get(0).setIds(List.of(cmHandle.getId())); + dmiDataOperation.getCmHandles().forEach(dmiOperationCmHandle -> { + log.info("Module Set Tag received: {}", dmiOperationCmHandle.getModuleSetTag()); + dataOperationEvent.getData().getResponses().get(0).setIds(List.of(dmiOperationCmHandle.getId())); final CloudEvent cloudEvent = buildAndGetCloudEvent(topic, requestId, dataOperationEvent); cloudEventKafkaTemplate.send(ncmpAsyncM2mTopic, UUID.randomUUID().toString(), cloudEvent); }); @@ -270,10 +271,11 @@ public class DmiRestStubController { private DataOperationEvent getDataOperationEvent(final DataOperationRequest dataOperationRequest) { final Response response = new Response(); + response.setOperationId(dataOperationRequest.getOperationId()); response.setStatusCode(SUCCESS.getCode()); response.setStatusMessage(SUCCESS.getMessage()); - response.setIds(dataOperationRequest.getCmHandles().stream().map(CmHandle::getId).toList()); + response.setIds(dataOperationRequest.getCmHandles().stream().map(DmiOperationCmHandle::getId).toList()); response.setResourceIdentifier(dataOperationRequest.getResourceIdentifier()); response.setOptions(dataOperationRequest.getOptions()); final String ietfNetworkTopologySample = ResourceFileReaderUtil diff --git a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/model/data/operational/DataOperationRequest.java b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/model/data/operational/DataOperationRequest.java index 85c649e233..410774932b 100644 --- a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/model/data/operational/DataOperationRequest.java +++ b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/model/data/operational/DataOperationRequest.java @@ -35,5 +35,5 @@ public class DataOperationRequest { private String datastore; private String options; private String resourceIdentifier; - private List<CmHandle> cmHandles = new ArrayList<>(); + private List<DmiOperationCmHandle> cmHandles = new ArrayList<>(); } diff --git a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/model/data/operational/CmHandle.java b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/model/data/operational/DmiOperationCmHandle.java index 93a90c917d..5cb24bc398 100644 --- a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/model/data/operational/CmHandle.java +++ b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/model/data/operational/DmiOperationCmHandle.java @@ -27,7 +27,8 @@ import lombok.Setter; @Setter @Getter -public class CmHandle { +public class DmiOperationCmHandle { private String id; private Map<String, String> cmHandleProperties = new HashMap<>(); + private String moduleSetTag; } |