X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=information-coordinator-service%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fics%2Fcontrollers%2Fr1producer%2FProducerController.java;h=03722489ec2cc6999675377e5a215af28fe3f94e;hb=66d3c321ff4f020814fe99e548740d0b7c7d5a85;hp=5229176b7a4249253adf31fcbc482d9fa23adebd;hpb=534a1fe8136ed8d72615707008bdd6061d1df2fe;p=nonrtric.git diff --git a/information-coordinator-service/src/main/java/org/oransc/ics/controllers/r1producer/ProducerController.java b/information-coordinator-service/src/main/java/org/oransc/ics/controllers/r1producer/ProducerController.java index 5229176b..03722489 100644 --- a/information-coordinator-service/src/main/java/org/oransc/ics/controllers/r1producer/ProducerController.java +++ b/information-coordinator-service/src/main/java/org/oransc/ics/controllers/r1producer/ProducerController.java @@ -62,7 +62,7 @@ import org.springframework.web.bind.annotation.RestController; @SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally @RestController("Producer registry") -@Tag(name = ProducerConsts.PRODUCER_API_NAME) +@Tag(name = ProducerConsts.PRODUCER_API_NAME, description = ProducerConsts.PRODUCER_API_DESCRIPTION) public class ProducerController { private static Gson gson = new GsonBuilder().create(); @@ -113,7 +113,7 @@ public class ProducerController { description = "Information type is not found", // content = @Content(schema = @Schema(implementation = ErrorResponse.ErrorInfo.class)))}) public ResponseEntity getInfoType( // - @PathVariable("infoTypeId") String infoTypeId) { + @PathVariable(ProducerConsts.INFO_TYPE_ID_PATH) String infoTypeId) { try { InfoType t = this.infoTypes.getType(infoTypeId); ProducerInfoTypeInfo info = toInfoTypeInfo(t); @@ -142,7 +142,7 @@ public class ProducerController { content = @Content(schema = @Schema(implementation = ErrorResponse.ErrorInfo.class)))}) @Operation(summary = "Individual Information Type", description = "") public ResponseEntity putInfoType( // - @PathVariable("infoTypeId") String infoTypeId, // + @PathVariable(ProducerConsts.INFO_TYPE_ID_PATH) String infoTypeId, // @RequestBody ProducerInfoTypeInfo registrationInfo) { InfoType previousDefinition = this.infoTypes.get(infoTypeId); @@ -180,7 +180,7 @@ public class ProducerController { content = @Content(schema = @Schema(implementation = ErrorResponse.ErrorInfo.class))) // }) public ResponseEntity deleteInfoType( // - @PathVariable("infoTypeId") String infoTypeId) { + @PathVariable(ProducerConsts.INFO_TYPE_ID_PATH) String infoTypeId) { InfoType type = this.infoTypes.get(infoTypeId); if (type == null) { @@ -207,10 +207,10 @@ public class ProducerController { }) public ResponseEntity getInfoProducerIdentifiers( // @Parameter( - name = "info_type_id", + name = ProducerConsts.INFO_TYPE_ID_PARAM, required = false, description = "If given, only the producers for the EI Data type is returned.") // - @RequestParam(name = "info_type_id", required = false) String typeId // + @RequestParam(name = ProducerConsts.INFO_TYPE_ID_PARAM, required = false) String typeId // ) { List result = new ArrayList<>(); for (InfoProducer infoProducer : typeId == null ? this.infoProducers.getAllProducers() @@ -237,7 +237,7 @@ public class ProducerController { content = @Content(schema = @Schema(implementation = ErrorResponse.ErrorInfo.class)))// }) public ResponseEntity getInfoProducer( // - @PathVariable("infoProducerId") String infoProducerId) { + @PathVariable(ProducerConsts.INFO_PRODUCER_ID_PATH) String infoProducerId) { try { InfoProducer producer = this.infoProducers.getProducer(infoProducerId); ProducerRegistrationInfo info = toProducerRegistrationInfo(producer); @@ -265,7 +265,7 @@ public class ProducerController { content = @Content(array = @ArraySchema(schema = @Schema(implementation = ProducerJobInfo.class)))), // }) public ResponseEntity getInfoProducerJobs( // - @PathVariable("infoProducerId") String infoProducerId) { + @PathVariable(ProducerConsts.INFO_PRODUCER_ID_PATH) String infoProducerId) { try { InfoProducer producer = this.infoProducers.getProducer(infoProducerId); Collection producerJobs = new ArrayList<>(); @@ -298,7 +298,7 @@ public class ProducerController { content = @Content(schema = @Schema(implementation = ErrorResponse.ErrorInfo.class))) // }) public ResponseEntity getInfoProducerStatus( // - @PathVariable("infoProducerId") String infoProducerId) { + @PathVariable(ProducerConsts.INFO_PRODUCER_ID_PATH) String infoProducerId) { try { InfoProducer producer = this.infoProducers.getProducer(infoProducerId); return new ResponseEntity<>(gson.toJson(producerStatusInfo(producer)), HttpStatus.OK); @@ -384,7 +384,8 @@ public class ProducerController { description = "Producer is not found", // content = @Content(schema = @Schema(implementation = ErrorResponse.ErrorInfo.class))) // }) - public ResponseEntity deleteInfoProducer(@PathVariable("infoProducerId") String infoProducerId) { + public ResponseEntity deleteInfoProducer( + @PathVariable(ProducerConsts.INFO_PRODUCER_ID_PATH) String infoProducerId) { try { final InfoProducer producer = this.infoProducers.getProducer(infoProducerId); this.infoProducers.deregisterProducer(producer);