+ @Value("${delay.module-references-delay-ms}")
+ private long moduleReferencesDelayMs;
+ @Value("${delay.module-resources-delay-ms}")
+ private long moduleResourcesDelayMs;
+ @Value("${delay.data-for-cm-handle-delay-ms}")
+ private long dataForCmHandleDelayMs;
+
+ /**
+ * This code defines a REST API endpoint for adding new the module set tag mapping. The endpoint receives the
+ * cmHandleId and moduleSetTag as request body and add into moduleSetTagPerCmHandleId map with the provided
+ * values.
+ *
+ * @param requestBody map of cmHandleId and moduleSetTag
+ * @return a ResponseEntity object containing the updated moduleSetTagPerCmHandleId map as the response body
+ */
+ @PostMapping("/v1/tagMapping")
+ public ResponseEntity<Map<String, String>> addTagForMapping(@RequestBody final Map<String, String> requestBody) {
+ moduleSetTagPerCmHandleId.putAll(requestBody);
+ return new ResponseEntity<>(requestBody, HttpStatus.CREATED);
+ }
+
+ /**
+ * This code defines a GET endpoint of module set tag mapping.
+ *
+ * @return The map represents the module set tag mapping.
+ */
+ @GetMapping("/v1/tagMapping")
+ public ResponseEntity<Map<String, String>> getTagMapping() {
+ return ResponseEntity.ok(moduleSetTagPerCmHandleId);
+ }
+
+ /**
+ * This code defines a GET endpoint of module set tag by cm handle ID.
+ *
+ * @return The map represents the module set tag mapping filtered by cm handle ID.
+ */
+ @GetMapping("/v1/tagMapping/ch/{cmHandleId}")
+ public ResponseEntity<String> getTagMappingByCmHandleId(@PathVariable final String cmHandleId) {
+ return ResponseEntity.ok(moduleSetTagPerCmHandleId.get(cmHandleId));
+ }
+
+ /**
+ * This code defines a REST API endpoint for updating the module set tag mapping. The endpoint receives the
+ * cmHandleId and moduleSetTag as request body and updates the moduleSetTagPerCmHandleId map with the provided
+ * values.
+ *
+ * @param requestBody map of cmHandleId and moduleSetTag
+ * @return a ResponseEntity object containing the updated moduleSetTagPerCmHandleId map as the response body
+ */
+
+ @PutMapping("/v1/tagMapping")
+ public ResponseEntity<Map<String, String>> updateTagMapping(@RequestBody final Map<String, String> requestBody) {
+ moduleSetTagPerCmHandleId.putAll(requestBody);
+ return ResponseEntity.noContent().build();
+ }