X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=enrichment-coordinator-service%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fenrichment%2Fcontrollers%2Fr1producer%2FProducerController.java;h=0aa6974e91c9ba9c9b49825be10eb44900128365;hb=f300194deee749427175a05ed4af8bd563447ba0;hp=29426ab02c41fdcb3beb24865896712b80839a1e;hpb=194b712cc0d58def2e02c8532f6fa503856c1fda;p=nonrtric.git diff --git a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/r1producer/ProducerController.java b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/r1producer/ProducerController.java index 29426ab0..0aa6974e 100644 --- a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/r1producer/ProducerController.java +++ b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/controllers/r1producer/ProducerController.java @@ -149,7 +149,8 @@ public class ProducerController { if (registrationInfo.jobDataSchema == null) { return ErrorResponse.create("No schema provided", HttpStatus.BAD_REQUEST); } - InfoType newDefinition = new InfoType(infoTypeId, registrationInfo.jobDataSchema); + InfoType newDefinition = + new InfoType(infoTypeId, registrationInfo.jobDataSchema, registrationInfo.typeSpecificInformation); this.infoTypes.put(newDefinition); this.typeSubscriptions.notifyTypeRegistered(newDefinition); return new ResponseEntity<>(previousDefinition == null ? HttpStatus.CREATED : HttpStatus.OK); @@ -190,6 +191,7 @@ public class ProducerController { return ErrorResponse.create("The type has active producers: " + firstProducerId, HttpStatus.NOT_ACCEPTABLE); } this.infoTypes.remove(type); + infoJobs.getJobsForType(type).forEach(job -> infoJobs.remove(job, infoProducers)); // Delete jobs for the type this.typeSubscriptions.notifyTypeRemoved(type); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @@ -393,7 +395,7 @@ public class ProducerController { } private ProducerInfoTypeInfo toInfoTypeInfo(InfoType t) { - return new ProducerInfoTypeInfo(t.getJobDataSchema()); + return new ProducerInfoTypeInfo(t.getJobDataSchema(), t.getTypeSpecificInfo()); } private InfoProducers.InfoProducerRegistrationInfo toProducerRegistrationInfo(String infoProducerId,