Upgrading to java 17.
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Issue-ID: NONRTRIC-840
Change-Id: I40e72f5d7ab09222bf0ea076163e00f2896290e8
# ============LICENSE_END=========================================================
-FROM openjdk:11-jre-slim
+FROM openjdk:17-jdk-slim
EXPOSE 8084 8435
"paths": {
"/actuator/threaddump": {"get": {
"summary": "Actuator web endpoint 'threaddump'",
- "operationId": "threaddump_4",
+ "operationId": "threaddump",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "text/plain;charset=UTF-8": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"tags": ["Actuator"]
}},
"/actuator/info": {"get": {
"summary": "Actuator web endpoint 'info'",
- "operationId": "info_2",
+ "operationId": "info",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"tags": ["Actuator"]
}},
"/actuator/loggers": {"get": {
"summary": "Actuator web endpoint 'loggers'",
- "operationId": "loggers_2",
+ "operationId": "loggers",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"tags": ["Actuator"]
}},
"/actuator/health/**": {"get": {
"summary": "Actuator web endpoint 'health-path'",
- "operationId": "health-path_2",
+ "operationId": "health-path",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"tags": ["Actuator"]
}},
"/actuator/shutdown": {"post": {
"summary": "Actuator web endpoint 'shutdown'",
- "operationId": "shutdown_2",
+ "operationId": "shutdown",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"tags": ["Actuator"]
}},
"/actuator/metrics/{requiredMetricName}": {"get": {
"summary": "Actuator web endpoint 'metrics-requiredMetricName'",
- "operationId": "metrics-requiredMetricName_2",
+ "operationId": "metrics-requiredMetricName",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"parameters": [{
"schema": {"type": "string"},
}},
"/actuator": {"get": {
"summary": "Actuator root web endpoint",
- "operationId": "links_1",
+ "operationId": "links",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {
- "additionalProperties": {
- "additionalProperties": {"$ref": "#/components/schemas/Link"},
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {
+ "additionalProperties": {
+ "additionalProperties": {"$ref": "#/components/schemas/Link"},
+ "type": "object"
+ },
"type": "object"
- },
- "type": "object"
- }}}
+ }},
+ "application/json": {"schema": {
+ "additionalProperties": {
+ "additionalProperties": {"$ref": "#/components/schemas/Link"},
+ "type": "object"
+ },
+ "type": "object"
+ }},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {
+ "additionalProperties": {
+ "additionalProperties": {"$ref": "#/components/schemas/Link"},
+ "type": "object"
+ },
+ "type": "object"
+ }}
+ }
}},
"tags": ["Actuator"]
}},
"/actuator/logfile": {"get": {
"summary": "Actuator web endpoint 'logfile'",
- "operationId": "logfile_2",
+ "operationId": "logfile",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {"text/plain;charset=UTF-8": {"schema": {"type": "object"}}}
}},
"tags": ["Actuator"]
}},
"/actuator/loggers/{name}": {
"post": {
"summary": "Actuator web endpoint 'loggers-name'",
- "operationId": "loggers-name_3",
+ "requestBody": {"content": {"application/json": {"schema": {
+ "type": "string",
+ "enum": [
+ "TRACE",
+ "DEBUG",
+ "INFO",
+ "WARN",
+ "ERROR",
+ "FATAL",
+ "OFF"
+ ]
+ }}}},
+ "operationId": "loggers-name_2",
"responses": {"200": {
"description": "OK",
"content": {"*/*": {"schema": {"type": "object"}}}
},
"get": {
"summary": "Actuator web endpoint 'loggers-name'",
- "operationId": "loggers-name_4",
+ "operationId": "loggers-name",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"parameters": [{
"schema": {"type": "string"},
},
"/actuator/health": {"get": {
"summary": "Actuator web endpoint 'health'",
- "operationId": "health_2",
+ "operationId": "health",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"tags": ["Actuator"]
}},
"/actuator/metrics": {"get": {
"summary": "Actuator web endpoint 'metrics'",
- "operationId": "metrics_2",
+ "operationId": "metrics",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {
+ "application/vnd.spring-boot.actuator.v3+json": {"schema": {"type": "object"}},
+ "application/json": {"schema": {"type": "object"}},
+ "application/vnd.spring-boot.actuator.v2+json": {"schema": {"type": "object"}}
+ }
}},
"tags": ["Actuator"]
}},
"/actuator/heapdump": {"get": {
"summary": "Actuator web endpoint 'heapdump'",
- "operationId": "heapdump_2",
+ "operationId": "heapdump",
"responses": {"200": {
"description": "OK",
- "content": {"*/*": {"schema": {"type": "object"}}}
+ "content": {"application/octet-stream": {"schema": {"type": "object"}}}
}},
"tags": ["Actuator"]
}}
"title": "PM Logger",
"version": "1.0"
},
- "tags": [
- {"name": "Information Coordinator Service Simulator (exists only in test)"},
- {
- "name": "Actuator",
- "description": "Monitor and interact",
- "externalDocs": {
- "description": "Spring Boot Actuator Web API Documentation",
- "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/"
- }
+ "tags": [{
+ "name": "Actuator",
+ "description": "Monitor and interact",
+ "externalDocs": {
+ "description": "Spring Boot Actuator Web API Documentation",
+ "url": "https://docs.spring.io/spring-boot/docs/current/actuator-api/html/"
}
- ]
+ }]
}
\ No newline at end of file
servers:
- url: /
tags:
-- name: Information Coordinator Service Simulator (exists only in test)
- name: Actuator
description: Monitor and interact
externalDocs:
tags:
- Actuator
summary: Actuator web endpoint 'threaddump'
- operationId: threaddump_4
+ operationId: threaddump
responses:
200:
description: OK
content:
- '*/*':
+ text/plain;charset=UTF-8:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/actuator/info:
tags:
- Actuator
summary: Actuator web endpoint 'info'
- operationId: info_2
+ operationId: info
responses:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/actuator/loggers:
tags:
- Actuator
summary: Actuator web endpoint 'loggers'
- operationId: loggers_2
+ operationId: loggers
responses:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/actuator/health/**:
tags:
- Actuator
summary: Actuator web endpoint 'health-path'
- operationId: health-path_2
+ operationId: health-path
responses:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/actuator/shutdown:
tags:
- Actuator
summary: Actuator web endpoint 'shutdown'
- operationId: shutdown_2
+ operationId: shutdown
responses:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/actuator/metrics/{requiredMetricName}:
tags:
- Actuator
summary: Actuator web endpoint 'metrics-requiredMetricName'
- operationId: metrics-requiredMetricName_2
+ operationId: metrics-requiredMetricName
parameters:
- name: requiredMetricName
in: path
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/actuator:
tags:
- Actuator
summary: Actuator root web endpoint
- operationId: links_1
+ operationId: links
responses:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ additionalProperties:
+ type: object
+ additionalProperties:
+ $ref: '#/components/schemas/Link'
+ application/json:
+ schema:
+ type: object
+ additionalProperties:
+ type: object
+ additionalProperties:
+ $ref: '#/components/schemas/Link'
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
additionalProperties:
tags:
- Actuator
summary: Actuator web endpoint 'logfile'
- operationId: logfile_2
+ operationId: logfile
responses:
200:
description: OK
content:
- '*/*':
+ text/plain;charset=UTF-8:
schema:
type: object
/data-consumer/v1/info-jobs/{infoJobId}:
tags:
- Actuator
summary: Actuator web endpoint 'loggers-name'
- operationId: loggers-name_4
+ operationId: loggers-name
parameters:
- name: name
in: path
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
post:
tags:
- Actuator
summary: Actuator web endpoint 'loggers-name'
- operationId: loggers-name_3
+ operationId: loggers-name_2
parameters:
- name: name
in: path
explode: false
schema:
type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: string
+ enum:
+ - TRACE
+ - DEBUG
+ - INFO
+ - WARN
+ - ERROR
+ - FATAL
+ - OFF
responses:
200:
description: OK
tags:
- Actuator
summary: Actuator web endpoint 'health'
- operationId: health_2
+ operationId: health
responses:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/actuator/metrics:
tags:
- Actuator
summary: Actuator web endpoint 'metrics'
- operationId: metrics_2
+ operationId: metrics
responses:
200:
description: OK
content:
- '*/*':
+ application/vnd.spring-boot.actuator.v3+json:
+ schema:
+ type: object
+ application/json:
+ schema:
+ type: object
+ application/vnd.spring-boot.actuator.v2+json:
schema:
type: object
/actuator/heapdump:
tags:
- Actuator
summary: Actuator web endpoint 'heapdump'
- operationId: heapdump_2
+ operationId: heapdump
responses:
200:
description: OK
content:
- '*/*':
+ application/octet-stream:
schema:
type: object
components:
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>2.7.8</version>
+ <version>3.0.3</version>
<relativePath />
</parent>
<groupId>org.o-ran-sc.nonrtric.plt</groupId>
</repository>
</repositories>
<properties>
- <java.version>11</java.version>
- <springfox.version>3.0.0</springfox.version>
+ <java.version>17</java.version>
<gson.version>2.9.0</gson.version>
- <swagger.version>2.2.1</swagger.version>
<json.version>20211205</json.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<formatter-maven-plugin.version>2.12.2</formatter-maven-plugin.version>
<sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
<swagger-codegen-maven-plugin.version>3.0.11</swagger-codegen-maven-plugin.version>
+ <springdoc.version>2.0.2</springdoc.version>
<exec.skip>true</exec.skip>
</properties>
<dependencies>
+ <dependency>
+ <groupId>org.springdoc</groupId>
+ <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
+ <version>${springdoc.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springdoc</groupId>
+ <artifactId>springdoc-openapi-ui</artifactId>
+ <version>${springdoc.version}</version>
+ </dependency>
<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-java</artifactId>
<groupId>org.springframework</groupId>
<artifactId>spring-webflux</artifactId>
</dependency>
- <dependency>
- <groupId>io.swagger.core.v3</groupId>
- <artifactId>swagger-jaxrs2</artifactId>
- <version>${swagger.version}</version>
- </dependency>
- <dependency>
- <groupId>io.swagger.core.v3</groupId>
- <artifactId>swagger-jaxrs2-servlet-initializer</artifactId>
- <version>${swagger.version}</version>
- </dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
- <!--REQUIRED TO GENERATE DOCUMENTATION -->
- <dependency>
- <groupId>io.springfox</groupId>
- <artifactId>springfox-swagger2</artifactId>
- <version>${springfox.version}</version>
- </dependency>
- <dependency>
- <groupId>io.springfox</groupId>
- <artifactId>springfox-swagger-ui</artifactId>
- <version>${springfox.version}</version>
- </dependency>
<!-- For development help -->
<dependency>
<groupId>org.springframework.boot</groupId>
return measInfoList.getMeasTypes().getMeasType(measResult.getP());
}
- private String fdn(PmReport report, PmReport.MeasValuesList measValueList) {
- return report.event.getPerf3gppFields().getMeasDataCollection().getMeasuredEntityDn() + ","
- + measValueList.getMeasObjInstId();
- }
-
private void addCounterFieldToPoint(Point point, PmReport.MeasInfoList measInfoList,
PmReport.MeasValuesList measValueList, PmReport.MeasResult measResult) {
String measType = measType(measResult, measInfoList);
if (measValueList.getSuspectFlag().equals("true")) {
continue;
}
- Point point = Point.measurement(fdn(report, measValueList)).time(endTime(report), WritePrecision.MS);
+ Point point = Point.measurement(report.fullDistinguishedName(measValueList)).time(endTime(report),
+ WritePrecision.MS);
point.addField("GranularityPeriod", measDataCollection.getGranularityPeriod());
import lombok.Getter;
import lombok.Setter;
-
@Builder(toBuilder = true)
public class PmReport {
return event.commonEventHeader.lastEpochMicrosec / 1000;
}
+ public String fullDistinguishedName(PmReport.MeasValuesList measValueList) {
+ return event.getPerf3gppFields().getMeasDataCollection().getMeasuredEntityDn() + ","
+ + measValueList.getMeasObjInstId();
+ }
+
@Expose
public Event event;
@PathVariable("infoJobId") String jobId, //
@RequestBody String body) {
logger.debug("*** added consumer job {}", jobId);
- ConsumerJobInfo informationJobObject = gson.fromJson(body, ConsumerJobInfo.class);
- testResults.setCreatedJob(informationJobObject);
- return new ResponseEntity<>(HttpStatus.OK);
+ try {
+ ConsumerJobInfo informationJobObject = gson.fromJson(body, ConsumerJobInfo.class);
+ testResults.setCreatedJob(informationJobObject);
+ return new ResponseEntity<>(HttpStatus.OK);
+ } catch (Exception e) {
+ logger.error("Received malformed data: {}, {}", body, e.getMessage());
+ return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
+ }
}
}
Thread.sleep(4000);
}
- private String generateCounterValue(int sequenceValue, int noOfObjects, String counterName) {
+ private String generateCounterValue(int sequenceValue, int noOfObjects, String counterName, String resourceFdn) {
long value = (random.nextInt() % 100) * sequenceValue + (counterName.hashCode() % 5000);
return Long.toString(value);
}
setEndTime(report, sequenceValue, noOfObjects);
- // Fill it with random values
+ // Fill it with generated values
for (PmReport.MeasInfoList measInfoList : measDataCollection.getMeasInfoList()) {
for (PmReport.MeasValuesList measValueList : measInfoList.getMeasValuesList()) {
for (PmReport.MeasResult measResult : measValueList.getMeasResults()) {
String value = this.generateCounterValue(sequenceValue, noOfObjects,
- measType(measResult, measInfoList));
+ measType(measResult, measInfoList), report.fullDistinguishedName(measValueList));
measResult.setSValue(value);
}
}