summaryrefslogtreecommitdiffstats
path: root/dmi-stub/dmi-plugin-demo-and-csit-stub-service
diff options
context:
space:
mode:
authorleventecsanyi <levente.csanyi@est.tech>2024-07-26 13:25:12 +0200
committerleventecsanyi <levente.csanyi@est.tech>2024-07-26 16:41:38 +0200
commitee4242c9d89dc1a814f12d0f90880e3f21745f43 (patch)
treeba07625919bbf93de269a7d46d97888a6b780c6e /dmi-stub/dmi-plugin-demo-and-csit-stub-service
parent7f49c706b6fba519d34099b08450b884d53c798b (diff)
Get data job result
- extended openapi - added not-implemented http error for result endpoint - added testware - added stub implementation - fixed writeDataJob bug in stub Issue-ID: CPS-2296 Signed-off-by: leventecsanyi <levente.csanyi@est.tech> Change-Id: I9398cb73b635bec360df886372690187ff54e0d4
Diffstat (limited to 'dmi-stub/dmi-plugin-demo-and-csit-stub-service')
-rw-r--r--dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java b/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java
index b8b46f06..5021ae76 100644
--- a/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java
+++ b/dmi-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java
@@ -89,7 +89,7 @@ public class DmiRestStubController {
private long readDataForCmHandleDelayMs;
@Value("${delay.write-data-for-cm-handle-delay-ms}")
private long writeDataForCmHandleDelayMs;
- private AtomicInteger subJobWriteRequestCounter;
+ private final AtomicInteger subJobWriteRequestCounter = new AtomicInteger();
/**
* This code defines a REST API endpoint for adding new the module set tag mapping. The endpoint receives the
@@ -293,6 +293,27 @@ public class DmiRestStubController {
return ResponseEntity.ok("FINISHED");
}
+ /**
+ * Retrieves the result of a given data job identified by {@code requestId} and {@code dataProducerJobId}.
+ *
+ * @param requestId Identifier for the overall Datajob (required)
+ * @param dataProducerJobId Identifier for the data producer job (required)
+ * @param dataProducerId Identifier for the data producer as a query parameter (required)
+ * @param destination The destination of the results, Kafka topic name or s3 bucket name (required)
+ * @return A ResponseEntity with HTTP status 200 (OK) and the data job's result as an Object.
+ */
+ @GetMapping("/v1/dataJob/{requestId}/dataProducerJob/{dataProducerJobId}/result")
+ public ResponseEntity<Object> retrieveDataJobResult(
+ @PathVariable("requestId") final String requestId,
+ @PathVariable("dataProducerJobId") final String dataProducerJobId,
+ @RequestParam(name = "dataProducerId") String dataProducerId,
+ @RequestParam(name = "destination") String destination) {
+ log.debug("Received request to retrieve data job result. Request ID: {}, Data Producer Job ID: {}, " +
+ "Data Producer ID: {}, Destination: {}",
+ requestId, dataProducerJobId, dataProducerId, destination);
+ return ResponseEntity.ok(Map.of("result", "some status"));
+ }
+
private CloudEvent buildAndGetCloudEvent(final String topic, final String requestId,
final DataOperationEvent dataOperationEvent) {
CloudEvent cloudEvent = null;