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);
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);
}
}
private ProducerInfoTypeInfo toInfoTypeInfo(InfoType t) {
- return new ProducerInfoTypeInfo(t.getJobDataSchema());
+ return new ProducerInfoTypeInfo(t.getJobDataSchema(), t.getTypeSpecificInfo());
}
private InfoProducers.InfoProducerRegistrationInfo toProducerRegistrationInfo(String infoProducerId,