The information type definition is extended to contain generic
information of the type.
This can be used to pass information about the types to the data
consumer. As an example, this could be
available reporting periods.
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Issue-ID: NONRTRIC-594
Change-Id: Ia5620e08a5c60903e2d5d8232ad3601b5091535c
"producer_info_type_info": {
"description": "Information for an Information Type",
"type": "object",
"producer_info_type_info": {
"description": "Information for an Information Type",
"type": "object",
- "required": ["info_job_data_schema"],
- "properties": {"info_job_data_schema": {
- "description": "Json schema for the job data",
- "type": "object"
- }}
+ "required": [
+ "info_job_data_schema",
+ "info_type_information"
+ ],
+ "properties": {
+ "info_type_information": {
+ "description": "Type specific information for the information type",
+ "type": "object"
+ },
+ "info_job_data_schema": {
+ "description": "Json schema for the job data",
+ "type": "object"
+ }
+ }
},
"producer_info_job_request": {
"description": "The body of the Information Producer callbacks for Information Job creation and deletion",
},
"producer_info_job_request": {
"description": "The body of the Information Producer callbacks for Information Job creation and deletion",
producer_info_type_info:
required:
- info_job_data_schema
producer_info_type_info:
required:
- info_job_data_schema
+ - info_type_information
+ info_type_information:
+ type: object
+ description: Type specific information for the information type
info_job_data_schema:
type: object
description: Json schema for the job data
info_job_data_schema:
type: object
description: Json schema for the job data
if (registrationInfo.jobDataSchema == null) {
return ErrorResponse.create("No schema provided", HttpStatus.BAD_REQUEST);
}
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);
this.infoTypes.put(newDefinition);
this.typeSubscriptions.notifyTypeRegistered(newDefinition);
return new ResponseEntity<>(previousDefinition == null ? HttpStatus.CREATED : HttpStatus.OK);
}
private ProducerInfoTypeInfo toInfoTypeInfo(InfoType t) {
}
private ProducerInfoTypeInfo toInfoTypeInfo(InfoType t) {
- return new ProducerInfoTypeInfo(t.getJobDataSchema());
+ return new ProducerInfoTypeInfo(t.getJobDataSchema(), t.getTypeSpecificInfo());
}
private InfoProducers.InfoProducerRegistrationInfo toProducerRegistrationInfo(String infoProducerId,
}
private InfoProducers.InfoProducerRegistrationInfo toProducerRegistrationInfo(String infoProducerId,
@JsonProperty(value = "info_job_data_schema", required = true)
public Object jobDataSchema;
@JsonProperty(value = "info_job_data_schema", required = true)
public Object jobDataSchema;
- public ProducerInfoTypeInfo(Object jobDataSchema) {
+ @Schema(
+ name = "info_type_information",
+ description = "Type specific information for the information type",
+ required = true)
+ @SerializedName("info_type_information")
+ @JsonProperty(value = "info_type_information", required = true)
+ public Object typeSpecificInformation;
+
+ public ProducerInfoTypeInfo(Object jobDataSchema, Object typeSpecificInformation) {
this.jobDataSchema = jobDataSchema;
this.jobDataSchema = jobDataSchema;
+ this.typeSpecificInformation = typeSpecificInformation;
}
public ProducerInfoTypeInfo() {
}
public ProducerInfoTypeInfo() {
@Getter
private final Object jobDataSchema;
@Getter
private final Object jobDataSchema;
- public InfoType(String id, Object jobDataSchema) {
+ @Getter
+ private final Object typeSpecificInfo;
+
+ public InfoType(String id, Object jobDataSchema, Object typeSpecificInfo) {
this.id = id;
this.jobDataSchema = jobDataSchema;
this.id = id;
this.jobDataSchema = jobDataSchema;
+ this.typeSpecificInfo = typeSpecificInfo;
ResponseEntity<String> resp = restClient().getForEntity(url).block();
ProducerInfoTypeInfo info = gson.fromJson(resp.getBody(), ProducerInfoTypeInfo.class);
assertThat(info.jobDataSchema).isNotNull();
ResponseEntity<String> resp = restClient().getForEntity(url).block();
ProducerInfoTypeInfo info = gson.fromJson(resp.getBody(), ProducerInfoTypeInfo.class);
assertThat(info.jobDataSchema).isNotNull();
+ assertThat(info.typeSpecificInformation).isNotNull();
ProducerInfoTypeInfo producerEiTypeRegistrationInfo(String typeId)
throws JsonMappingException, JsonProcessingException {
ProducerInfoTypeInfo producerEiTypeRegistrationInfo(String typeId)
throws JsonMappingException, JsonProcessingException {
- return new ProducerInfoTypeInfo(jsonSchemaObject());
+ return new ProducerInfoTypeInfo(jsonSchemaObject(), typeSpecifcInfoObject());
}
ProducerRegistrationInfo producerEiRegistratioInfoRejecting(String typeId)
}
ProducerRegistrationInfo producerEiRegistratioInfoRejecting(String typeId)
+ private Object typeSpecifcInfoObject() {
+ return jsonObject("{ \"propertyName\" : \"value\" }");
+ }
+
private Object jsonSchemaObject() {
// a json schema with one mandatory property named "string"
String schemaStr = "{" //
private Object jsonSchemaObject() {
// a json schema with one mandatory property named "string"
String schemaStr = "{" //