Remove DMaaP Adapter 95/7995/1
authorelinuxhenrik <henrik.b.andersson@est.tech>
Mon, 28 Mar 2022 12:35:17 +0000 (14:35 +0200)
committerelinuxhenrik <henrik.b.andersson@est.tech>
Mon, 28 Mar 2022 12:35:21 +0000 (14:35 +0200)
Issue-ID: NONRTRIC-713
Signed-off-by: elinuxhenrik <henrik.b.andersson@est.tech>
Change-Id: I66c235423ed7f4371a17deb0c2c0b18fa14b6ddf

53 files changed:
dmaap-adaptor-java/Dockerfile [deleted file]
dmaap-adaptor-java/README.md [deleted file]
dmaap-adaptor-java/api/api.json [deleted file]
dmaap-adaptor-java/api/api.yaml [deleted file]
dmaap-adaptor-java/config/README [deleted file]
dmaap-adaptor-java/config/application.yaml [deleted file]
dmaap-adaptor-java/config/application_configuration.json [deleted file]
dmaap-adaptor-java/config/keystore.jks [deleted file]
dmaap-adaptor-java/config/truststore.jks [deleted file]
dmaap-adaptor-java/eclipse-formatter.xml [deleted file]
dmaap-adaptor-java/pom.xml [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/Application.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/BeanFactory.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/SwaggerConfig.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/clients/AsyncRestClient.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/clients/AsyncRestClientFactory.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/configuration/ApplicationConfig.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/configuration/WebClientConfig.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/controllers/ErrorResponse.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/controllers/ProducerCallbacksController.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/controllers/VoidResponse.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/exceptions/ServiceException.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/r1/ConsumerJobInfo.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/r1/ProducerInfoTypeInfo.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/r1/ProducerJobInfo.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/r1/ProducerRegistrationInfo.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/InfoType.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/InfoTypes.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/Job.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/Jobs.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/MultiMap.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/DmaapTopicConsumer.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/DmaapTopicConsumers.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/KafkaJobDataConsumer.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/KafkaTopicConsumers.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/KafkaTopicListener.java [deleted file]
dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/ProducerRegstrationTask.java [deleted file]
dmaap-adaptor-java/src/main/resources/typeSchemaDmaap.json [deleted file]
dmaap-adaptor-java/src/main/resources/typeSchemaKafka.json [deleted file]
dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/ApplicationTest.java [deleted file]
dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/ConsumerController.java [deleted file]
dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/DmaapSimulatorController.java [deleted file]
dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/IcsSimulatorController.java [deleted file]
dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/IntegrationWithIcs.java [deleted file]
dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/IntegrationWithKafka.java [deleted file]
dmaap-adaptor-java/src/test/resources/test_application_configuration.json [deleted file]
docs/api-docs.rst
docs/conf.py
docs/developer-guide.rst
docs/overview.rst
docs/release-notes.rst
information-coordinator-service/api/README.md [new file with mode: 0644]
pom.xml

diff --git a/dmaap-adaptor-java/Dockerfile b/dmaap-adaptor-java/Dockerfile
deleted file mode 100644 (file)
index f565e80..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# ============LICENSE_START=======================================================
-# O-RAN-SC
-# ================================================================================
-# Copyright (C) 2021 Nordix Foundation. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-
-FROM openjdk:11-jre-slim
-
-EXPOSE 8084 8435
-
-ARG JAR
-
-WORKDIR /opt/app/dmaap-adaptor-service
-RUN mkdir -p /var/log/dmaap-adaptor-service
-RUN mkdir -p /opt/app/dmaap-adaptor-service/etc/cert/
-RUN mkdir -p /var/dmaap-adaptor-service
-
-ADD /config/application.yaml /opt/app/dmaap-adaptor-service/config/application.yaml
-ADD /config/application_configuration.json /opt/app/dmaap-adaptor-service/data/application_configuration.json_example
-ADD /config/keystore.jks /opt/app/dmaap-adaptor-service/etc/cert/keystore.jks
-ADD /config/truststore.jks /opt/app/dmaap-adaptor-service/etc/cert/truststore.jks
-
-ARG user=nonrtric
-ARG group=nonrtric
-
-RUN groupadd $user && \
-    useradd -r -g $group $user
-RUN chown -R $user:$group /opt/app/dmaap-adaptor-service
-RUN chown -R $user:$group /var/log/dmaap-adaptor-service
-RUN chown -R $user:$group /var/dmaap-adaptor-service
-
-USER ${user}
-
-ADD target/${JAR} /opt/app/dmaap-adaptor-service/dmaap-adaptor.jar
-CMD ["java", "-jar", "/opt/app/dmaap-adaptor-service/dmaap-adaptor.jar"]
diff --git a/dmaap-adaptor-java/README.md b/dmaap-adaptor-java/README.md
deleted file mode 100644 (file)
index 162bfb2..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-# O-RAN-SC Non-RealTime RIC DMaaP Information Producer
-This product is a generic information producer (as defined by the Information Coordinator Service (ICS)). It can produce any information that can be retrieved from DMaaP or Kafka. Its main tasks is to register information types and itself as a producer using the ICS Data Producer API.
-
-A data consumer may create information jobs through the ICS Data Producer API.
-
-This service will retrieve data from the DMaaP Message Router (MR) or from the Kafka streaming platform and will distribute it further to the data consumers (information job owners).
-
-The component is a springboot service and is configured as any springboot service through the file `config/application.yaml`. The component log can be retrieved and logging can be controled by means of REST call. See the API documentation (api/api.yaml).
-
-The file `config/application_configuration.json` contains the configuration of job types that the producer will support. Here follows an example with one type:
-
-```sh
-    {
-       "types":
-        [
-          {
-             "id":  "ExampleInformationType1_1.0.0",
-             "dmaapTopicUrl":  "events/unauthenticated.SEC_FAULT_OUTPUT/dmaapmediatorproducer/STD-Fault-Messages_1.0.0",
-             "useHttpProxy": true
-          },
-          {
-             "id": "ExampleInformationType2_2.0.0",
-             "kafkaInputTopic": "KafkaInputTopic",
-             "useHttpProxy": false
-          }
-        ]
-    }
-```
-
-Each information type has the following properties:
- - id the information type identity as exposed in the Information Coordination Service data consumer API
- - dmaapTopicUrl the URL to for fetching information from  DMaaP
- - kafkaInputTopic a Kafka topic to get input from
- - useHttpProxy if true, the received information will be delivered using a HTTP proxy (provided that one is setup in the application.yaml file). This might for instance be needed if the data consumer is in the RAN or outside the cluster.
-
-The service producer will poll MR and/or listen to Kafka topics for all configured job types. When receiving messages for a type, it will distribute these messages to all jobs registered for the type. If a consumer is unavailable for distribution, the messages will be discarded for that consumer.
-
-When an Information Job is created in the Information Coordinator Service Consumer API, it is possible to define a number of job specific properties. For an Information type that has a Kafka topic defined, the following Json schema defines the properties that can be used:
-
-
-```sh
-{
-  "$schema": "http://json-schema.org/draft-04/schema#",
-  "type": "object",
-  "properties": {
-    "filter": {
-      "type": "string"
-    },
-    "maxConcurrency": {
-      "type": "integer"
-    },
-    "bufferTimeout": {
-      "type": "object",
-      "properties": {
-        "maxSize": {
-          "type": "integer"
-        },
-        "maxTimeMiliseconds": {
-          "type": "integer"
-        }
-      },
-      "additionalProperties": false,
-      "required": [
-        "maxSize",
-        "maxTimeMiliseconds"
-      ]
-    }
-  },
-  "additionalProperties": false
-}
-```
--filter is a regular expression. Only strings that matches the expression will be pushed further to the consumer.
--maxConcurrency the maximum number of concurrent REST session for the data delivery to the consumer. 
- The default is 1 and that is the number that must be used to guarantee that the object sequence is maintained. 
- A higher number will give higher throughtput. 
--bufferTimeout, can be used to reduce the number of REST calls to the consumer. If defined, a number of objects will be 
- buffered and sent in one REST call to the consumer.
- The buffered objects will be put in a Json array and quoted. Example; 
-   Object1 and Object2 may be posted in one call -->  ["Object1", "Object2"]
- The bufferTimeout is a Json object and the parameters in the object are:
-   - maxSize the maximum number of buffered objects before posting
-   - maxTimeMiliseconds the maximum delay time to buffer before posting
- If no bufferTimeout is specified, each object will be posted as received in separate calls (not quoted and put in a Json array).
-
-
-For an information type that only has a DMaaP topic, the following Json schema defines the possible parameters to use when creating an information job:
-
-```sh
-{
-  "$schema": "http://json-schema.org/draft-04/schema#",
-  "type": "object",
-  "properties": {
-    "filter": {
-       "type": "string"
-     }
-  },
-  "additionalProperties": false
-}
-```
--filter is a regular expression. Only strings that matches the expression will be pushed furter to the consumer. This
- has a similar meaning as in jobs that receives data from Kafka.
-
-## License
-
-Copyright (C) 2021 Nordix Foundation. Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-For more information about license please see the [LICENSE](LICENSE.txt) file for details.
\ No newline at end of file
diff --git a/dmaap-adaptor-java/api/api.json b/dmaap-adaptor-java/api/api.json
deleted file mode 100644 (file)
index 88fed46..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-{
-    "components": {"schemas": {
-        "producer_info_job_request": {
-            "description": "The body of the Information Producer callbacks for Information Job creation and deletion",
-            "type": "object",
-            "required": ["info_job_identity"],
-            "properties": {
-                "owner": {
-                    "description": "The owner of the job",
-                    "type": "string"
-                },
-                "last_updated": {
-                    "description": "The time when the job was last updated or created (ISO-8601)",
-                    "type": "string"
-                },
-                "info_job_identity": {
-                    "description": "Identity of the Information Job",
-                    "type": "string"
-                },
-                "target_uri": {
-                    "description": "URI for the target of the produced Information",
-                    "type": "string"
-                },
-                "info_job_data": {
-                    "description": "Json for the job data",
-                    "type": "object"
-                },
-                "info_type_identity": {
-                    "description": "Type identity for the job",
-                    "type": "string"
-                }
-            }
-        },
-        "error_information": {
-            "description": "Problem as defined in https://tools.ietf.org/html/rfc7807",
-            "type": "object",
-            "properties": {
-                "detail": {
-                    "description": " A human-readable explanation specific to this occurrence of the problem.",
-                    "type": "string",
-                    "example": "Policy type not found"
-                },
-                "status": {
-                    "format": "int32",
-                    "description": "The HTTP status code generated by the origin server for this occurrence of the problem. ",
-                    "type": "integer",
-                    "example": 503
-                }
-            }
-        },
-        "void": {
-            "description": "Void/empty",
-            "type": "object"
-        },
-        "producer_registration_info": {
-            "description": "Information for an Information Producer",
-            "type": "object",
-            "required": [
-                "info_job_callback_url",
-                "info_producer_supervision_callback_url",
-                "supported_info_types"
-            ],
-            "properties": {
-                "info_producer_supervision_callback_url": {
-                    "description": "callback for producer supervision",
-                    "type": "string"
-                },
-                "supported_info_types": {
-                    "description": "Supported Information Type IDs",
-                    "type": "array",
-                    "items": {
-                        "description": "Supported Information Type IDs",
-                        "type": "string"
-                    }
-                },
-                "info_job_callback_url": {
-                    "description": "callback for Information Job",
-                    "type": "string"
-                }
-            }
-        },
-        "Link": {
-            "type": "object",
-            "properties": {
-                "templated": {"type": "boolean"},
-                "href": {"type": "string"}
-            }
-        },
-        "producer_info_type_info": {
-            "description": "Information for an Information Type",
-            "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"
-                }
-            }
-        }
-    }},
-    "openapi": "3.0.1",
-    "paths": {
-        "/actuator/threaddump": {"get": {
-            "summary": "Actuator web endpoint 'threaddump'",
-            "operationId": "threaddump_4",
-            "responses": {"200": {
-                "description": "OK",
-                "content": {"*/*": {"schema": {"type": "object"}}}
-            }},
-            "tags": ["Actuator"]
-        }},
-        "/actuator/info": {"get": {
-            "summary": "Actuator web endpoint 'info'",
-            "operationId": "info_2",
-            "responses": {"200": {
-                "description": "OK",
-                "content": {"*/*": {"schema": {"type": "object"}}}
-            }},
-            "tags": ["Actuator"]
-        }},
-        "/data-producer/v1/info-types/{infoTypeId}": {"put": {
-            "requestBody": {
-                "content": {"application/json": {"schema": {"$ref": "#/components/schemas/producer_info_type_info"}}},
-                "required": true
-            },
-            "operationId": "putInfoType",
-            "responses": {"200": {
-                "description": "OK",
-                "content": {"application/json": {"schema": {"type": "object"}}}
-            }},
-            "parameters": [{
-                "schema": {"type": "string"},
-                "in": "path",
-                "name": "infoTypeId",
-                "required": true
-            }],
-            "tags": ["Information Coordinator Service Simulator (exists only in test)"]
-        }},
-        "/generic_dataproducer/health_check": {"get": {
-            "summary": "Producer supervision",
-            "description": "The endpoint is provided by the Information Producer and is used for supervision of the producer.",
-            "operationId": "producerSupervision",
-            "responses": {"200": {
-                "description": "The producer is OK",
-                "content": {"application/json": {"schema": {"type": "string"}}}
-            }},
-            "tags": ["Producer job control API"]
-        }},
-        "/generic_dataproducer/info_job": {
-            "post": {
-                "summary": "Callback for Information Job creation/modification",
-                "requestBody": {
-                    "content": {"application/json": {"schema": {"type": "string"}}},
-                    "required": true
-                },
-                "description": "The call is invoked to activate or to modify a data subscription. The endpoint is provided by the Information Producer.",
-                "operationId": "jobCreatedCallback",
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "content": {"application/json": {"schema": {"$ref": "#/components/schemas/void"}}}
-                    },
-                    "400": {
-                        "description": "Other error in the request",
-                        "content": {"application/json": {"schema": {"$ref": "#/components/schemas/error_information"}}}
-                    },
-                    "404": {
-                        "description": "Information type is not found",
-                        "content": {"application/json": {"schema": {"$ref": "#/components/schemas/error_information"}}}
-                    }
-                },
-                "tags": ["Producer job control API"]
-            },
-            "get": {
-                "summary": "Get all jobs",
-                "description": "Returns all info jobs, can be used for trouble shooting",
-                "operationId": "getJobs",
-                "responses": {"200": {
-                    "description": "Information jobs",
-                    "content": {"application/json": {"schema": {
-                        "type": "array",
-                        "items": {"$ref": "#/components/schemas/producer_info_job_request"}
-                    }}}
-                }},
-                "tags": ["Producer job control API"]
-            }
-        },
-        "/actuator/loggers": {"get": {
-            "summary": "Actuator web endpoint 'loggers'",
-            "operationId": "loggers_2",
-            "responses": {"200": {
-                "description": "OK",
-                "content": {"*/*": {"schema": {"type": "object"}}}
-            }},
-            "tags": ["Actuator"]
-        }},
-        "/actuator/health/**": {"get": {
-            "summary": "Actuator web endpoint 'health-path'",
-            "operationId": "health-path_2",
-            "responses": {"200": {
-                "description": "OK",
-                "content": {"*/*": {"schema": {"type": "object"}}}
-            }},
-            "tags": ["Actuator"]
-        }},
-        "/data-producer/v1/info-producers/{infoProducerId}": {
-            "get": {
-                "operationId": "getInfoProducer",
-                "responses": {"200": {
-                    "description": "OK",
-                    "content": {"application/json": {"schema": {"type": "object"}}}
-                }},
-                "parameters": [{
-                    "schema": {"type": "string"},
-                    "in": "path",
-                    "name": "infoProducerId",
-                    "required": true
-                }],
-                "tags": ["Information Coordinator Service Simulator (exists only in test)"]
-            },
-            "put": {
-                "requestBody": {
-                    "content": {"application/json": {"schema": {"$ref": "#/components/schemas/producer_registration_info"}}},
-                    "required": true
-                },
-                "operationId": "putInfoProducer",
-                "responses": {"200": {
-                    "description": "OK",
-                    "content": {"application/json": {"schema": {"type": "object"}}}
-                }},
-                "parameters": [{
-                    "schema": {"type": "string"},
-                    "in": "path",
-                    "name": "infoProducerId",
-                    "required": true
-                }],
-                "tags": ["Information Coordinator Service Simulator (exists only in test)"]
-            }
-        },
-        "/generic_dataproducer/info_job/{infoJobId}": {"delete": {
-            "summary": "Callback for Information Job deletion",
-            "description": "The call is invoked to terminate a data subscription. The endpoint is provided by the Information Producer.",
-            "operationId": "jobDeletedCallback",
-            "responses": {"200": {
-                "description": "OK",
-                "content": {"application/json": {"schema": {"$ref": "#/components/schemas/void"}}}
-            }},
-            "parameters": [{
-                "schema": {"type": "string"},
-                "in": "path",
-                "name": "infoJobId",
-                "required": true
-            }],
-            "tags": ["Producer job control API"]
-        }},
-        "/actuator/metrics/{requiredMetricName}": {"get": {
-            "summary": "Actuator web endpoint 'metrics-requiredMetricName'",
-            "operationId": "metrics-requiredMetricName_2",
-            "responses": {"200": {
-                "description": "OK",
-                "content": {"*/*": {"schema": {"type": "object"}}}
-            }},
-            "parameters": [{
-                "schema": {"type": "string"},
-                "in": "path",
-                "name": "requiredMetricName",
-                "required": true
-            }],
-            "tags": ["Actuator"]
-        }},
-        "/actuator": {"get": {
-            "summary": "Actuator root web endpoint",
-            "operationId": "links_1",
-            "responses": {"200": {
-                "description": "OK",
-                "content": {"*/*": {"schema": {
-                    "additionalProperties": {
-                        "additionalProperties": {"$ref": "#/components/schemas/Link"},
-                        "type": "object"
-                    },
-                    "type": "object"
-                }}}
-            }},
-            "tags": ["Actuator"]
-        }},
-        "/actuator/logfile": {"get": {
-            "summary": "Actuator web endpoint 'logfile'",
-            "operationId": "logfile_2",
-            "responses": {"200": {
-                "description": "OK",
-                "content": {"*/*": {"schema": {"type": "object"}}}
-            }},
-            "tags": ["Actuator"]
-        }},
-        "/actuator/loggers/{name}": {
-            "post": {
-                "summary": "Actuator web endpoint 'loggers-name'",
-                "operationId": "loggers-name_3",
-                "responses": {"200": {
-                    "description": "OK",
-                    "content": {"*/*": {"schema": {"type": "object"}}}
-                }},
-                "parameters": [{
-                    "schema": {"type": "string"},
-                    "in": "path",
-                    "name": "name",
-                    "required": true
-                }],
-                "tags": ["Actuator"]
-            },
-            "get": {
-                "summary": "Actuator web endpoint 'loggers-name'",
-                "operationId": "loggers-name_4",
-                "responses": {"200": {
-                    "description": "OK",
-                    "content": {"*/*": {"schema": {"type": "object"}}}
-                }},
-                "parameters": [{
-                    "schema": {"type": "string"},
-                    "in": "path",
-                    "name": "name",
-                    "required": true
-                }],
-                "tags": ["Actuator"]
-            }
-        },
-        "/actuator/health": {"get": {
-            "summary": "Actuator web endpoint 'health'",
-            "operationId": "health_2",
-            "responses": {"200": {
-                "description": "OK",
-                "content": {"*/*": {"schema": {"type": "object"}}}
-            }},
-            "tags": ["Actuator"]
-        }},
-        "/consumer": {"post": {
-            "summary": "Consume data",
-            "requestBody": {
-                "content": {"application/json": {"schema": {"type": "string"}}},
-                "required": true
-            },
-            "description": "The call is invoked to push data to consumer",
-            "operationId": "postData",
-            "responses": {"200": {
-                "description": "OK",
-                "content": {"application/json": {"schema": {"$ref": "#/components/schemas/void"}}}
-            }},
-            "tags": ["Test Consumer Simulator (exists only in test)"]
-        }},
-        "/dmaap-topic-1": {"get": {
-            "summary": "GET from topic",
-            "description": "The call is invoked to activate or to modify a data subscription. The endpoint is provided by the Information Producer.",
-            "operationId": "getFromTopic",
-            "responses": {"200": {
-                "description": "OK",
-                "content": {"application/json": {"schema": {"$ref": "#/components/schemas/void"}}}
-            }},
-            "tags": ["DMAAP Simulator (exists only in test)"]
-        }},
-        "/actuator/metrics": {"get": {
-            "summary": "Actuator web endpoint 'metrics'",
-            "operationId": "metrics_2",
-            "responses": {"200": {
-                "description": "OK",
-                "content": {"*/*": {"schema": {"type": "object"}}}
-            }},
-            "tags": ["Actuator"]
-        }},
-        "/actuator/heapdump": {"get": {
-            "summary": "Actuator web endpoint 'heapdump'",
-            "operationId": "heapdump_2",
-            "responses": {"200": {
-                "description": "OK",
-                "content": {"*/*": {"schema": {"type": "object"}}}
-            }},
-            "tags": ["Actuator"]
-        }}
-    },
-    "info": {
-        "license": {
-            "name": "Copyright (C) 2021 Nordix Foundation. Licensed under the Apache License.",
-            "url": "http://www.apache.org/licenses/LICENSE-2.0"
-        },
-        "description": "Reads data from DMaaP and Kafka and posts it further to information consumers",
-        "title": "Generic Dmaap and Kafka Information Producer",
-        "version": "1.0"
-    },
-    "tags": [
-        {"name": "Information Coordinator Service Simulator (exists only in test)"},
-        {"name": "Producer job control API"},
-        {"name": "Test Consumer Simulator (exists only in test)"},
-        {"name": "DMAAP 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/"
-            }
-        }
-    ]
-}
\ No newline at end of file
diff --git a/dmaap-adaptor-java/api/api.yaml b/dmaap-adaptor-java/api/api.yaml
deleted file mode 100644 (file)
index f6eb1f7..0000000
+++ /dev/null
@@ -1,482 +0,0 @@
-openapi: 3.0.1
-info:
-  title: Generic Dmaap and Kafka Information Producer
-  description: Reads data from DMaaP and Kafka and posts it further to information
-    consumers
-  license:
-    name: Copyright (C) 2021 Nordix Foundation. Licensed under the Apache License.
-    url: http://www.apache.org/licenses/LICENSE-2.0
-  version: "1.0"
-servers:
-- url: /
-tags:
-- name: Information Coordinator Service Simulator (exists only in test)
-- name: Producer job control API
-- name: Test Consumer Simulator (exists only in test)
-- name: DMAAP 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/
-paths:
-  /actuator/threaddump:
-    get:
-      tags:
-      - Actuator
-      summary: Actuator web endpoint 'threaddump'
-      operationId: threaddump_4
-      responses:
-        200:
-          description: OK
-          content:
-            '*/*':
-              schema:
-                type: object
-  /actuator/info:
-    get:
-      tags:
-      - Actuator
-      summary: Actuator web endpoint 'info'
-      operationId: info_2
-      responses:
-        200:
-          description: OK
-          content:
-            '*/*':
-              schema:
-                type: object
-  /data-producer/v1/info-types/{infoTypeId}:
-    put:
-      tags:
-      - Information Coordinator Service Simulator (exists only in test)
-      operationId: putInfoType
-      parameters:
-      - name: infoTypeId
-        in: path
-        required: true
-        style: simple
-        explode: false
-        schema:
-          type: string
-      requestBody:
-        content:
-          application/json:
-            schema:
-              $ref: '#/components/schemas/producer_info_type_info'
-        required: true
-      responses:
-        200:
-          description: OK
-          content:
-            application/json:
-              schema:
-                type: object
-  /generic_dataproducer/health_check:
-    get:
-      tags:
-      - Producer job control API
-      summary: Producer supervision
-      description: The endpoint is provided by the Information Producer and is used
-        for supervision of the producer.
-      operationId: producerSupervision
-      responses:
-        200:
-          description: The producer is OK
-          content:
-            application/json:
-              schema:
-                type: string
-  /generic_dataproducer/info_job:
-    get:
-      tags:
-      - Producer job control API
-      summary: Get all jobs
-      description: Returns all info jobs, can be used for trouble shooting
-      operationId: getJobs
-      responses:
-        200:
-          description: Information jobs
-          content:
-            application/json:
-              schema:
-                type: array
-                items:
-                  $ref: '#/components/schemas/producer_info_job_request'
-    post:
-      tags:
-      - Producer job control API
-      summary: Callback for Information Job creation/modification
-      description: The call is invoked to activate or to modify a data subscription.
-        The endpoint is provided by the Information Producer.
-      operationId: jobCreatedCallback
-      requestBody:
-        content:
-          application/json:
-            schema:
-              type: string
-        required: true
-      responses:
-        200:
-          description: OK
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/void'
-        400:
-          description: Other error in the request
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/error_information'
-        404:
-          description: Information type is not found
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/error_information'
-  /actuator/loggers:
-    get:
-      tags:
-      - Actuator
-      summary: Actuator web endpoint 'loggers'
-      operationId: loggers_2
-      responses:
-        200:
-          description: OK
-          content:
-            '*/*':
-              schema:
-                type: object
-  /actuator/health/**:
-    get:
-      tags:
-      - Actuator
-      summary: Actuator web endpoint 'health-path'
-      operationId: health-path_2
-      responses:
-        200:
-          description: OK
-          content:
-            '*/*':
-              schema:
-                type: object
-  /data-producer/v1/info-producers/{infoProducerId}:
-    get:
-      tags:
-      - Information Coordinator Service Simulator (exists only in test)
-      operationId: getInfoProducer
-      parameters:
-      - name: infoProducerId
-        in: path
-        required: true
-        style: simple
-        explode: false
-        schema:
-          type: string
-      responses:
-        200:
-          description: OK
-          content:
-            application/json:
-              schema:
-                type: object
-    put:
-      tags:
-      - Information Coordinator Service Simulator (exists only in test)
-      operationId: putInfoProducer
-      parameters:
-      - name: infoProducerId
-        in: path
-        required: true
-        style: simple
-        explode: false
-        schema:
-          type: string
-      requestBody:
-        content:
-          application/json:
-            schema:
-              $ref: '#/components/schemas/producer_registration_info'
-        required: true
-      responses:
-        200:
-          description: OK
-          content:
-            application/json:
-              schema:
-                type: object
-  /generic_dataproducer/info_job/{infoJobId}:
-    delete:
-      tags:
-      - Producer job control API
-      summary: Callback for Information Job deletion
-      description: The call is invoked to terminate a data subscription. The endpoint
-        is provided by the Information Producer.
-      operationId: jobDeletedCallback
-      parameters:
-      - name: infoJobId
-        in: path
-        required: true
-        style: simple
-        explode: false
-        schema:
-          type: string
-      responses:
-        200:
-          description: OK
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/void'
-  /actuator/metrics/{requiredMetricName}:
-    get:
-      tags:
-      - Actuator
-      summary: Actuator web endpoint 'metrics-requiredMetricName'
-      operationId: metrics-requiredMetricName_2
-      parameters:
-      - name: requiredMetricName
-        in: path
-        required: true
-        style: simple
-        explode: false
-        schema:
-          type: string
-      responses:
-        200:
-          description: OK
-          content:
-            '*/*':
-              schema:
-                type: object
-  /actuator:
-    get:
-      tags:
-      - Actuator
-      summary: Actuator root web endpoint
-      operationId: links_1
-      responses:
-        200:
-          description: OK
-          content:
-            '*/*':
-              schema:
-                type: object
-                additionalProperties:
-                  type: object
-                  additionalProperties:
-                    $ref: '#/components/schemas/Link'
-  /actuator/logfile:
-    get:
-      tags:
-      - Actuator
-      summary: Actuator web endpoint 'logfile'
-      operationId: logfile_2
-      responses:
-        200:
-          description: OK
-          content:
-            '*/*':
-              schema:
-                type: object
-  /actuator/loggers/{name}:
-    get:
-      tags:
-      - Actuator
-      summary: Actuator web endpoint 'loggers-name'
-      operationId: loggers-name_4
-      parameters:
-      - name: name
-        in: path
-        required: true
-        style: simple
-        explode: false
-        schema:
-          type: string
-      responses:
-        200:
-          description: OK
-          content:
-            '*/*':
-              schema:
-                type: object
-    post:
-      tags:
-      - Actuator
-      summary: Actuator web endpoint 'loggers-name'
-      operationId: loggers-name_3
-      parameters:
-      - name: name
-        in: path
-        required: true
-        style: simple
-        explode: false
-        schema:
-          type: string
-      responses:
-        200:
-          description: OK
-          content:
-            '*/*':
-              schema:
-                type: object
-  /actuator/health:
-    get:
-      tags:
-      - Actuator
-      summary: Actuator web endpoint 'health'
-      operationId: health_2
-      responses:
-        200:
-          description: OK
-          content:
-            '*/*':
-              schema:
-                type: object
-  /consumer:
-    post:
-      tags:
-      - Test Consumer Simulator (exists only in test)
-      summary: Consume data
-      description: The call is invoked to push data to consumer
-      operationId: postData
-      requestBody:
-        content:
-          application/json:
-            schema:
-              type: string
-        required: true
-      responses:
-        200:
-          description: OK
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/void'
-  /dmaap-topic-1:
-    get:
-      tags:
-      - DMAAP Simulator (exists only in test)
-      summary: GET from topic
-      description: The call is invoked to activate or to modify a data subscription.
-        The endpoint is provided by the Information Producer.
-      operationId: getFromTopic
-      responses:
-        200:
-          description: OK
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/void'
-  /actuator/metrics:
-    get:
-      tags:
-      - Actuator
-      summary: Actuator web endpoint 'metrics'
-      operationId: metrics_2
-      responses:
-        200:
-          description: OK
-          content:
-            '*/*':
-              schema:
-                type: object
-  /actuator/heapdump:
-    get:
-      tags:
-      - Actuator
-      summary: Actuator web endpoint 'heapdump'
-      operationId: heapdump_2
-      responses:
-        200:
-          description: OK
-          content:
-            '*/*':
-              schema:
-                type: object
-components:
-  schemas:
-    producer_info_job_request:
-      required:
-      - info_job_identity
-      type: object
-      properties:
-        owner:
-          type: string
-          description: The owner of the job
-        last_updated:
-          type: string
-          description: The time when the job was last updated or created (ISO-8601)
-        info_job_identity:
-          type: string
-          description: Identity of the Information Job
-        target_uri:
-          type: string
-          description: URI for the target of the produced Information
-        info_job_data:
-          type: object
-          description: Json for the job data
-        info_type_identity:
-          type: string
-          description: Type identity for the job
-      description: The body of the Information Producer callbacks for Information
-        Job creation and deletion
-    error_information:
-      type: object
-      properties:
-        detail:
-          type: string
-          description: ' A human-readable explanation specific to this occurrence
-            of the problem.'
-          example: Policy type not found
-        status:
-          type: integer
-          description: 'The HTTP status code generated by the origin server for this
-            occurrence of the problem. '
-          format: int32
-          example: 503
-      description: Problem as defined in https://tools.ietf.org/html/rfc7807
-    void:
-      type: object
-      description: Void/empty
-    producer_registration_info:
-      required:
-      - info_job_callback_url
-      - info_producer_supervision_callback_url
-      - supported_info_types
-      type: object
-      properties:
-        info_producer_supervision_callback_url:
-          type: string
-          description: callback for producer supervision
-        supported_info_types:
-          type: array
-          description: Supported Information Type IDs
-          items:
-            type: string
-            description: Supported Information Type IDs
-        info_job_callback_url:
-          type: string
-          description: callback for Information Job
-      description: Information for an Information Producer
-    Link:
-      type: object
-      properties:
-        templated:
-          type: boolean
-        href:
-          type: string
-    producer_info_type_info:
-      required:
-      - info_job_data_schema
-      - info_type_information
-      type: object
-      properties:
-        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
-      description: Information for an Information Type
diff --git a/dmaap-adaptor-java/config/README b/dmaap-adaptor-java/config/README
deleted file mode 100644 (file)
index 140927f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-The keystore.jks and truststore.jks files are created by using the following commands (note that this is an example):
-
-1) Create a CA certificate and a private key:
-
-openssl genrsa -des3 -out CA-key.pem 2048
-openssl req -new -key CA-key.pem -x509 -days 1000 -out CA-cert.pem
-
-2) Create a keystore with a private key entry that is signed by the CA:
-
-keytool -genkeypair -alias policy_agent -keyalg RSA -keysize 2048 -keystore keystore.jks -validity 3650 -storepass policy_agent
-keytool -certreq -alias policy_agent -file request.csr -keystore keystore.jks -ext san=dns:your.domain.com -storepass policy_agent
-openssl x509 -req -days 365 -in request.csr -CA CA-cert.pem -CAkey CA-key.pem -CAcreateserial -out ca_signed-cert.pem
-keytool -importcert -alias ca_cert -file CA-cert.pem -keystore keystore.jks -trustcacerts -storepass policy_agent
-keytool -importcert -alias policy_agent -file ca_signed-cert.pem -keystore keystore.jks -trustcacerts -storepass policy_agent
-
-
-3) Create a trust store containing the CA cert (to trust all certs signed by the CA):
-
-keytool -genkeypair -alias not_used -keyalg RSA -keysize 2048 -keystore truststore.jks -validity 3650 -storepass policy_agent
-keytool -importcert -alias ca_cert -file CA-cert.pem -keystore truststore.jks -trustcacerts -storepass policy_agent
-
-
-4) Command for listing of the contents of jks files, examples:
-keytool -list -v -keystore keystore.jks -storepass policy_agent
-keytool -list -v -keystore truststore.jks -storepass policy_agent
-
-## License
-
-Copyright (C) 2020 Nordix Foundation. All rights reserved.
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
diff --git a/dmaap-adaptor-java/config/application.yaml b/dmaap-adaptor-java/config/application.yaml
deleted file mode 100644 (file)
index c3476ac..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-spring:
-  profiles:
-    active: prod
-  main:
-    allow-bean-definition-overriding: true
-  aop:
-    auto: false
-management:
-  endpoints:
-    web:
-      exposure:
-        # Enabling of springboot actuator features. See springboot documentation.
-        include: "loggers,logfile,health,info,metrics,threaddump,heapdump"
-springdoc:
-  show-actuator: true 
-logging:
-  # Configuration of logging
-  level:
-    ROOT: ERROR
-    org.springframework: ERROR
-    org.springframework.data: ERROR
-    org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR
-    org.oran.dmaapadapter: INFO
-  file:
-    name: /var/log/dmaap-adaptor-service/application.log
-server:
-   # Configuration of the HTTP/REST server. The parameters are defined and handeled by the springboot framework.
-   # See springboot documentation.
-   port : 8435
-   http-port: 8084
-   ssl:
-      key-store-type: JKS
-      key-store-password: policy_agent
-      key-store: /opt/app/dmaap-adaptor-service/etc/cert/keystore.jks
-      key-password: policy_agent
-      key-alias: policy_agent
-app:
-  webclient:
-    # Configuration of the trust store used for the HTTP client (outgoing requests)
-    # The file location and the password for the truststore is only relevant if trust-store-used == true
-    # Note that the same keystore as for the server is used.
-    trust-store-used: false
-    trust-store-password: policy_agent
-    trust-store: /opt/app/dmaap-adaptor-service/etc/cert/truststore.jks
-    # Configuration of usage of HTTP Proxy for the southbound accesses.
-    # The HTTP proxy (if configured) will only be used for accessing NearRT RIC:s
-    http.proxy-host:
-    http.proxy-port: 0
-  ics-base-url: https://localhost:8434
-  # Location of the component configuration file. The file will only be used if the Consul database is not used;
-  # configuration from the Consul will override the file.
-  configuration-filepath: /opt/app/dmaap-adaptor-service/data/application_configuration.json
-  dmaap-base-url: http://dradmin:dradmin@localhost:2222
-  # The url used to adress this component. This is used as a callback url sent to other components.
-  dmaap-adapter-base-url: https://localhost:8435
-  # KAFKA boostrap servers. This is only needed if there are Information Types that uses a kafkaInputTopic
-  # several redundant boostrap servers can be specified, separated by a comma ','.
-  kafka:
-    bootstrap-servers: localhost:9092
-
diff --git a/dmaap-adaptor-java/config/application_configuration.json b/dmaap-adaptor-java/config/application_configuration.json
deleted file mode 100644 (file)
index 6aaffd1..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-   "types": [
-      {
-         "id": "ExampleInformationType1",
-         "dmaapTopicUrl": "/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12",
-         "useHttpProxy": true
-      },
-      {
-         "id": "ExampleInformationType2",
-         "kafkaInputTopic": "TutorialTopic",
-         "useHttpProxy": false
-      }
-      
-   ]
-}
diff --git a/dmaap-adaptor-java/config/keystore.jks b/dmaap-adaptor-java/config/keystore.jks
deleted file mode 100644 (file)
index 122997a..0000000
Binary files a/dmaap-adaptor-java/config/keystore.jks and /dev/null differ
diff --git a/dmaap-adaptor-java/config/truststore.jks b/dmaap-adaptor-java/config/truststore.jks
deleted file mode 100644 (file)
index 60d6288..0000000
Binary files a/dmaap-adaptor-java/config/truststore.jks and /dev/null differ
diff --git a/dmaap-adaptor-java/eclipse-formatter.xml b/dmaap-adaptor-java/eclipse-formatter.xml
deleted file mode 100644 (file)
index b2e86eb..0000000
+++ /dev/null
@@ -1,362 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!--
- * ========================LICENSE_START=================================
- * ONAP : ccsdk oran
- * ======================================================================
- * Copyright (C) 2019-2020 Nordix Foundation. All rights reserved.
- * ======================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
-  -->
-<profiles version="13">
-    <profile kind="CodeFormatterProfile" name="ONAP_GoogleStyle" version="13">
-        <setting id="org.eclipse.jdt.core.compiler.source" value="1.8" />
-        <setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8" />
-        <setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8" />
-        <setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled" />
-        <setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error" />
-        <setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error" />
-        <setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field" value="1585" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field.count_dependent" value="1585|-1|1585" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable" value="1585" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable.count_dependent" value="1585|-1|1585" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method" value="1585" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method.count_dependent" value="1585|-1|1585" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package" value="1585" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package.count_dependent" value="1585|-1|1585" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter" value="1040" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter.count_dependent" value="1040|-1|1040" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type" value="1585" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type.count_dependent" value="1585|-1|1585" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression.count_dependent" value="16|5|80" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation.count_dependent" value="16|-1|16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant.count_dependent" value="16|-1|16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call.count_dependent" value="16|5|80" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation.count_dependent" value="16|5|80" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression.count_dependent" value="16|4|80" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression.count_dependent" value="16|-1|16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_cascading_method_invocation_with_arguments.count_dependent" value="16|-1|16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="48" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants.count_dependent" value="16|5|48" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer.count_dependent" value="16|5|80" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_field_declaration" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_for_statement" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_generic_type_arguments.count_dependent" value="16|-1|16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_local_variable_declaration" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields.count_dependent" value="16|-1|16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_new_anonymous_class" value="20" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration.count_dependent" value="16|5|80" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration.count_dependent" value="16|5|80" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation.count_dependent" value="16|4|48" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration.count_dependent" value="16|4|49" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration.count_dependent" value="16|4|48" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration.count_dependent" value="16|4|48" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration.count_dependent" value="16|4|48" />
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16" />
-        <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1" />
-        <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1" />
-        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0" />
-        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0" />
-        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1" />
-        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="0" />
-        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1" />
-        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1" />
-        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="1" />
-        <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1" />
-        <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="2" />
-        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line" />
-        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line" />
-        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line" />
-        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line" />
-        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line" />
-        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line" />
-        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line" />
-        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line" />
-        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
-        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line" />
-        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line" />
-        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.comment_new_line_at_start_of_html_paragraph" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2" />
-        <setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2" />
-        <setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off" />
-        <setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on" />
-        <setting id="org.eclipse.jdt.core.formatter.force_if_else_statement_brace" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comment_prefix" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert" />
-        <setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120" />
-        <setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0" />
-        <setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="3" />
-        <setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space" />
-        <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4" />
-        <setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
-        <setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
-        <setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.wrap_comment_inline_tags" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_local_variable_annotation" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_member_annotation" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_package_annotation" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_parameter_annotation" value="false" />
-        <setting id="org.eclipse.jdt.core.formatter.wrap_non_simple_type_annotation" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true" />
-        <setting id="org.eclipse.jdt.core.formatter.wrap_prefer_two_fragments" value="false" />
-    </profile>
-</profiles>
\ No newline at end of file
diff --git a/dmaap-adaptor-java/pom.xml b/dmaap-adaptor-java/pom.xml
deleted file mode 100644 (file)
index 2c032d4..0000000
+++ /dev/null
@@ -1,364 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-* ========================LICENSE_START=================================
-* O-RAN-SC
-* %%
-* Copyright (C) 2021 Nordix Foundation
-* %%
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-* ========================LICENSE_END===================================
--->
-<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">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.springframework.boot</groupId>
-        <artifactId>spring-boot-starter-parent</artifactId>
-        <version>2.5.8</version>
-        <relativePath />
-    </parent>
-    <groupId>org.o-ran-sc.nonrtric</groupId>
-    <artifactId>dmaap-adaptor</artifactId>
-    <version>1.1.0-SNAPSHOT</version>
-    <licenses>
-        <license>
-            <name>The Apache Software License, Version 2.0</name>
-            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
-        </license>
-    </licenses>
-    <repositories>
-        <repository>
-            <id>onap-releases</id>
-            <name>onap-releases</name>
-            <url>https://nexus.onap.org/content/repositories/releases/</url>
-        </repository>
-    </repositories>
-    <properties>
-        <java.version>11</java.version>
-        <springfox.version>3.0.0</springfox.version>
-        <immutable.version>2.8.2</immutable.version>
-        <swagger.version>2.1.6</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>
-        <spotless-maven-plugin.version>1.24.3</spotless-maven-plugin.version>
-        <swagger-codegen-maven-plugin.version>3.0.11</swagger-codegen-maven-plugin.version>
-        <docker-maven-plugin>0.30.0</docker-maven-plugin>
-        <sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
-        <jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>
-        <exec.skip>true</exec.skip>
-    </properties>
-    <dependencies>
-        <dependency>
-            <groupId>org.springdoc</groupId>
-            <artifactId>springdoc-openapi-ui</artifactId>
-            <version>1.6.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-thymeleaf</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-webflux</artifactId>
-        </dependency>
-        <dependency>
-            <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>org.immutables</groupId>
-            <artifactId>value</artifactId>
-            <version>${immutable.version}</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.immutables</groupId>
-            <artifactId>gson</artifactId>
-            <version>${immutable.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.json</groupId>
-            <artifactId>json</artifactId>
-            <version>${json.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.projectlombok</groupId>
-            <artifactId>lombok</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <!-- Actuator dependencies -->
-        <dependency>
-            <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>
-            <artifactId>spring-boot-devtools</artifactId>
-            <optional>true</optional>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-configuration-processor</artifactId>
-            <optional>true</optional>
-        </dependency>
-        <!-- TEST -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.awaitility</groupId>
-            <artifactId>awaitility</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>io.projectreactor</groupId>
-            <artifactId>reactor-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.junit.jupiter</groupId>
-            <artifactId>junit-jupiter-engine</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-junit-jupiter</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.squareup.okhttp3</groupId>
-            <artifactId>mockwebserver</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>io.projectreactor.kafka</groupId>
-            <artifactId>reactor-kafka</artifactId>
-            <version>1.3.9</version>
-        </dependency>
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-            <version>31.0.1-jre</version>
-        </dependency>
-    </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>net.revelc.code.formatter</groupId>
-                <artifactId>formatter-maven-plugin</artifactId>
-                <version>${formatter-maven-plugin.version}</version>
-                <configuration>
-                    <configFile>${project.basedir}/eclipse-formatter.xml</configFile>
-                </configuration>
-                <!-- https://code.revelc.net/formatter-maven-plugin/ use mvn formatter:format
-                                       spotless:apply process-sources -->
-            </plugin>
-            <plugin>
-                <groupId>com.diffplug.spotless</groupId>
-                <artifactId>spotless-maven-plugin</artifactId>
-                <version>${spotless-maven-plugin.version}</version>
-                <configuration>
-                    <java>
-                        <removeUnusedImports />
-                        <importOrder>
-                            <order>com,java,javax,org</order>
-                        </importOrder>
-                    </java>
-                </configuration>
-                <!-- https://github.com/diffplug/spotless/tree/master/plugin-maven use
-                                       mvn spotless:apply to rewrite source files use mvn spotless:check to validate
-                                       source files -->
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <skipTests>false</skipTests>
-                </configuration>
-            </plugin>
-            <plugin>
-                <artifactId>maven-failsafe-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>add-source</id>
-                        <phase>generate-sources</phase>
-                        <goals>
-                            <goal>add-source</goal>
-                        </goals>
-                        <configuration>
-                            <sources>
-                                <source>${project.build.directory}/generated-sources/annotations/</source>
-                            </sources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.jacoco</groupId>
-                <artifactId>jacoco-maven-plugin</artifactId>
-                <version>${jacoco-maven-plugin.version}</version>
-                <executions>
-                    <execution>
-                        <id>default-prepare-agent</id>
-                        <goals>
-                            <goal>prepare-agent</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>default-report</id>
-                        <phase>prepare-package</phase>
-                        <goals>
-                            <goal>report</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>io.swagger.codegen.v3</groupId>
-                <artifactId>swagger-codegen-maven-plugin</artifactId>
-                <version>${swagger-codegen-maven-plugin.version}</version>
-                <executions>
-                    <execution>
-                        <phase>test</phase>
-                        <goals>
-                            <goal>generate</goal>
-                        </goals>
-                        <configuration>
-                            <inputSpec>${project.basedir}/api/api.json</inputSpec>
-                            <language>openapi-yaml</language>
-                            <output>${project.basedir}/api</output>
-                            <configOptions>
-                                <outputFile>api.yaml</outputFile>
-                            </configOptions>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>io.fabric8</groupId>
-                <artifactId>docker-maven-plugin</artifactId>
-                <version>${docker-maven-plugin}</version>
-                <inherited>false</inherited>
-                <executions>
-                    <execution>
-                        <id>generate-dmaap-adaptor-image</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>build</goal>
-                        </goals>
-                        <configuration>
-                            <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>
-                            <images>
-                                <image>
-                                    <name>o-ran-sc/nonrtric-dmaap-adaptor:${project.version}</name>
-                                    <build>
-                                        <cleanup>try</cleanup>
-                                        <contextDir>${basedir}</contextDir>
-                                        <dockerFile>Dockerfile</dockerFile>
-                                        <args>
-                                            <JAR>${project.build.finalName}.jar</JAR>
-                                        </args>
-                                        <tags>
-                                            <tag>${project.version}</tag>
-                                        </tags>
-                                    </build>
-                                </image>
-                            </images>
-                        </configuration>
-                    </execution>
-                    <execution>
-                        <id>push-dmaap-adaptor-image</id>
-                        <goals>
-                            <goal>build</goal>
-                            <goal>push</goal>
-                        </goals>
-                        <configuration>
-                            <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>
-                            <pushRegistry>${env.CONTAINER_PUSH_REGISTRY}</pushRegistry>
-                            <images>
-                                <image>
-                                    <name>o-ran-sc/nonrtric-dmaap-adaptor:${project.version}</name>
-                                    <build>
-                                        <contextDir>${basedir}</contextDir>
-                                        <dockerFile>Dockerfile</dockerFile>
-                                        <args>
-                                            <JAR>${project.build.finalName}.jar</JAR>
-                                        </args>
-                                        <tags>
-                                            <tag>${project.version}</tag>
-                                            <tag>latest</tag>
-                                        </tags>
-                                    </build>
-                                </image>
-                            </images>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <!-- support sonar in multi-module project -->
-            <plugin>
-                <groupId>org.sonarsource.scanner.maven</groupId>
-                <artifactId>sonar-maven-plugin</artifactId>
-                <version>${sonar-maven-plugin.version}</version>
-            </plugin>
-        </plugins>
-    </build>
-    <issueManagement>
-        <system>JIRA</system>
-        <url>https://jira.o-ran-sc.org/</url>
-    </issueManagement>
-</project>
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/Application.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/Application.java
deleted file mode 100644 (file)
index 2058202..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter;
-
-import java.io.File;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-
-@SpringBootApplication
-@EnableConfigurationProperties
-@EnableScheduling
-public class Application {
-
-    private static final Logger logger = LoggerFactory.getLogger(Application.class);
-
-    @Value("${app.configuration-filepath}")
-    private String localConfigurationFilePath;
-
-    private long configFileLastModification = 0;
-    private static ConfigurableApplicationContext applicationContext;
-
-    public static void main(String[] args) {
-        applicationContext = SpringApplication.run(Application.class);
-    }
-
-    @Scheduled(fixedRate = 10 * 1000)
-    public void checkConfigFileChanges() {
-        long timestamp = new File(localConfigurationFilePath).lastModified();
-        if (configFileLastModification != 0 && timestamp != configFileLastModification) {
-            logger.info("Restarting due to change in the file {}", localConfigurationFilePath);
-            restartApplication();
-        }
-        configFileLastModification = timestamp;
-    }
-
-    private static void restartApplication() {
-        if (applicationContext == null) {
-            logger.info("Cannot restart in unittest");
-            return;
-        }
-        ApplicationArguments args = applicationContext.getBean(ApplicationArguments.class);
-
-        Thread thread = new Thread(() -> {
-            applicationContext.close();
-            applicationContext = SpringApplication.run(Application.class, args.getSourceArgs());
-        });
-
-        thread.setDaemon(false);
-        thread.start();
-    }
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/BeanFactory.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/BeanFactory.java
deleted file mode 100644 (file)
index d98a8c3..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter;
-
-import java.util.Collection;
-
-import org.apache.catalina.connector.Connector;
-import org.oran.dmaapadapter.configuration.ApplicationConfig;
-import org.oran.dmaapadapter.repository.InfoType;
-import org.oran.dmaapadapter.repository.InfoTypes;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
-import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-@Configuration
-public class BeanFactory {
-
-    @Value("${server.http-port}")
-    private int httpPort = 0;
-
-    @Bean
-    public ApplicationConfig getApplicationConfig() {
-        return new ApplicationConfig();
-    }
-
-    @Bean
-    public InfoTypes types(@Autowired ApplicationConfig appConfig) {
-        Collection<InfoType> types = appConfig.getTypes();
-        return new InfoTypes(types);
-    }
-
-    @Bean
-    public ServletWebServerFactory servletContainer() {
-        TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
-        if (httpPort > 0) {
-            tomcat.addAdditionalTomcatConnectors(getHttpConnector(httpPort));
-        }
-        return tomcat;
-    }
-
-    private static Connector getHttpConnector(int httpPort) {
-        Connector connector = new Connector(TomcatServletWebServerFactory.DEFAULT_PROTOCOL);
-        connector.setScheme("http");
-        connector.setPort(httpPort);
-        connector.setSecure(false);
-        return connector;
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/SwaggerConfig.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/SwaggerConfig.java
deleted file mode 100644 (file)
index 6128d2e..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter;
-
-import io.swagger.v3.oas.annotations.OpenAPIDefinition;
-import io.swagger.v3.oas.annotations.info.Info;
-import io.swagger.v3.oas.annotations.info.License;
-
-/**
- * Swagger configuration class that uses swagger documentation type and scans
- * all the controllers. To access the swagger gui go to
- * http://ip:port/swagger-ui.html
- */
-@OpenAPIDefinition( //
-        info = @Info(title = SwaggerConfig.API_TITLE, //
-                version = "1.0", //
-                description = SwaggerConfig.DESCRIPTION, //
-                license = @License(name = "Copyright (C) 2021 Nordix Foundation. Licensed under the Apache License.",
-                        url = "http://www.apache.org/licenses/LICENSE-2.0")))
-public class SwaggerConfig {
-    private SwaggerConfig() {}
-
-    static final String API_TITLE = "Generic Dmaap and Kafka Information Producer";
-    static final String DESCRIPTION = "Reads data from DMaaP and Kafka and posts it further to information consumers";
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/clients/AsyncRestClient.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/clients/AsyncRestClient.java
deleted file mode 100644 (file)
index 746fdd7..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.clients;
-
-import io.netty.channel.ChannelOption;
-import io.netty.handler.ssl.SslContext;
-import io.netty.handler.timeout.ReadTimeoutHandler;
-import io.netty.handler.timeout.WriteTimeoutHandler;
-
-import java.lang.invoke.MethodHandles;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.oran.dmaapadapter.configuration.WebClientConfig.HttpProxyConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.http.client.reactive.ReactorClientHttpConnector;
-import org.springframework.lang.Nullable;
-import org.springframework.web.reactive.function.client.ExchangeStrategies;
-import org.springframework.web.reactive.function.client.WebClient;
-import org.springframework.web.reactive.function.client.WebClient.RequestHeadersSpec;
-import org.springframework.web.reactive.function.client.WebClientResponseException;
-
-import reactor.core.publisher.Mono;
-import reactor.netty.http.client.HttpClient;
-import reactor.netty.transport.ProxyProvider;
-
-/**
- * Generic reactive REST client.
- */
-@SuppressWarnings("java:S4449") // @Add Nullable to third party api
-public class AsyncRestClient {
-
-    private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-    private WebClient webClient = null;
-    private final String baseUrl;
-    private static final AtomicInteger sequenceNumber = new AtomicInteger();
-    private final SslContext sslContext;
-    private final HttpProxyConfig httpProxyConfig;
-
-    public AsyncRestClient(String baseUrl, @Nullable SslContext sslContext, @Nullable HttpProxyConfig httpProxyConfig) {
-        this.baseUrl = baseUrl;
-        this.sslContext = sslContext;
-        this.httpProxyConfig = httpProxyConfig;
-    }
-
-    public Mono<ResponseEntity<String>> postForEntity(String uri, @Nullable String body,
-            @Nullable MediaType contentType) {
-        Object traceTag = createTraceTag();
-        logger.debug("{} POST uri = '{}{}''", traceTag, baseUrl, uri);
-        logger.trace("{} POST body: {}", traceTag, body);
-        Mono<String> bodyProducer = body != null ? Mono.just(body) : Mono.empty();
-
-        RequestHeadersSpec<?> request = getWebClient() //
-                .post() //
-                .uri(uri) //
-                .contentType(contentType) //
-                .body(bodyProducer, String.class);
-        return retrieve(traceTag, request);
-    }
-
-    public Mono<String> post(String uri, @Nullable String body, @Nullable MediaType contentType) {
-        return postForEntity(uri, body, contentType) //
-                .map(this::toBody);
-    }
-
-    public Mono<String> postWithAuthHeader(String uri, String body, String username, String password,
-            @Nullable MediaType mediaType) {
-        Object traceTag = createTraceTag();
-        logger.debug("{} POST (auth) uri = '{}{}''", traceTag, baseUrl, uri);
-        logger.trace("{} POST body: {}", traceTag, body);
-
-        RequestHeadersSpec<?> request = getWebClient() //
-                .post() //
-                .uri(uri) //
-                .headers(headers -> headers.setBasicAuth(username, password)) //
-                .contentType(mediaType) //
-                .bodyValue(body);
-        return retrieve(traceTag, request) //
-                .map(this::toBody);
-    }
-
-    public Mono<ResponseEntity<String>> putForEntity(String uri, String body) {
-        Object traceTag = createTraceTag();
-        logger.debug("{} PUT uri = '{}{}''", traceTag, baseUrl, uri);
-        logger.trace("{} PUT body: {}", traceTag, body);
-
-        RequestHeadersSpec<?> request = getWebClient() //
-                .put() //
-                .uri(uri) //
-                .contentType(MediaType.APPLICATION_JSON) //
-                .bodyValue(body);
-        return retrieve(traceTag, request);
-    }
-
-    public Mono<String> put(String uri, String body) {
-        return putForEntity(uri, body) //
-                .map(this::toBody);
-    }
-
-    public Mono<ResponseEntity<String>> getForEntity(String uri) {
-        Object traceTag = createTraceTag();
-        logger.debug("{} GET uri = '{}{}''", traceTag, baseUrl, uri);
-        RequestHeadersSpec<?> request = getWebClient().get().uri(uri);
-        return retrieve(traceTag, request);
-    }
-
-    public Mono<String> get(String uri) {
-        return getForEntity(uri) //
-                .map(this::toBody);
-    }
-
-    public Mono<ResponseEntity<String>> deleteForEntity(String uri) {
-        Object traceTag = createTraceTag();
-        logger.debug("{} DELETE uri = '{}{}''", traceTag, baseUrl, uri);
-        RequestHeadersSpec<?> request = getWebClient().delete().uri(uri);
-        return retrieve(traceTag, request);
-    }
-
-    public Mono<String> delete(String uri) {
-        return deleteForEntity(uri) //
-                .map(this::toBody);
-    }
-
-    private Mono<ResponseEntity<String>> retrieve(Object traceTag, RequestHeadersSpec<?> request) {
-        final Class<String> clazz = String.class;
-        return request.retrieve() //
-                .toEntity(clazz) //
-                .doOnNext(entity -> logReceivedData(traceTag, entity)) //
-                .doOnError(throwable -> onHttpError(traceTag, throwable));
-    }
-
-    private void logReceivedData(Object traceTag, ResponseEntity<String> entity) {
-        logger.trace("{} Received: {} {}", traceTag, entity.getBody(), entity.getHeaders().getContentType());
-    }
-
-    private static Object createTraceTag() {
-        return sequenceNumber.incrementAndGet();
-    }
-
-    private void onHttpError(Object traceTag, Throwable t) {
-        if (t instanceof WebClientResponseException) {
-            WebClientResponseException exception = (WebClientResponseException) t;
-            logger.debug("{} HTTP error status = '{}', body '{}'", traceTag, exception.getStatusCode(),
-                    exception.getResponseBodyAsString());
-        } else {
-            logger.debug("{} HTTP error {}", traceTag, t.getMessage());
-        }
-    }
-
-    private String toBody(ResponseEntity<String> entity) {
-        if (entity.getBody() == null) {
-            return "";
-        } else {
-            return entity.getBody();
-        }
-    }
-
-    private boolean isHttpProxyConfigured() {
-        return httpProxyConfig != null && httpProxyConfig.httpProxyPort() > 0
-                && !httpProxyConfig.httpProxyHost().isEmpty();
-    }
-
-    private HttpClient buildHttpClient() {
-        HttpClient httpClient = HttpClient.create() //
-                .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10_000) //
-                .doOnConnected(connection -> {
-                    connection.addHandlerLast(new ReadTimeoutHandler(30));
-                    connection.addHandlerLast(new WriteTimeoutHandler(30));
-                });
-
-        if (this.sslContext != null) {
-            httpClient = httpClient.secure(ssl -> ssl.sslContext(sslContext));
-        }
-
-        if (isHttpProxyConfigured()) {
-            httpClient = httpClient.proxy(proxy -> proxy.type(ProxyProvider.Proxy.HTTP)
-                    .host(httpProxyConfig.httpProxyHost()).port(httpProxyConfig.httpProxyPort()));
-        }
-        return httpClient;
-    }
-
-    private WebClient buildWebClient(String baseUrl) {
-        final HttpClient httpClient = buildHttpClient();
-        ExchangeStrategies exchangeStrategies = ExchangeStrategies.builder() //
-                .codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(-1)) //
-                .build();
-        return WebClient.builder() //
-                .clientConnector(new ReactorClientHttpConnector(httpClient)) //
-                .baseUrl(baseUrl) //
-                .exchangeStrategies(exchangeStrategies) //
-                .build();
-    }
-
-    private WebClient getWebClient() {
-        if (this.webClient == null) {
-            this.webClient = buildWebClient(baseUrl);
-        }
-        return this.webClient;
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/clients/AsyncRestClientFactory.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/clients/AsyncRestClientFactory.java
deleted file mode 100644 (file)
index 18e5900..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.clients;
-
-import io.netty.handler.ssl.SslContext;
-import io.netty.handler.ssl.SslContextBuilder;
-import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.invoke.MethodHandles;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.net.ssl.KeyManagerFactory;
-
-import org.oran.dmaapadapter.configuration.WebClientConfig;
-import org.oran.dmaapadapter.configuration.WebClientConfig.HttpProxyConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.util.ResourceUtils;
-
-/**
- * Factory for a generic reactive REST client.
- */
-@SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally
-public class AsyncRestClientFactory {
-    private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-    private final SslContextFactory sslContextFactory;
-    private final HttpProxyConfig httpProxyConfig;
-
-    public AsyncRestClientFactory(WebClientConfig clientConfig) {
-        if (clientConfig != null) {
-            this.sslContextFactory = new CachingSslContextFactory(clientConfig);
-            this.httpProxyConfig = clientConfig.httpProxyConfig();
-        } else {
-            logger.warn("No configuration for web client defined, HTTPS will not work");
-            this.sslContextFactory = null;
-            this.httpProxyConfig = null;
-        }
-    }
-
-    public AsyncRestClient createRestClientNoHttpProxy(String baseUrl) {
-        return createRestClient(baseUrl, false);
-    }
-
-    public AsyncRestClient createRestClientUseHttpProxy(String baseUrl) {
-        return createRestClient(baseUrl, true);
-    }
-
-    private AsyncRestClient createRestClient(String baseUrl, boolean useHttpProxy) {
-        if (this.sslContextFactory != null) {
-            try {
-                return new AsyncRestClient(baseUrl, this.sslContextFactory.createSslContext(),
-                        useHttpProxy ? httpProxyConfig : null);
-            } catch (Exception e) {
-                String exceptionString = e.toString();
-                logger.error("Could not init SSL context, reason: {}", exceptionString);
-            }
-        }
-        return new AsyncRestClient(baseUrl, null, httpProxyConfig);
-    }
-
-    private class SslContextFactory {
-        private final WebClientConfig clientConfig;
-
-        public SslContextFactory(WebClientConfig clientConfig) {
-            this.clientConfig = clientConfig;
-        }
-
-        public SslContext createSslContext() throws UnrecoverableKeyException, NoSuchAlgorithmException,
-                CertificateException, KeyStoreException, IOException {
-            return this.createSslContext(createKeyManager());
-        }
-
-        private SslContext createSslContext(KeyManagerFactory keyManager)
-                throws NoSuchAlgorithmException, CertificateException, KeyStoreException, IOException {
-            if (this.clientConfig.isTrustStoreUsed()) {
-                return createSslContextRejectingUntrustedPeers(this.clientConfig.trustStore(),
-                        this.clientConfig.trustStorePassword(), keyManager);
-            } else {
-                // Trust anyone
-                return SslContextBuilder.forClient() //
-                        .keyManager(keyManager) //
-                        .trustManager(InsecureTrustManagerFactory.INSTANCE) //
-                        .build();
-            }
-        }
-
-        private SslContext createSslContextRejectingUntrustedPeers(String trustStorePath, String trustStorePass,
-                KeyManagerFactory keyManager)
-                throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException {
-
-            final KeyStore trustStore = getTrustStore(trustStorePath, trustStorePass);
-            List<Certificate> certificateList = Collections.list(trustStore.aliases()).stream() //
-                    .filter(alias -> isCertificateEntry(trustStore, alias)) //
-                    .map(alias -> getCertificate(trustStore, alias)) //
-                    .collect(Collectors.toList());
-            final X509Certificate[] certificates = certificateList.toArray(new X509Certificate[certificateList.size()]);
-
-            return SslContextBuilder.forClient() //
-                    .keyManager(keyManager) //
-                    .trustManager(certificates) //
-                    .build();
-        }
-
-        private boolean isCertificateEntry(KeyStore trustStore, String alias) {
-            try {
-                return trustStore.isCertificateEntry(alias);
-            } catch (KeyStoreException e) {
-                logger.error("Error reading truststore {}", e.getMessage());
-                return false;
-            }
-        }
-
-        private Certificate getCertificate(KeyStore trustStore, String alias) {
-            try {
-                return trustStore.getCertificate(alias);
-            } catch (KeyStoreException e) {
-                logger.error("Error reading truststore {}", e.getMessage());
-                return null;
-            }
-        }
-
-        private KeyManagerFactory createKeyManager() throws NoSuchAlgorithmException, CertificateException, IOException,
-                UnrecoverableKeyException, KeyStoreException {
-            final KeyManagerFactory keyManager = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
-            final KeyStore keyStore = KeyStore.getInstance(this.clientConfig.keyStoreType());
-            final String keyStoreFile = this.clientConfig.keyStore();
-            final String keyStorePassword = this.clientConfig.keyStorePassword();
-            final String keyPassword = this.clientConfig.keyPassword();
-            try (final InputStream inputStream = new FileInputStream(keyStoreFile)) {
-                keyStore.load(inputStream, keyStorePassword.toCharArray());
-            }
-            keyManager.init(keyStore, keyPassword.toCharArray());
-            return keyManager;
-        }
-
-        private synchronized KeyStore getTrustStore(String trustStorePath, String trustStorePass)
-                throws NoSuchAlgorithmException, CertificateException, IOException, KeyStoreException {
-
-            KeyStore store = KeyStore.getInstance(KeyStore.getDefaultType());
-            store.load(new FileInputStream(ResourceUtils.getFile(trustStorePath)), trustStorePass.toCharArray());
-            return store;
-        }
-    }
-
-    public class CachingSslContextFactory extends SslContextFactory {
-        private SslContext cachedContext = null;
-
-        public CachingSslContextFactory(WebClientConfig clientConfig) {
-            super(clientConfig);
-        }
-
-        @Override
-        public SslContext createSslContext() throws UnrecoverableKeyException, NoSuchAlgorithmException,
-                CertificateException, KeyStoreException, IOException {
-            if (this.cachedContext == null) {
-                this.cachedContext = super.createSslContext();
-            }
-            return this.cachedContext;
-
-        }
-    }
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/configuration/ApplicationConfig.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/configuration/ApplicationConfig.java
deleted file mode 100644 (file)
index 3ea64e7..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.configuration;
-
-import java.lang.invoke.MethodHandles;
-import java.nio.charset.Charset;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.Collection;
-import java.util.Collections;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import org.oran.dmaapadapter.configuration.WebClientConfig.HttpProxyConfig;
-import org.oran.dmaapadapter.repository.InfoType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-
-@EnableConfigurationProperties
-public class ApplicationConfig {
-
-    private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-    @Getter
-    @Value("${app.configuration-filepath}")
-    private String localConfigurationFilePath;
-
-    @Value("${server.ssl.key-store-type}")
-    private String sslKeyStoreType = "";
-
-    @Value("${server.ssl.key-store-password}")
-    private String sslKeyStorePassword = "";
-
-    @Value("${server.ssl.key-store}")
-    private String sslKeyStore = "";
-
-    @Value("${server.ssl.key-password}")
-    private String sslKeyPassword = "";
-
-    @Value("${app.webclient.trust-store-used}")
-    private boolean sslTrustStoreUsed = false;
-
-    @Value("${app.webclient.trust-store-password}")
-    private String sslTrustStorePassword = "";
-
-    @Value("${app.webclient.trust-store}")
-    private String sslTrustStore = "";
-
-    @Value("${app.webclient.http.proxy-host:\"\"}")
-    private String httpProxyHost = "";
-
-    @Value("${app.webclient.http.proxy-port:0}")
-    private int httpProxyPort = 0;
-
-    @Getter
-    @Setter
-    @Value("${server.port}")
-    private int localServerHttpPort;
-
-    @Getter
-    @Value("${app.ics-base-url}")
-    private String icsBaseUrl;
-
-    @Getter
-    @Value("${app.dmaap-adapter-base-url}")
-    private String selfUrl;
-
-    @Getter
-    @Value("${app.dmaap-base-url}")
-    private String dmaapBaseUrl;
-
-    @Getter
-    @Value("${app.kafka.bootstrap-servers:}")
-    private String kafkaBootStrapServers;
-
-    private WebClientConfig webClientConfig = null;
-
-    public WebClientConfig getWebClientConfig() {
-        if (this.webClientConfig == null) {
-            HttpProxyConfig httpProxyConfig = ImmutableHttpProxyConfig.builder() //
-                    .httpProxyHost(this.httpProxyHost) //
-                    .httpProxyPort(this.httpProxyPort) //
-                    .build();
-
-            this.webClientConfig = ImmutableWebClientConfig.builder() //
-                    .keyStoreType(this.sslKeyStoreType) //
-                    .keyStorePassword(this.sslKeyStorePassword) //
-                    .keyStore(this.sslKeyStore) //
-                    .keyPassword(this.sslKeyPassword) //
-                    .isTrustStoreUsed(this.sslTrustStoreUsed) //
-                    .trustStore(this.sslTrustStore) //
-                    .trustStorePassword(this.sslTrustStorePassword) //
-                    .httpProxyConfig(httpProxyConfig) //
-                    .build();
-        }
-        return this.webClientConfig;
-    }
-
-    // Adapter to parse the json format of the configuration file.
-    static class ConfigFile {
-        Collection<InfoType> types;
-    }
-
-    public Collection<InfoType> getTypes() {
-        com.google.gson.Gson gson = new com.google.gson.GsonBuilder().create();
-
-        try {
-            String configJson = Files.readString(Path.of(getLocalConfigurationFilePath()), Charset.defaultCharset());
-            ConfigFile configData = gson.fromJson(configJson, ConfigFile.class);
-            return configData.types;
-        } catch (Exception e) {
-            logger.error("Could not load configuration file {}", getLocalConfigurationFilePath());
-            return Collections.emptyList();
-        }
-
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/configuration/WebClientConfig.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/configuration/WebClientConfig.java
deleted file mode 100644 (file)
index e65fdb9..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.configuration;
-
-import org.immutables.value.Value;
-
-@Value.Immutable
-@Value.Style(redactedMask = "####")
-public interface WebClientConfig {
-    public String keyStoreType();
-
-    @Value.Redacted
-    public String keyStorePassword();
-
-    public String keyStore();
-
-    @Value.Redacted
-    public String keyPassword();
-
-    public boolean isTrustStoreUsed();
-
-    @Value.Redacted
-    public String trustStorePassword();
-
-    public String trustStore();
-
-    @Value.Immutable
-    public interface HttpProxyConfig {
-        public String httpProxyHost();
-
-        public int httpProxyPort();
-    }
-
-    public HttpProxyConfig httpProxyConfig();
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/controllers/ErrorResponse.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/controllers/ErrorResponse.java
deleted file mode 100644 (file)
index 39f62fb..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.controllers;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.annotations.SerializedName;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-
-import org.oran.dmaapadapter.exceptions.ServiceException;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import reactor.core.publisher.Mono;
-
-public class ErrorResponse {
-    private static Gson gson = new GsonBuilder() //
-            .create(); //
-
-    // Returned as body for all failed REST calls
-    @Schema(name = "error_information", description = "Problem as defined in https://tools.ietf.org/html/rfc7807")
-    public static class ErrorInfo {
-        @SerializedName("type")
-        private String type = "about:blank";
-
-        @SerializedName("title")
-        private String title = null;
-
-        @SerializedName("status")
-        private final Integer status;
-
-        @SerializedName("detail")
-        private String detail = null;
-
-        @SerializedName("instance")
-        private String instance = null;
-
-        public ErrorInfo(String detail, Integer status) {
-            this.detail = detail;
-            this.status = status;
-        }
-
-        @Schema(example = "503",
-                description = "The HTTP status code generated by the origin server for this occurrence of the problem. ")
-        public Integer getStatus() {
-            return status;
-        }
-
-        @Schema(example = "Policy type not found",
-                description = " A human-readable explanation specific to this occurrence of the problem.")
-        public String getDetail() {
-            return this.detail;
-        }
-
-    }
-
-    @Schema(name = "message", description = "message")
-    public final String message;
-
-    ErrorResponse(String message) {
-        this.message = message;
-    }
-
-    static Mono<ResponseEntity<Object>> createMono(String text, HttpStatus code) {
-        return Mono.just(create(text, code));
-    }
-
-    static Mono<ResponseEntity<Object>> createMono(Exception e, HttpStatus code) {
-        return createMono(e.toString(), code);
-    }
-
-    public static ResponseEntity<Object> create(String text, HttpStatus code) {
-        ErrorInfo p = new ErrorInfo(text, code.value());
-        String json = gson.toJson(p);
-        HttpHeaders headers = new HttpHeaders();
-        headers.setContentType(MediaType.APPLICATION_PROBLEM_JSON);
-        return new ResponseEntity<>(json, headers, code);
-    }
-
-    public static ResponseEntity<Object> create(Throwable e, HttpStatus code) {
-        if (e instanceof RuntimeException) {
-            code = HttpStatus.INTERNAL_SERVER_ERROR;
-        } else if (e instanceof ServiceException) {
-            ServiceException se = (ServiceException) e;
-            if (se.getHttpStatus() != null) {
-                code = se.getHttpStatus();
-            }
-        }
-        return create(e.toString(), code);
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/controllers/ProducerCallbacksController.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/controllers/ProducerCallbacksController.java
deleted file mode 100644 (file)
index 94f9f8d..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.controllers;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.media.ArraySchema;
-import io.swagger.v3.oas.annotations.media.Content;
-import io.swagger.v3.oas.annotations.media.Schema;
-import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
-import io.swagger.v3.oas.annotations.tags.Tag;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.oran.dmaapadapter.exceptions.ServiceException;
-import org.oran.dmaapadapter.r1.ProducerJobInfo;
-import org.oran.dmaapadapter.repository.InfoTypes;
-import org.oran.dmaapadapter.repository.Job;
-import org.oran.dmaapadapter.repository.Jobs;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController("ConfigurationControllerV2")
-@Tag(name = ProducerCallbacksController.API_NAME)
-public class ProducerCallbacksController {
-    private static final Logger logger = LoggerFactory.getLogger(ProducerCallbacksController.class);
-
-    public static final String API_NAME = "Producer job control API";
-    public static final String API_DESCRIPTION = "";
-    public static final String JOB_URL = "/generic_dataproducer/info_job";
-    public static final String SUPERVISION_URL = "/generic_dataproducer/health_check";
-    private static Gson gson = new GsonBuilder().create();
-    private final Jobs jobs;
-    private final InfoTypes types;
-
-    public ProducerCallbacksController(@Autowired Jobs jobs, @Autowired InfoTypes types) {
-        this.jobs = jobs;
-        this.types = types;
-    }
-
-    @PostMapping(path = JOB_URL, produces = MediaType.APPLICATION_JSON_VALUE)
-    @Operation(summary = "Callback for Information Job creation/modification",
-            description = "The call is invoked to activate or to modify a data subscription. The endpoint is provided by the Information Producer.")
-    @ApiResponses(value = { //
-            @ApiResponse(responseCode = "200", description = "OK", //
-                    content = @Content(schema = @Schema(implementation = VoidResponse.class))), //
-            @ApiResponse(responseCode = "404", description = "Information type is not found", //
-                    content = @Content(schema = @Schema(implementation = ErrorResponse.ErrorInfo.class))), //
-            @ApiResponse(responseCode = "400", description = "Other error in the request", //
-                    content = @Content(schema = @Schema(implementation = ErrorResponse.ErrorInfo.class))) //
-    })
-    public ResponseEntity<Object> jobCreatedCallback( //
-            @RequestBody String body) {
-        try {
-            ProducerJobInfo request = gson.fromJson(body, ProducerJobInfo.class);
-            logger.debug("Job started callback {}", request.id);
-            this.jobs.addJob(request.id, request.targetUri, types.getType(request.typeId), request.owner,
-                    request.lastUpdated, toJobParameters(request.jobData));
-            return new ResponseEntity<>(HttpStatus.OK);
-        } catch (ServiceException e) {
-            logger.warn("jobCreatedCallback failed: {}", e.getMessage());
-            return ErrorResponse.create(e, e.getHttpStatus());
-        } catch (Exception e) {
-            logger.warn("jobCreatedCallback failed: {}", e.getMessage());
-            return ErrorResponse.create(e, HttpStatus.BAD_REQUEST);
-        }
-    }
-
-    private Job.Parameters toJobParameters(Object jobData) {
-        String json = gson.toJson(jobData);
-        return gson.fromJson(json, Job.Parameters.class);
-    }
-
-    @GetMapping(path = JOB_URL, produces = MediaType.APPLICATION_JSON_VALUE)
-    @Operation(summary = "Get all jobs", description = "Returns all info jobs, can be used for trouble shooting")
-    @ApiResponse(responseCode = "200", //
-            description = "Information jobs", //
-            content = @Content(array = @ArraySchema(schema = @Schema(implementation = ProducerJobInfo.class)))) //
-    public ResponseEntity<Object> getJobs() {
-
-        Collection<ProducerJobInfo> producerJobs = new ArrayList<>();
-        for (Job j : this.jobs.getAll()) {
-            producerJobs.add(new ProducerJobInfo(null, j.getId(), j.getType().getId(), j.getCallbackUrl(), j.getOwner(),
-                    j.getLastUpdated()));
-        }
-        return new ResponseEntity<>(gson.toJson(producerJobs), HttpStatus.OK);
-    }
-
-    @DeleteMapping(path = JOB_URL + "/{infoJobId}", produces = MediaType.APPLICATION_JSON_VALUE)
-    @Operation(summary = "Callback for Information Job deletion",
-            description = "The call is invoked to terminate a data subscription. The endpoint is provided by the Information Producer.")
-    @ApiResponses(value = { //
-            @ApiResponse(responseCode = "200", description = "OK", //
-                    content = @Content(schema = @Schema(implementation = VoidResponse.class))) //
-    })
-    public ResponseEntity<Object> jobDeletedCallback( //
-            @PathVariable("infoJobId") String infoJobId) {
-
-        logger.debug("Job deleted callback {}", infoJobId);
-        this.jobs.remove(infoJobId);
-        return new ResponseEntity<>(HttpStatus.OK);
-    }
-
-    @GetMapping(path = SUPERVISION_URL, produces = MediaType.APPLICATION_JSON_VALUE)
-    @Operation(summary = "Producer supervision",
-            description = "The endpoint is provided by the Information Producer and is used for supervision of the producer.")
-    @ApiResponses(value = { //
-            @ApiResponse(responseCode = "200", description = "The producer is OK", //
-                    content = @Content(schema = @Schema(implementation = String.class))) //
-    })
-    public ResponseEntity<Object> producerSupervision() {
-        logger.debug("Producer supervision");
-        return new ResponseEntity<>(HttpStatus.OK);
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/controllers/VoidResponse.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/controllers/VoidResponse.java
deleted file mode 100644 (file)
index b7bba5f..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.controllers;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-
-import org.immutables.gson.Gson;
-
-@Gson.TypeAdapters
-@Schema(name = "void", description = "Void/empty")
-public class VoidResponse {
-    private VoidResponse() {}
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/exceptions/ServiceException.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/exceptions/ServiceException.java
deleted file mode 100644 (file)
index b30e28e..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.exceptions;
-
-import lombok.Getter;
-
-import org.springframework.http.HttpStatus;
-
-public class ServiceException extends Exception {
-
-    private static final long serialVersionUID = 1L;
-
-    @Getter
-    private final HttpStatus httpStatus;
-
-    public ServiceException(String message, HttpStatus httpStatus) {
-        super(message);
-        this.httpStatus = httpStatus;
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/r1/ConsumerJobInfo.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/r1/ConsumerJobInfo.java
deleted file mode 100644 (file)
index c1737db..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.r1;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.google.gson.annotations.SerializedName;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-
-import org.immutables.gson.Gson;
-
-@Gson.TypeAdapters
-@Schema(name = "consumer_job", description = "Information for an Information Job")
-public class ConsumerJobInfo {
-
-    @Schema(name = "info_type_id", description = "Information type Idenitifier of the subscription job",
-            required = true)
-    @SerializedName("info_type_id")
-    @JsonProperty(value = "info_type_id", required = true)
-    public String infoTypeId = "";
-
-    @Schema(name = "job_owner", description = "Identity of the owner of the job", required = true)
-    @SerializedName("job_owner")
-    @JsonProperty(value = "job_owner", required = true)
-    public String owner = "";
-
-    @Schema(name = "job_definition", description = "Information type specific job data", required = true)
-    @SerializedName("job_definition")
-    @JsonProperty(value = "job_definition", required = true)
-    public Object jobDefinition;
-
-    @Schema(name = "job_result_uri", description = "The target URI of the subscribed information", required = true)
-    @SerializedName("job_result_uri")
-    @JsonProperty(value = "job_result_uri", required = true)
-    public String jobResultUri = "";
-
-    @Schema(name = "status_notification_uri",
-            description = "The target of Information subscription job status notifications", required = false)
-    @SerializedName("status_notification_uri")
-    @JsonProperty(value = "status_notification_uri", required = false)
-    public String statusNotificationUri = "";
-
-    public ConsumerJobInfo() {}
-
-    public ConsumerJobInfo(String infoTypeId, Object jobData, String owner, String targetUri,
-            String statusNotificationUri) {
-        this.infoTypeId = infoTypeId;
-        this.jobDefinition = jobData;
-        this.owner = owner;
-        this.jobResultUri = targetUri;
-        this.statusNotificationUri = statusNotificationUri;
-    }
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/r1/ProducerInfoTypeInfo.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/r1/ProducerInfoTypeInfo.java
deleted file mode 100644 (file)
index 1bf5e47..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.r1;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.google.gson.annotations.SerializedName;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-
-import org.immutables.gson.Gson;
-
-@Gson.TypeAdapters
-@Schema(name = "producer_info_type_info", description = "Information for an Information Type")
-public class ProducerInfoTypeInfo {
-
-    @Schema(name = "info_job_data_schema", description = "Json schema for the job data", required = true)
-    @SerializedName("info_job_data_schema")
-    @JsonProperty(value = "info_job_data_schema", required = true)
-    public 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.typeSpecificInformation = typeSpecificInformation;
-    }
-
-    public ProducerInfoTypeInfo() {}
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/r1/ProducerJobInfo.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/r1/ProducerJobInfo.java
deleted file mode 100644 (file)
index d378825..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.r1;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.google.gson.annotations.SerializedName;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-
-import org.immutables.gson.Gson;
-
-@Gson.TypeAdapters
-@Schema(name = "producer_info_job_request",
-        description = "The body of the Information Producer callbacks for Information Job creation and deletion")
-public class ProducerJobInfo {
-
-    @Schema(name = "info_job_identity", description = "Identity of the Information Job", required = true)
-    @SerializedName("info_job_identity")
-    @JsonProperty("info_job_identity")
-    public String id = "";
-
-    @Schema(name = "info_type_identity", description = "Type identity for the job")
-    @SerializedName("info_type_identity")
-    @JsonProperty("info_type_identity")
-    public String typeId = "";
-
-    @Schema(name = "info_job_data", description = "Json for the job data")
-    @SerializedName("info_job_data")
-    @JsonProperty("info_job_data")
-    public Object jobData;
-
-    @Schema(name = "target_uri", description = "URI for the target of the produced Information")
-    @SerializedName("target_uri")
-    @JsonProperty("target_uri")
-    public String targetUri = "";
-
-    @Schema(name = "owner", description = "The owner of the job")
-    @SerializedName("owner")
-    @JsonProperty("owner")
-    public String owner = "";
-
-    @Schema(name = "last_updated", description = "The time when the job was last updated or created (ISO-8601)")
-    @SerializedName("last_updated")
-    @JsonProperty("last_updated")
-    public String lastUpdated = "";
-
-    public ProducerJobInfo(Object jobData, String id, String typeId, String targetUri, String owner,
-            String lastUpdated) {
-        this.id = id;
-        this.jobData = jobData;
-        this.typeId = typeId;
-        this.targetUri = targetUri;
-        this.owner = owner;
-        this.lastUpdated = lastUpdated;
-    }
-
-    public ProducerJobInfo() {}
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/r1/ProducerRegistrationInfo.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/r1/ProducerRegistrationInfo.java
deleted file mode 100644 (file)
index e54c152..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.r1;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.google.gson.annotations.SerializedName;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-
-import java.util.Collection;
-
-import lombok.Builder;
-
-import org.immutables.gson.Gson;
-
-@Builder
-@Gson.TypeAdapters
-@Schema(name = "producer_registration_info", description = "Information for an Information Producer")
-public class ProducerRegistrationInfo {
-
-    @Schema(name = "supported_info_types", description = "Supported Information Type IDs", required = true)
-    @SerializedName("supported_info_types")
-    @JsonProperty(value = "supported_info_types", required = true)
-    public Collection<String> supportedTypeIds;
-
-    @Schema(name = "info_job_callback_url", description = "callback for Information Job", required = true)
-    @SerializedName("info_job_callback_url")
-    @JsonProperty(value = "info_job_callback_url", required = true)
-    public String jobCallbackUrl;
-
-    @Schema(name = "info_producer_supervision_callback_url", description = "callback for producer supervision",
-            required = true)
-    @SerializedName("info_producer_supervision_callback_url")
-    @JsonProperty(value = "info_producer_supervision_callback_url", required = true)
-    public String producerSupervisionCallbackUrl;
-
-    public ProducerRegistrationInfo(Collection<String> types, String jobCallbackUrl,
-            String producerSupervisionCallbackUrl) {
-        this.supportedTypeIds = types;
-        this.jobCallbackUrl = jobCallbackUrl;
-        this.producerSupervisionCallbackUrl = producerSupervisionCallbackUrl;
-    }
-
-    public ProducerRegistrationInfo() {}
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/InfoType.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/InfoType.java
deleted file mode 100644 (file)
index 27b527d..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.repository;
-
-import lombok.Getter;
-
-import org.springframework.util.StringUtils;
-
-public class InfoType {
-
-    @Getter
-    private final String id;
-
-    @Getter
-    private final String dmaapTopicUrl;
-
-    @Getter
-    private final boolean useHttpProxy;
-
-    @Getter
-    private final String kafkaInputTopic;
-
-    public InfoType(String id, String dmaapTopicUrl, boolean useHttpProxy, String kafkaInputTopic) {
-        this.id = id;
-        this.dmaapTopicUrl = dmaapTopicUrl;
-        this.useHttpProxy = useHttpProxy;
-        this.kafkaInputTopic = kafkaInputTopic;
-    }
-
-    public boolean isKafkaTopicDefined() {
-        return StringUtils.hasLength(kafkaInputTopic);
-    }
-
-    public boolean isDmaapTopicDefined() {
-        return StringUtils.hasLength(dmaapTopicUrl);
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/InfoTypes.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/InfoTypes.java
deleted file mode 100644 (file)
index baa998b..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.repository;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-
-import org.oran.dmaapadapter.exceptions.ServiceException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.HttpStatus;
-
-public class InfoTypes {
-    private static final Logger logger = LoggerFactory.getLogger(InfoTypes.class);
-
-    private Map<String, InfoType> allTypes = new HashMap<>();
-
-    public InfoTypes(Collection<InfoType> types) {
-        for (InfoType type : types) {
-            put(type);
-        }
-    }
-
-    public synchronized InfoType get(String id) {
-        return allTypes.get(id);
-    }
-
-    public synchronized InfoType getType(String id) throws ServiceException {
-        InfoType type = allTypes.get(id);
-        if (type == null) {
-            throw new ServiceException("Could not find type: " + id, HttpStatus.NOT_FOUND);
-        }
-        return type;
-    }
-
-    public static class ConfigFile {
-        Collection<InfoType> types;
-    }
-
-    private synchronized void put(InfoType type) {
-        logger.debug("Put type: {}", type.getId());
-        allTypes.put(type.getId(), type);
-    }
-
-    public synchronized Iterable<InfoType> getAll() {
-        return new Vector<>(allTypes.values());
-    }
-
-    public synchronized Collection<String> typeIds() {
-        return allTypes.keySet();
-    }
-
-    public synchronized int size() {
-        return allTypes.size();
-    }
-
-    public synchronized void clear() {
-        allTypes.clear();
-    }
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/Job.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/Job.java
deleted file mode 100644 (file)
index 5f7521c..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.repository;
-
-import java.time.Duration;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import lombok.Getter;
-
-import org.immutables.gson.Gson;
-import org.oran.dmaapadapter.clients.AsyncRestClient;
-
-public class Job {
-
-    @Gson.TypeAdapters
-    public static class Parameters {
-        @Getter
-        private String filter;
-        @Getter
-        private BufferTimeout bufferTimeout;
-
-        private int maxConcurrency;
-
-        public Parameters() {}
-
-        public Parameters(String filter, BufferTimeout bufferTimeout, int maxConcurrency) {
-            this.filter = filter;
-            this.bufferTimeout = bufferTimeout;
-            this.maxConcurrency = maxConcurrency;
-        }
-
-        public int getMaxConcurrency() {
-            return maxConcurrency == 0 ? 1 : maxConcurrency;
-        }
-    }
-
-    @Gson.TypeAdapters
-    public static class BufferTimeout {
-        public BufferTimeout(int maxSize, long maxTimeMiliseconds) {
-            this.maxSize = maxSize;
-            this.maxTimeMiliseconds = maxTimeMiliseconds;
-        }
-
-        public BufferTimeout() {}
-
-        @Getter
-        private int maxSize;
-
-        private long maxTimeMiliseconds;
-
-        public Duration getMaxTime() {
-            return Duration.ofMillis(maxTimeMiliseconds);
-        }
-    }
-
-    @Getter
-    private final String id;
-
-    @Getter
-    private final String callbackUrl;
-
-    @Getter
-    private final InfoType type;
-
-    @Getter
-    private final String owner;
-
-    @Getter
-    private final Parameters parameters;
-
-    @Getter
-    private final String lastUpdated;
-
-    private final Pattern jobDataFilter;
-
-    @Getter
-    private final AsyncRestClient consumerRestClient;
-
-    public Job(String id, String callbackUrl, InfoType type, String owner, String lastUpdated, Parameters parameters,
-            AsyncRestClient consumerRestClient) {
-        this.id = id;
-        this.callbackUrl = callbackUrl;
-        this.type = type;
-        this.owner = owner;
-        this.lastUpdated = lastUpdated;
-        this.parameters = parameters;
-        if (parameters != null && parameters.filter != null) {
-            jobDataFilter = Pattern.compile(parameters.filter);
-        } else {
-            jobDataFilter = null;
-        }
-        this.consumerRestClient = consumerRestClient;
-    }
-
-    public boolean isFilterMatch(String data) {
-        if (jobDataFilter == null) {
-            return true;
-        }
-        Matcher matcher = jobDataFilter.matcher(data);
-        return matcher.find();
-    }
-
-    public boolean isBuffered() {
-        return parameters != null && parameters.bufferTimeout != null && parameters.bufferTimeout.maxSize > 0
-                && parameters.bufferTimeout.maxTimeMiliseconds > 0;
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/Jobs.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/Jobs.java
deleted file mode 100644 (file)
index ec33774..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.repository;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.oran.dmaapadapter.clients.AsyncRestClient;
-import org.oran.dmaapadapter.clients.AsyncRestClientFactory;
-import org.oran.dmaapadapter.configuration.ApplicationConfig;
-import org.oran.dmaapadapter.exceptions.ServiceException;
-import org.oran.dmaapadapter.repository.Job.Parameters;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.stereotype.Component;
-
-@Component
-public class Jobs {
-    public interface Observer {
-        void onJobbAdded(Job job);
-
-        void onJobRemoved(Job job);
-    }
-
-    private static final Logger logger = LoggerFactory.getLogger(Jobs.class);
-
-    private Map<String, Job> allJobs = new HashMap<>();
-    private MultiMap<Job> jobsByType = new MultiMap<>();
-    private final AsyncRestClientFactory restclientFactory;
-    private final List<Observer> observers = new ArrayList<>();
-
-    public Jobs(@Autowired ApplicationConfig applicationConfig) {
-        restclientFactory = new AsyncRestClientFactory(applicationConfig.getWebClientConfig());
-    }
-
-    public synchronized Job getJob(String id) throws ServiceException {
-        Job job = allJobs.get(id);
-        if (job == null) {
-            throw new ServiceException("Could not find job: " + id, HttpStatus.NOT_FOUND);
-        }
-        return job;
-    }
-
-    public synchronized Job get(String id) {
-        return allJobs.get(id);
-    }
-
-    public void addJob(String id, String callbackUrl, InfoType type, String owner, String lastUpdated,
-            Parameters parameters) {
-        AsyncRestClient consumerRestClient = type.isUseHttpProxy() //
-                ? restclientFactory.createRestClientUseHttpProxy(callbackUrl) //
-                : restclientFactory.createRestClientNoHttpProxy(callbackUrl);
-        Job job = new Job(id, callbackUrl, type, owner, lastUpdated, parameters, consumerRestClient);
-        this.put(job);
-        synchronized (observers) {
-            this.observers.forEach(obs -> obs.onJobbAdded(job));
-        }
-    }
-
-    public void addObserver(Observer obs) {
-        synchronized (observers) {
-            this.observers.add(obs);
-        }
-    }
-
-    private synchronized void put(Job job) {
-        logger.debug("Put job: {}", job.getId());
-        allJobs.put(job.getId(), job);
-        jobsByType.put(job.getType().getId(), job.getId(), job);
-    }
-
-    public synchronized Iterable<Job> getAll() {
-        return new Vector<>(allJobs.values());
-    }
-
-    public synchronized Job remove(String id) {
-        Job job = allJobs.get(id);
-        if (job != null) {
-            remove(job);
-        }
-        return job;
-    }
-
-    public void remove(Job job) {
-        synchronized (this) {
-            this.allJobs.remove(job.getId());
-            jobsByType.remove(job.getType().getId(), job.getId());
-        }
-        synchronized (observers) {
-            this.observers.forEach(obs -> obs.onJobRemoved(job));
-        }
-    }
-
-    public synchronized int size() {
-        return allJobs.size();
-    }
-
-    public synchronized Collection<Job> getJobsForType(InfoType type) {
-        return jobsByType.get(type.getId());
-    }
-
-    public synchronized void clear() {
-        allJobs.clear();
-        jobsByType.clear();
-    }
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/MultiMap.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/repository/MultiMap.java
deleted file mode 100644 (file)
index f7cc14e..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2019-2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.repository;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
-/**
- * A map, where each key can be bound to may values (where each value has an own
- * ID)
- */
-public class MultiMap<T> {
-
-    private final Map<String, Map<String, T>> map = new HashMap<>();
-
-    public void put(String key, String id, T value) {
-        this.map.computeIfAbsent(key, k -> new HashMap<>()).put(id, value);
-    }
-
-    public T remove(String key, String id) {
-        Map<String, T> innerMap = this.map.get(key);
-        if (innerMap != null) {
-            T removedElement = innerMap.remove(id);
-            if (innerMap.isEmpty()) {
-                this.map.remove(key);
-            }
-            return removedElement;
-        }
-        return null;
-    }
-
-    public T get(String key1, String key2) {
-        Map<String, T> innerMap = this.map.get(key1);
-        if (innerMap == null) {
-            return null;
-        }
-        return innerMap.get(key2);
-    }
-
-    public Collection<T> get(String key) {
-        Map<String, T> innerMap = this.map.get(key);
-        if (innerMap == null) {
-            return Collections.emptyList();
-        }
-        return new Vector<>(innerMap.values());
-    }
-
-    public Set<String> keySet() {
-        return this.map.keySet();
-    }
-
-    public void clear() {
-        this.map.clear();
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/DmaapTopicConsumer.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/DmaapTopicConsumer.java
deleted file mode 100644 (file)
index fe7ec8b..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.tasks;
-
-import java.time.Duration;
-
-import org.oran.dmaapadapter.clients.AsyncRestClient;
-import org.oran.dmaapadapter.clients.AsyncRestClientFactory;
-import org.oran.dmaapadapter.configuration.ApplicationConfig;
-import org.oran.dmaapadapter.repository.InfoType;
-import org.oran.dmaapadapter.repository.Jobs;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.MediaType;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-/**
- * The class fetches incoming requests from DMAAP and sends them further to the
- * consumers that has a job for this InformationType.
- */
-public class DmaapTopicConsumer {
-    private static final Duration TIME_BETWEEN_DMAAP_RETRIES = Duration.ofSeconds(10);
-    private static final Logger logger = LoggerFactory.getLogger(DmaapTopicConsumer.class);
-
-    private final AsyncRestClient dmaapRestClient;
-    protected final ApplicationConfig applicationConfig;
-    protected final InfoType type;
-    protected final Jobs jobs;
-
-    public DmaapTopicConsumer(ApplicationConfig applicationConfig, InfoType type, Jobs jobs) {
-        AsyncRestClientFactory restclientFactory = new AsyncRestClientFactory(applicationConfig.getWebClientConfig());
-        this.dmaapRestClient = restclientFactory.createRestClientNoHttpProxy("");
-        this.applicationConfig = applicationConfig;
-        this.type = type;
-        this.jobs = jobs;
-    }
-
-    public void start() {
-        Flux.range(0, Integer.MAX_VALUE) //
-                .flatMap(notUsed -> getFromMessageRouter(getDmaapUrl()), 1) //
-                .flatMap(this::pushDataToConsumers) //
-                .subscribe(//
-                        null, //
-                        throwable -> logger.error("DmaapMessageConsumer error: {}", throwable.getMessage()), //
-                        this::onComplete); //
-    }
-
-    private void onComplete() {
-        logger.warn("DmaapMessageConsumer completed {}", type.getId());
-        start();
-    }
-
-    private String getDmaapUrl() {
-        return this.applicationConfig.getDmaapBaseUrl() + type.getDmaapTopicUrl();
-    }
-
-    private Mono<String> handleDmaapErrorResponse(Throwable t) {
-        logger.debug("error from DMAAP {} {}", t.getMessage(), type.getDmaapTopicUrl());
-        return Mono.delay(TIME_BETWEEN_DMAAP_RETRIES) //
-                .flatMap(notUsed -> Mono.empty());
-    }
-
-    private Mono<String> getFromMessageRouter(String topicUrl) {
-        logger.trace("getFromMessageRouter {}", topicUrl);
-        return dmaapRestClient.get(topicUrl) //
-                .filter(body -> body.length() > 3) // DMAAP will return "[]" sometimes. That is thrown away.
-                .doOnNext(message -> logger.debug("Message from DMAAP topic: {} : {}", topicUrl, message)) //
-                .onErrorResume(this::handleDmaapErrorResponse); //
-    }
-
-    private Mono<String> handleConsumerErrorResponse(Throwable t) {
-        logger.warn("error from CONSUMER {}", t.getMessage());
-        return Mono.empty();
-    }
-
-    protected Flux<String> pushDataToConsumers(String body) {
-        logger.debug("Received data {}", body);
-        final int CONCURRENCY = 50;
-
-        // Distibute the body to all jobs for this type
-        return Flux.fromIterable(this.jobs.getJobsForType(this.type)) //
-                .filter(job -> job.isFilterMatch(body)) //
-                .doOnNext(job -> logger.debug("Sending to consumer {}", job.getCallbackUrl())) //
-                .flatMap(job -> job.getConsumerRestClient().post("", body, MediaType.APPLICATION_JSON), CONCURRENCY) //
-                .onErrorResume(this::handleConsumerErrorResponse);
-    }
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/DmaapTopicConsumers.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/DmaapTopicConsumers.java
deleted file mode 100644 (file)
index 9447c3a..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.tasks;
-
-import org.oran.dmaapadapter.configuration.ApplicationConfig;
-import org.oran.dmaapadapter.repository.InfoType;
-import org.oran.dmaapadapter.repository.InfoTypes;
-import org.oran.dmaapadapter.repository.Jobs;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-@Component
-public class DmaapTopicConsumers {
-
-    DmaapTopicConsumers(@Autowired ApplicationConfig appConfig, @Autowired InfoTypes types, @Autowired Jobs jobs) {
-        // Start a consumer for each type
-        for (InfoType type : types.getAll()) {
-            if (type.isDmaapTopicDefined()) {
-                DmaapTopicConsumer topicConsumer = new DmaapTopicConsumer(appConfig, type, jobs);
-                topicConsumer.start();
-            }
-        }
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/KafkaJobDataConsumer.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/KafkaJobDataConsumer.java
deleted file mode 100644 (file)
index 2a16f47..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.tasks;
-
-import lombok.Getter;
-
-import org.oran.dmaapadapter.repository.Job;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.MediaType;
-import org.springframework.web.reactive.function.client.WebClientResponseException;
-
-import reactor.core.Disposable;
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-/**
- * The class streams data from a multi cast sink and sends the data to the Job
- * owner via REST calls.
- */
-@SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally
-public class KafkaJobDataConsumer {
-    private static final Logger logger = LoggerFactory.getLogger(KafkaJobDataConsumer.class);
-    @Getter
-    private final Job job;
-    private Disposable subscription;
-    private final ErrorStats errorStats = new ErrorStats();
-
-    private class ErrorStats {
-        private int consumerFaultCounter = 0;
-        private boolean kafkaError = false; // eg. overflow
-
-        public void handleOkFromConsumer() {
-            this.consumerFaultCounter = 0;
-        }
-
-        public void handleException(Throwable t) {
-            if (t instanceof WebClientResponseException) {
-                ++this.consumerFaultCounter;
-            } else {
-                kafkaError = true;
-            }
-        }
-
-        public boolean isItHopeless() {
-            final int STOP_AFTER_ERRORS = 5;
-            return kafkaError || consumerFaultCounter > STOP_AFTER_ERRORS;
-        }
-
-        public void resetKafkaErrors() {
-            kafkaError = false;
-        }
-    }
-
-    public KafkaJobDataConsumer(Job job) {
-        this.job = job;
-    }
-
-    public synchronized void start(Flux<String> input) {
-        stop();
-        this.errorStats.resetKafkaErrors();
-        this.subscription = getMessagesFromKafka(input, job) //
-                .flatMap(this::postToClient, job.getParameters().getMaxConcurrency()) //
-                .onErrorResume(this::handleError) //
-                .subscribe(this::handleConsumerSentOk, //
-                        this::handleExceptionInStream, //
-                        () -> logger.warn("KafkaMessageConsumer stopped jobId: {}", job.getId()));
-    }
-
-    private void handleExceptionInStream(Throwable t) {
-        logger.warn("KafkaMessageConsumer exception: {}, jobId: {}", t.getMessage(), job.getId());
-        stop();
-    }
-
-    private Mono<String> postToClient(String body) {
-        logger.debug("Sending to consumer {} {} {}", job.getId(), job.getCallbackUrl(), body);
-        MediaType contentType = this.job.isBuffered() ? MediaType.APPLICATION_JSON : null;
-        return job.getConsumerRestClient().post("", body, contentType);
-    }
-
-    public synchronized void stop() {
-        if (this.subscription != null) {
-            this.subscription.dispose();
-            this.subscription = null;
-        }
-    }
-
-    public synchronized boolean isRunning() {
-        return this.subscription != null;
-    }
-
-    private Flux<String> getMessagesFromKafka(Flux<String> input, Job job) {
-        Flux<String> result = input.filter(job::isFilterMatch);
-
-        if (job.isBuffered()) {
-            result = result.map(this::quote) //
-                    .bufferTimeout( //
-                            job.getParameters().getBufferTimeout().getMaxSize(), //
-                            job.getParameters().getBufferTimeout().getMaxTime()) //
-                    .map(Object::toString);
-        }
-        return result;
-    }
-
-    private String quote(String str) {
-        final String q = "\"";
-        return q + str.replace(q, "\\\"") + q;
-    }
-
-    private Mono<String> handleError(Throwable t) {
-        logger.warn("exception: {} job: {}", t.getMessage(), job.getId());
-        this.errorStats.handleException(t);
-        if (this.errorStats.isItHopeless()) {
-            return Mono.error(t);
-        } else {
-            return Mono.empty(); // Ignore
-        }
-    }
-
-    private void handleConsumerSentOk(String data) {
-        this.errorStats.handleOkFromConsumer();
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/KafkaTopicConsumers.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/KafkaTopicConsumers.java
deleted file mode 100644 (file)
index 5233401..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.tasks;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import lombok.Getter;
-
-import org.oran.dmaapadapter.configuration.ApplicationConfig;
-import org.oran.dmaapadapter.repository.InfoType;
-import org.oran.dmaapadapter.repository.InfoTypes;
-import org.oran.dmaapadapter.repository.Job;
-import org.oran.dmaapadapter.repository.Jobs;
-import org.oran.dmaapadapter.repository.MultiMap;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-@SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally
-@Component
-@EnableScheduling
-public class KafkaTopicConsumers {
-    private static final Logger logger = LoggerFactory.getLogger(KafkaTopicConsumers.class);
-
-    private final Map<String, KafkaTopicListener> topicListeners = new HashMap<>(); // Key is typeId
-
-    @Getter
-    private final MultiMap<KafkaJobDataConsumer> consumers = new MultiMap<>(); // Key is typeId, jobId
-
-    private static final int CONSUMER_SUPERVISION_INTERVAL_MS = 1000 * 60 * 3;
-
-    public KafkaTopicConsumers(@Autowired ApplicationConfig appConfig, @Autowired InfoTypes types,
-            @Autowired Jobs jobs) {
-
-        for (InfoType type : types.getAll()) {
-            if (type.isKafkaTopicDefined()) {
-                KafkaTopicListener topicConsumer = new KafkaTopicListener(appConfig, type);
-                topicListeners.put(type.getId(), topicConsumer);
-            }
-        }
-
-        jobs.addObserver(new Jobs.Observer() {
-            @Override
-            public void onJobbAdded(Job job) {
-                addJob(job);
-            }
-
-            @Override
-            public void onJobRemoved(Job job) {
-                removeJob(job);
-            }
-        });
-    }
-
-    public synchronized void addJob(Job job) {
-        if (job.getType().isKafkaTopicDefined()) {
-            removeJob(job);
-            logger.debug("Kafka job added {}", job.getId());
-            KafkaTopicListener topicConsumer = topicListeners.get(job.getType().getId());
-            if (consumers.get(job.getType().getId()).isEmpty()) {
-                topicConsumer.start();
-            }
-            KafkaJobDataConsumer subscription = new KafkaJobDataConsumer(job);
-            subscription.start(topicConsumer.getOutput().asFlux());
-            consumers.put(job.getType().getId(), job.getId(), subscription);
-        }
-    }
-
-    public synchronized void removeJob(Job job) {
-        KafkaJobDataConsumer d = consumers.remove(job.getType().getId(), job.getId());
-        if (d != null) {
-            logger.debug("Kafka job removed {}", job.getId());
-            d.stop();
-        }
-    }
-
-    @Scheduled(fixedRate = CONSUMER_SUPERVISION_INTERVAL_MS)
-    public synchronized void restartNonRunningTopics() {
-        for (String typeId : this.consumers.keySet()) {
-            for (KafkaJobDataConsumer consumer : this.consumers.get(typeId)) {
-                if (!consumer.isRunning()) {
-                    restartTopic(consumer);
-                }
-            }
-        }
-    }
-
-    private void restartTopic(KafkaJobDataConsumer consumer) {
-        InfoType type = consumer.getJob().getType();
-        KafkaTopicListener topic = this.topicListeners.get(type.getId());
-        topic.start();
-        restartConsumersOfType(topic, type);
-    }
-
-    private void restartConsumersOfType(KafkaTopicListener topic, InfoType type) {
-        this.consumers.get(type.getId()).forEach(consumer -> consumer.start(topic.getOutput().asFlux()));
-    }
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/KafkaTopicListener.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/KafkaTopicListener.java
deleted file mode 100644 (file)
index f3b44a3..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.tasks;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.kafka.clients.consumer.ConsumerConfig;
-import org.apache.kafka.clients.consumer.ConsumerRecord;
-import org.apache.kafka.common.serialization.StringDeserializer;
-import org.oran.dmaapadapter.configuration.ApplicationConfig;
-import org.oran.dmaapadapter.repository.InfoType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import reactor.core.Disposable;
-import reactor.core.publisher.Sinks;
-import reactor.core.publisher.Sinks.Many;
-import reactor.kafka.receiver.KafkaReceiver;
-import reactor.kafka.receiver.ReceiverOptions;
-
-/**
- * The class streams incoming requests from a Kafka topic and sends them further
- * to a multi cast sink, which several other streams can connect to.
- */
-@SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally
-public class KafkaTopicListener {
-    private static final Logger logger = LoggerFactory.getLogger(KafkaTopicListener.class);
-    private final ApplicationConfig applicationConfig;
-    private final InfoType type;
-    private Many<String> output;
-    private Disposable topicReceiverTask;
-
-    public KafkaTopicListener(ApplicationConfig applicationConfig, InfoType type) {
-        this.applicationConfig = applicationConfig;
-        this.type = type;
-    }
-
-    public Many<String> getOutput() {
-        return this.output;
-    }
-
-    public void start() {
-        stop();
-        final int CONSUMER_BACKPRESSURE_BUFFER_SIZE = 1024 * 10;
-        this.output = Sinks.many().multicast().onBackpressureBuffer(CONSUMER_BACKPRESSURE_BUFFER_SIZE);
-        logger.debug("Listening to kafka topic: {} type :{}", this.type.getKafkaInputTopic(), type.getId());
-        topicReceiverTask = KafkaReceiver.create(kafkaInputProperties()) //
-                .receive() //
-                .doOnNext(this::onReceivedData) //
-                .subscribe(null, //
-                        this::onReceivedError, //
-                        () -> logger.warn("KafkaTopicReceiver stopped"));
-    }
-
-    private void stop() {
-        if (topicReceiverTask != null) {
-            topicReceiverTask.dispose();
-            topicReceiverTask = null;
-        }
-    }
-
-    private void onReceivedData(ConsumerRecord<String, String> input) {
-        logger.debug("Received from kafka topic: {} :{}", this.type.getKafkaInputTopic(), input.value());
-        output.emitNext(input.value(), Sinks.EmitFailureHandler.FAIL_FAST);
-    }
-
-    private void onReceivedError(Throwable t) {
-        logger.error("KafkaTopicReceiver error: {}", t.getMessage());
-    }
-
-    private ReceiverOptions<String, String> kafkaInputProperties() {
-        Map<String, Object> consumerProps = new HashMap<>();
-        if (this.applicationConfig.getKafkaBootStrapServers().isEmpty()) {
-            logger.error("No kafka boostrap server is setup");
-        }
-        consumerProps.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, this.applicationConfig.getKafkaBootStrapServers());
-        consumerProps.put(ConsumerConfig.GROUP_ID_CONFIG, "osc-dmaap-adaptor");
-        consumerProps.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
-        consumerProps.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
-
-        return ReceiverOptions.<String, String>create(consumerProps)
-                .subscription(Collections.singleton(this.type.getKafkaInputTopic()));
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/ProducerRegstrationTask.java b/dmaap-adaptor-java/src/main/java/org/oran/dmaapadapter/tasks/ProducerRegstrationTask.java
deleted file mode 100644 (file)
index ec3f2b2..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter.tasks;
-
-import com.google.common.io.CharStreams;
-import com.google.gson.JsonParser;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
-
-import lombok.Getter;
-
-import org.oran.dmaapadapter.clients.AsyncRestClient;
-import org.oran.dmaapadapter.clients.AsyncRestClientFactory;
-import org.oran.dmaapadapter.configuration.ApplicationConfig;
-import org.oran.dmaapadapter.controllers.ProducerCallbacksController;
-import org.oran.dmaapadapter.exceptions.ServiceException;
-import org.oran.dmaapadapter.r1.ProducerInfoTypeInfo;
-import org.oran.dmaapadapter.r1.ProducerRegistrationInfo;
-import org.oran.dmaapadapter.repository.InfoType;
-import org.oran.dmaapadapter.repository.InfoTypes;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-/**
- * Registers the types and this producer in Innformation Coordinator Service.
- * This is done when needed.
- */
-@Component
-@EnableScheduling
-@SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally
-public class ProducerRegstrationTask {
-
-    private static final Logger logger = LoggerFactory.getLogger(ProducerRegstrationTask.class);
-    private final AsyncRestClient restClient;
-    private final ApplicationConfig applicationConfig;
-    private final InfoTypes types;
-    private static com.google.gson.Gson gson = new com.google.gson.GsonBuilder().create();
-
-    private static final String PRODUCER_ID = "DmaapGenericInfoProducer";
-    @Getter
-    private boolean isRegisteredInIcs = false;
-    private static final int REGISTRATION_SUPERVISION_INTERVAL_MS = 1000 * 5;
-
-    public ProducerRegstrationTask(@Autowired ApplicationConfig applicationConfig, @Autowired InfoTypes types) {
-        AsyncRestClientFactory restClientFactory = new AsyncRestClientFactory(applicationConfig.getWebClientConfig());
-        this.restClient = restClientFactory.createRestClientNoHttpProxy("");
-        this.applicationConfig = applicationConfig;
-        this.types = types;
-    }
-
-    @Scheduled(fixedRate = REGISTRATION_SUPERVISION_INTERVAL_MS)
-    public void runSupervisionTask() {
-        supervisionTask().subscribe( //
-                null, //
-                this::handleRegistrationFailure, //
-                this::handleRegistrationCompleted);
-    }
-
-    public Mono<String> supervisionTask() {
-        return checkRegistration() //
-                .filter(isRegistrationOk -> !isRegistrationOk || !this.isRegisteredInIcs) //
-                .flatMap(isRegisterred -> registerTypesAndProducer());
-    }
-
-    private void handleRegistrationCompleted() {
-        isRegisteredInIcs = true;
-    }
-
-    private void handleRegistrationFailure(Throwable t) {
-        logger.warn("Registration of producer failed {}", t.getMessage());
-    }
-
-    // Returns TRUE if registration is correct
-    private Mono<Boolean> checkRegistration() {
-        final String url = applicationConfig.getIcsBaseUrl() + "/data-producer/v1/info-producers/" + PRODUCER_ID;
-        return restClient.get(url) //
-                .flatMap(this::isRegisterredInfoCorrect) //
-                .onErrorResume(t -> Mono.just(Boolean.FALSE));
-    }
-
-    private Mono<Boolean> isRegisterredInfoCorrect(String registerredInfoStr) {
-        ProducerRegistrationInfo registerredInfo = gson.fromJson(registerredInfoStr, ProducerRegistrationInfo.class);
-        if (isEqual(producerRegistrationInfo(), registerredInfo)) {
-            logger.trace("Already registered in ICS");
-            return Mono.just(Boolean.TRUE);
-        } else {
-            return Mono.just(Boolean.FALSE);
-        }
-    }
-
-    private String registerTypeUrl(InfoType type) {
-        return applicationConfig.getIcsBaseUrl() + "/data-producer/v1/info-types/" + type.getId();
-    }
-
-    private Mono<String> registerTypesAndProducer() {
-        final int CONCURRENCY = 20;
-        final String producerUrl =
-                applicationConfig.getIcsBaseUrl() + "/data-producer/v1/info-producers/" + PRODUCER_ID;
-
-        return Flux.fromIterable(this.types.getAll()) //
-                .doOnNext(type -> logger.info("Registering type {}", type.getId())) //
-                .flatMap(type -> restClient.put(registerTypeUrl(type), gson.toJson(typeRegistrationInfo(type))),
-                        CONCURRENCY) //
-                .collectList() //
-                .doOnNext(type -> logger.info("Registering producer")) //
-                .flatMap(resp -> restClient.put(producerUrl, gson.toJson(producerRegistrationInfo())));
-    }
-
-    private Object typeSpecifcInfoObject() {
-        return jsonObject("{}");
-    }
-
-    private ProducerInfoTypeInfo typeRegistrationInfo(InfoType type) {
-        try {
-            return new ProducerInfoTypeInfo(jsonSchemaObject(type), typeSpecifcInfoObject());
-        } catch (Exception e) {
-            logger.error("Fatal error {}", e.getMessage());
-            return null;
-        }
-    }
-
-    private Object jsonSchemaObject(InfoType type) throws IOException, ServiceException {
-        String schemaFile = type.isKafkaTopicDefined() ? "/typeSchemaKafka.json" : "/typeSchemaDmaap.json";
-        return jsonObject(readSchemaFile(schemaFile));
-    }
-
-    private String readSchemaFile(String filePath) throws IOException, ServiceException {
-        InputStream in = getClass().getResourceAsStream(filePath);
-        logger.debug("Reading application schema file from: {} with: {}", filePath, in);
-        if (in == null) {
-            throw new ServiceException("Could not readfile: " + filePath, HttpStatus.INTERNAL_SERVER_ERROR);
-        }
-        return CharStreams.toString(new InputStreamReader(in, StandardCharsets.UTF_8));
-    }
-
-    @SuppressWarnings("java:S2139") // Log exception
-    private Object jsonObject(String json) {
-        try {
-            return JsonParser.parseString(json).getAsJsonObject();
-        } catch (Exception e) {
-            logger.error("Bug, error in JSON: {} {}", json, e.getMessage());
-            throw new NullPointerException(e.getMessage());
-        }
-    }
-
-    private boolean isEqual(ProducerRegistrationInfo a, ProducerRegistrationInfo b) {
-        return a.jobCallbackUrl.equals(b.jobCallbackUrl) //
-                && a.producerSupervisionCallbackUrl.equals(b.producerSupervisionCallbackUrl) //
-                && a.supportedTypeIds.size() == b.supportedTypeIds.size();
-    }
-
-    private ProducerRegistrationInfo producerRegistrationInfo() {
-        return ProducerRegistrationInfo.builder() //
-                .jobCallbackUrl(baseUrl() + ProducerCallbacksController.JOB_URL) //
-                .producerSupervisionCallbackUrl(baseUrl() + ProducerCallbacksController.SUPERVISION_URL) //
-                .supportedTypeIds(this.types.typeIds()) //
-                .build();
-    }
-
-    private String baseUrl() {
-        return this.applicationConfig.getSelfUrl();
-    }
-}
diff --git a/dmaap-adaptor-java/src/main/resources/typeSchemaDmaap.json b/dmaap-adaptor-java/src/main/resources/typeSchemaDmaap.json
deleted file mode 100644 (file)
index a50b236..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "$schema": "http://json-schema.org/draft-04/schema#",
-  "type": "object",
-  "properties": {
-    "filter": {
-       "type": "string"
-     }
-  },
-  "additionalProperties": false
-}
diff --git a/dmaap-adaptor-java/src/main/resources/typeSchemaKafka.json b/dmaap-adaptor-java/src/main/resources/typeSchemaKafka.json
deleted file mode 100644 (file)
index f7e6e87..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-{
-  "$schema": "http://json-schema.org/draft-04/schema#",
-  "type": "object",
-  "properties": {
-    "filter": {
-      "type": "string"
-    },
-    "maxConcurrency": {
-      "type": "integer",
-      "minimum": 1
-    },
-    "bufferTimeout": {
-      "type": "object",
-      "properties": {
-        "maxSize": {
-          "type": "integer",
-          "minimum": 1
-        },
-        "maxTimeMiliseconds": {
-          "type": "integer",
-          "minimum": 0,
-          "maximum": 160000
-        }
-      },
-      "additionalProperties": false,
-      "required": [
-        "maxSize",
-        "maxTimeMiliseconds"
-      ]
-    }
-  },
-  "additionalProperties": false
-}
\ No newline at end of file
diff --git a/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/ApplicationTest.java b/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/ApplicationTest.java
deleted file mode 100644 (file)
index 6660175..0000000
+++ /dev/null
@@ -1,360 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.awaitility.Awaitility.await;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import com.google.gson.JsonParser;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-
-import org.json.JSONObject;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.oran.dmaapadapter.clients.AsyncRestClient;
-import org.oran.dmaapadapter.clients.AsyncRestClientFactory;
-import org.oran.dmaapadapter.configuration.ApplicationConfig;
-import org.oran.dmaapadapter.configuration.ImmutableHttpProxyConfig;
-import org.oran.dmaapadapter.configuration.ImmutableWebClientConfig;
-import org.oran.dmaapadapter.configuration.WebClientConfig;
-import org.oran.dmaapadapter.configuration.WebClientConfig.HttpProxyConfig;
-import org.oran.dmaapadapter.controllers.ProducerCallbacksController;
-import org.oran.dmaapadapter.r1.ConsumerJobInfo;
-import org.oran.dmaapadapter.r1.ProducerJobInfo;
-import org.oran.dmaapadapter.repository.InfoTypes;
-import org.oran.dmaapadapter.repository.Job;
-import org.oran.dmaapadapter.repository.Jobs;
-import org.oran.dmaapadapter.tasks.KafkaJobDataConsumer;
-import org.oran.dmaapadapter.tasks.KafkaTopicConsumers;
-import org.oran.dmaapadapter.tasks.ProducerRegstrationTask;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
-import org.springframework.boot.test.context.TestConfiguration;
-import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
-import org.springframework.boot.web.server.LocalServerPort;
-import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit.jupiter.SpringExtension;
-import org.springframework.web.reactive.function.client.WebClientResponseException;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-import reactor.test.StepVerifier;
-
-@ExtendWith(SpringExtension.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-@TestPropertySource(properties = { //
-        "server.ssl.key-store=./config/keystore.jks", //
-        "app.webclient.trust-store=./config/truststore.jks", //
-        "app.configuration-filepath=./src/test/resources/test_application_configuration.json"//
-})
-class ApplicationTest {
-
-    @Autowired
-    private ApplicationConfig applicationConfig;
-
-    @Autowired
-    private Jobs jobs;
-
-    @Autowired
-    private InfoTypes types;
-
-    @Autowired
-    private ConsumerController consumerController;
-
-    @Autowired
-    private IcsSimulatorController icsSimulatorController;
-
-    @Autowired
-    KafkaTopicConsumers kafkaTopicConsumers;
-
-    @Autowired
-    ProducerRegstrationTask producerRegistrationTask;
-
-    private com.google.gson.Gson gson = new com.google.gson.GsonBuilder().create();
-
-    @LocalServerPort
-    int localServerHttpPort;
-
-    static class TestApplicationConfig extends ApplicationConfig {
-        @Override
-        public String getIcsBaseUrl() {
-            return thisProcessUrl();
-        }
-
-        @Override
-        public String getDmaapBaseUrl() {
-            return thisProcessUrl();
-        }
-
-        @Override
-        public String getSelfUrl() {
-            return thisProcessUrl();
-        }
-
-        private String thisProcessUrl() {
-            final String url = "https://localhost:" + getLocalServerHttpPort();
-            return url;
-        }
-    }
-
-    /**
-     * Overrides the BeanFactory.
-     */
-    @TestConfiguration
-    static class TestBeanFactory extends BeanFactory {
-
-        @Override
-        @Bean
-        public ServletWebServerFactory servletContainer() {
-            return new TomcatServletWebServerFactory();
-        }
-
-        @Override
-        @Bean
-        public ApplicationConfig getApplicationConfig() {
-            TestApplicationConfig cfg = new TestApplicationConfig();
-            return cfg;
-        }
-    }
-
-    @BeforeEach
-    void setPort() {
-        this.applicationConfig.setLocalServerHttpPort(this.localServerHttpPort);
-    }
-
-    @AfterEach
-    void reset() {
-        this.consumerController.testResults.reset();
-        this.icsSimulatorController.testResults.reset();
-        this.jobs.clear();
-    }
-
-    private AsyncRestClient restClient(boolean useTrustValidation) {
-        WebClientConfig config = this.applicationConfig.getWebClientConfig();
-        HttpProxyConfig httpProxyConfig = ImmutableHttpProxyConfig.builder() //
-                .httpProxyHost("") //
-                .httpProxyPort(0) //
-                .build();
-        config = ImmutableWebClientConfig.builder() //
-                .keyStoreType(config.keyStoreType()) //
-                .keyStorePassword(config.keyStorePassword()) //
-                .keyStore(config.keyStore()) //
-                .keyPassword(config.keyPassword()) //
-                .isTrustStoreUsed(useTrustValidation) //
-                .trustStore(config.trustStore()) //
-                .trustStorePassword(config.trustStorePassword()) //
-                .httpProxyConfig(httpProxyConfig).build();
-
-        AsyncRestClientFactory restClientFactory = new AsyncRestClientFactory(config);
-        return restClientFactory.createRestClientNoHttpProxy(baseUrl());
-    }
-
-    private AsyncRestClient restClient() {
-        return restClient(false);
-    }
-
-    private String baseUrl() {
-        return "https://localhost:" + this.applicationConfig.getLocalServerHttpPort();
-    }
-
-    private ConsumerJobInfo consumerJobInfo() {
-        return consumerJobInfo("DmaapInformationType", "EI_JOB_ID");
-    }
-
-    private Object jsonObject() {
-        return jsonObject("{}");
-    }
-
-    private Object jsonObject(String json) {
-        try {
-            return JsonParser.parseString(json).getAsJsonObject();
-        } catch (Exception e) {
-            throw new NullPointerException(e.toString());
-        }
-    }
-
-    private ConsumerJobInfo consumerJobInfo(String typeId, String infoJobId) {
-        try {
-            String targetUri = baseUrl() + ConsumerController.CONSUMER_TARGET_URL;
-            return new ConsumerJobInfo(typeId, jsonObject(), "owner", targetUri, "");
-        } catch (Exception e) {
-            return null;
-        }
-    }
-
-    @Test
-    void generateApiDoc() throws IOException {
-        String url = "https://localhost:" + applicationConfig.getLocalServerHttpPort() + "/v3/api-docs";
-        ResponseEntity<String> resp = restClient().getForEntity(url).block();
-        assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.OK);
-        JSONObject jsonObj = new JSONObject(resp.getBody());
-        assertThat(jsonObj.remove("servers")).isNotNull();
-
-        String indented = (jsonObj).toString(4);
-        String docDir = "api/";
-        Files.createDirectories(Paths.get(docDir));
-        try (PrintStream out = new PrintStream(new FileOutputStream(docDir + "api.json"))) {
-            out.print(indented);
-        }
-    }
-
-    @Test
-    void testResponseCodes() throws Exception {
-        String supervisionUrl = baseUrl() + ProducerCallbacksController.SUPERVISION_URL;
-        ResponseEntity<String> resp = restClient().getForEntity(supervisionUrl).block();
-        assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.OK);
-
-        String jobUrl = baseUrl() + ProducerCallbacksController.JOB_URL;
-        resp = restClient().deleteForEntity(jobUrl + "/junk").block();
-        assertThat(resp.getStatusCode()).isEqualTo(HttpStatus.OK);
-
-        ProducerJobInfo info = new ProducerJobInfo(null, "id", "typeId", "targetUri", "owner", "lastUpdated");
-        String body = gson.toJson(info);
-        testErrorCode(restClient().post(jobUrl, body, MediaType.APPLICATION_JSON), HttpStatus.NOT_FOUND,
-                "Could not find type");
-    }
-
-    @Test
-    void testReceiveAndPostDataFromKafka() {
-        final String JOB_ID = "ID";
-        final String TYPE_ID = "KafkaInformationType";
-        await().untilAsserted(() -> assertThat(icsSimulatorController.testResults.registrationInfo).isNotNull());
-        assertThat(icsSimulatorController.testResults.registrationInfo.supportedTypeIds).hasSize(this.types.size());
-
-        // Create a job
-        Job.Parameters param = new Job.Parameters("", new Job.BufferTimeout(123, 456), 1);
-        String targetUri = baseUrl() + ConsumerController.CONSUMER_TARGET_URL;
-        ConsumerJobInfo kafkaJobInfo =
-                new ConsumerJobInfo(TYPE_ID, jsonObject(gson.toJson(param)), "owner", targetUri, "");
-
-        this.icsSimulatorController.addJob(kafkaJobInfo, JOB_ID, restClient());
-        await().untilAsserted(() -> assertThat(this.jobs.size()).isEqualTo(1));
-
-        KafkaJobDataConsumer kafkaConsumer = this.kafkaTopicConsumers.getConsumers().get(TYPE_ID, JOB_ID);
-
-        // Handle received data from Kafka, check that it has been posted to the
-        // consumer
-        kafkaConsumer.start(Flux.just("data"));
-
-        ConsumerController.TestResults consumer = this.consumerController.testResults;
-        await().untilAsserted(() -> assertThat(consumer.receivedBodies.size()).isEqualTo(1));
-        assertThat(consumer.receivedBodies.get(0)).isEqualTo("[\"data\"]");
-
-        // Test send an exception
-        kafkaConsumer.start(Flux.error(new NullPointerException()));
-
-        // Test regular restart of stopped
-        kafkaConsumer.stop();
-        this.kafkaTopicConsumers.restartNonRunningTopics();
-        await().untilAsserted(() -> assertThat(kafkaConsumer.isRunning()).isTrue());
-
-        // Delete the job
-        this.icsSimulatorController.deleteJob(JOB_ID, restClient());
-        await().untilAsserted(() -> assertThat(this.jobs.size()).isZero());
-    }
-
-    @Test
-    void testReceiveAndPostDataFromDmaap() throws Exception {
-        final String JOB_ID = "ID";
-
-        // Register producer, Register types
-        await().untilAsserted(() -> assertThat(icsSimulatorController.testResults.registrationInfo).isNotNull());
-        assertThat(icsSimulatorController.testResults.registrationInfo.supportedTypeIds).hasSize(this.types.size());
-        assertThat(producerRegistrationTask.isRegisteredInIcs()).isTrue();
-        producerRegistrationTask.supervisionTask().block();
-
-        // Create a job
-        this.icsSimulatorController.addJob(consumerJobInfo(), JOB_ID, restClient());
-        await().untilAsserted(() -> assertThat(this.jobs.size()).isEqualTo(1));
-
-        // Return two messages from DMAAP and verify that these are sent to the owner of
-        // the job (consumer)
-        DmaapSimulatorController.dmaapResponses.add("DmaapResponse1");
-        DmaapSimulatorController.dmaapResponses.add("DmaapResponse2");
-        ConsumerController.TestResults consumer = this.consumerController.testResults;
-        await().untilAsserted(() -> assertThat(consumer.receivedBodies.size()).isEqualTo(2));
-        assertThat(consumer.receivedBodies.get(0)).isEqualTo("DmaapResponse1");
-
-        String jobUrl = baseUrl() + ProducerCallbacksController.JOB_URL;
-        String jobs = restClient().get(jobUrl).block();
-        assertThat(jobs).contains(JOB_ID);
-
-        // Delete the job
-        this.icsSimulatorController.deleteJob(JOB_ID, restClient());
-        await().untilAsserted(() -> assertThat(this.jobs.size()).isZero());
-    }
-
-    @Test
-    void testReRegister() throws Exception {
-        // Wait foir register types and producer
-        await().untilAsserted(() -> assertThat(icsSimulatorController.testResults.registrationInfo).isNotNull());
-        assertThat(icsSimulatorController.testResults.registrationInfo.supportedTypeIds).hasSize(this.types.size());
-
-        // Clear the registration, should trigger a re-register
-        icsSimulatorController.testResults.reset();
-        await().untilAsserted(() -> assertThat(icsSimulatorController.testResults.registrationInfo).isNotNull());
-        assertThat(icsSimulatorController.testResults.registrationInfo.supportedTypeIds).hasSize(this.types.size());
-
-        // Just clear the registerred types, should trigger a re-register
-        icsSimulatorController.testResults.types.clear();
-        await().untilAsserted(
-                () -> assertThat(icsSimulatorController.testResults.registrationInfo.supportedTypeIds).hasSize(2));
-    }
-
-    public static void testErrorCode(Mono<?> request, HttpStatus expStatus, String responseContains) {
-        testErrorCode(request, expStatus, responseContains, true);
-    }
-
-    public static void testErrorCode(Mono<?> request, HttpStatus expStatus, String responseContains,
-            boolean expectApplicationProblemJsonMediaType) {
-        StepVerifier.create(request) //
-                .expectSubscription() //
-                .expectErrorMatches(
-                        t -> checkWebClientError(t, expStatus, responseContains, expectApplicationProblemJsonMediaType)) //
-                .verify();
-    }
-
-    private static boolean checkWebClientError(Throwable throwable, HttpStatus expStatus, String responseContains,
-            boolean expectApplicationProblemJsonMediaType) {
-        assertTrue(throwable instanceof WebClientResponseException);
-        WebClientResponseException responseException = (WebClientResponseException) throwable;
-        assertThat(responseException.getStatusCode()).isEqualTo(expStatus);
-        assertThat(responseException.getResponseBodyAsString()).contains(responseContains);
-        if (expectApplicationProblemJsonMediaType) {
-            assertThat(responseException.getHeaders().getContentType()).isEqualTo(MediaType.APPLICATION_PROBLEM_JSON);
-        }
-        return true;
-    }
-}
diff --git a/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/ConsumerController.java b/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/ConsumerController.java
deleted file mode 100644 (file)
index 70e89d6..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter;
-
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.media.Content;
-import io.swagger.v3.oas.annotations.media.Schema;
-import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
-import io.swagger.v3.oas.annotations.tags.Tag;
-
-import java.lang.invoke.MethodHandles;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.oran.dmaapadapter.controllers.VoidResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController("ConsumerSimulatorController")
-@Tag(name = "Test Consumer Simulator (exists only in test)")
-public class ConsumerController {
-
-    private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-    public static final String CONSUMER_TARGET_URL = "/consumer";
-
-    public static class TestResults {
-
-        public List<String> receivedBodies = Collections.synchronizedList(new ArrayList<String>());
-
-        public TestResults() {}
-
-        public boolean hasReceived(String str) {
-            for (String received : receivedBodies) {
-                if (received.equals(str)) {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        public void reset() {
-            receivedBodies.clear();
-        }
-    }
-
-    final TestResults testResults = new TestResults();
-
-    @PostMapping(path = CONSUMER_TARGET_URL, produces = MediaType.APPLICATION_JSON_VALUE)
-    @Operation(summary = "Consume data", description = "The call is invoked to push data to consumer")
-    @ApiResponses(value = { //
-            @ApiResponse(responseCode = "200", description = "OK", //
-                    content = @Content(schema = @Schema(implementation = VoidResponse.class))) //
-    })
-    public ResponseEntity<Object> postData(@RequestBody String body) {
-        logger.info("Received by consumer: {}", body);
-        testResults.receivedBodies.add(body);
-        return new ResponseEntity<>(HttpStatus.OK);
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/DmaapSimulatorController.java b/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/DmaapSimulatorController.java
deleted file mode 100644 (file)
index 5259ee1..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter;
-
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.media.Content;
-import io.swagger.v3.oas.annotations.media.Schema;
-import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.swagger.v3.oas.annotations.responses.ApiResponses;
-import io.swagger.v3.oas.annotations.tags.Tag;
-
-import java.lang.invoke.MethodHandles;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.oran.dmaapadapter.controllers.ErrorResponse;
-import org.oran.dmaapadapter.controllers.VoidResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController("DmaapSimulatorController")
-@Tag(name = "DMAAP Simulator (exists only in test)")
-public class DmaapSimulatorController {
-
-    private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-    public static final String DMAAP_TOPIC_URL = "/dmaap-topic-1";
-
-    public static List<String> dmaapResponses = Collections.synchronizedList(new LinkedList<String>());
-
-    @GetMapping(path = DMAAP_TOPIC_URL, produces = MediaType.APPLICATION_JSON_VALUE)
-    @Operation(summary = "GET from topic",
-            description = "The call is invoked to activate or to modify a data subscription. The endpoint is provided by the Information Producer.")
-    @ApiResponses(value = { //
-            @ApiResponse(responseCode = "200", description = "OK", //
-                    content = @Content(schema = @Schema(implementation = VoidResponse.class))) //
-    })
-    public ResponseEntity<Object> getFromTopic() {
-        if (dmaapResponses.isEmpty()) {
-            return ErrorResponse.create("", HttpStatus.NOT_FOUND);
-        } else {
-            String resp = dmaapResponses.remove(0);
-            logger.info("DMAAP simulator returned: {}", resp);
-            return new ResponseEntity<>(resp, HttpStatus.OK);
-        }
-
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/IcsSimulatorController.java b/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/IcsSimulatorController.java
deleted file mode 100644 (file)
index 790aafb..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-
-import io.swagger.v3.oas.annotations.tags.Tag;
-
-import java.lang.invoke.MethodHandles;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.oran.dmaapadapter.clients.AsyncRestClient;
-import org.oran.dmaapadapter.r1.ConsumerJobInfo;
-import org.oran.dmaapadapter.r1.ProducerInfoTypeInfo;
-import org.oran.dmaapadapter.r1.ProducerJobInfo;
-import org.oran.dmaapadapter.r1.ProducerRegistrationInfo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController("IcsSimulatorController")
-@Tag(name = "Information Coordinator Service Simulator (exists only in test)")
-public class IcsSimulatorController {
-
-    private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-    private final static Gson gson = new GsonBuilder().create();
-
-    public static class TestResults {
-
-        ProducerRegistrationInfo registrationInfo = null;
-        Map<String, ProducerInfoTypeInfo> types = new HashMap<>();
-        String infoProducerId = null;
-
-        public TestResults() {}
-
-        public void reset() {
-            registrationInfo = null;
-            types.clear();
-            infoProducerId = null;
-        }
-    }
-
-    final TestResults testResults = new TestResults();
-    public static final String API_ROOT = "/data-producer/v1";
-
-    @GetMapping(path = API_ROOT + "/info-producers/{infoProducerId}", produces = MediaType.APPLICATION_JSON_VALUE)
-    public ResponseEntity<Object> getInfoProducer( //
-            @PathVariable("infoProducerId") String infoProducerId) {
-
-        if (testResults.registrationInfo != null) {
-            return new ResponseEntity<>(gson.toJson(testResults.registrationInfo), HttpStatus.OK);
-        } else {
-            return new ResponseEntity<>(HttpStatus.NOT_FOUND);
-        }
-    }
-
-    @PutMapping(path = API_ROOT + "/info-producers/{infoProducerId}", //
-            produces = MediaType.APPLICATION_JSON_VALUE)
-    public ResponseEntity<Object> putInfoProducer( //
-            @PathVariable("infoProducerId") String infoProducerId, //
-            @RequestBody ProducerRegistrationInfo registrationInfo) {
-        testResults.registrationInfo = registrationInfo;
-        testResults.infoProducerId = infoProducerId;
-        return new ResponseEntity<>(HttpStatus.OK);
-    }
-
-    @PutMapping(path = API_ROOT + "/info-types/{infoTypeId}", produces = MediaType.APPLICATION_JSON_VALUE)
-    public ResponseEntity<Object> putInfoType( //
-            @PathVariable("infoTypeId") String infoTypeId, //
-            @RequestBody ProducerInfoTypeInfo registrationInfo) {
-        testResults.types.put(infoTypeId, registrationInfo);
-        return new ResponseEntity<>(HttpStatus.OK);
-    }
-
-    public void addJob(ConsumerJobInfo job, String jobId, AsyncRestClient restClient) {
-        String url = this.testResults.registrationInfo.jobCallbackUrl;
-        ProducerJobInfo request =
-                new ProducerJobInfo(job.jobDefinition, jobId, job.infoTypeId, job.jobResultUri, job.owner, "TIMESTAMP");
-        String body = gson.toJson(request);
-        logger.info("ICS Simulator PUT job: {}", body);
-        restClient.post(url, body, MediaType.APPLICATION_JSON).block();
-    }
-
-    public void deleteJob(String jobId, AsyncRestClient restClient) {
-        String url = this.testResults.registrationInfo.jobCallbackUrl + "/" + jobId;
-        logger.info("ICS Simulator DELETE job: {}", url);
-        restClient.delete(url).block();
-
-    }
-}
diff --git a/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/IntegrationWithIcs.java b/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/IntegrationWithIcs.java
deleted file mode 100644 (file)
index 9f0ef19..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.awaitility.Awaitility.await;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonParser;
-
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.oran.dmaapadapter.clients.AsyncRestClient;
-import org.oran.dmaapadapter.clients.AsyncRestClientFactory;
-import org.oran.dmaapadapter.configuration.ApplicationConfig;
-import org.oran.dmaapadapter.configuration.ImmutableHttpProxyConfig;
-import org.oran.dmaapadapter.configuration.ImmutableWebClientConfig;
-import org.oran.dmaapadapter.configuration.WebClientConfig;
-import org.oran.dmaapadapter.configuration.WebClientConfig.HttpProxyConfig;
-import org.oran.dmaapadapter.r1.ConsumerJobInfo;
-import org.oran.dmaapadapter.repository.InfoTypes;
-import org.oran.dmaapadapter.repository.Job;
-import org.oran.dmaapadapter.repository.Jobs;
-import org.oran.dmaapadapter.tasks.ProducerRegstrationTask;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
-import org.springframework.boot.test.context.TestConfiguration;
-import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
-import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.http.HttpStatus;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit.jupiter.SpringExtension;
-
-
-@SuppressWarnings("java:S3577") // Rename class
-@ExtendWith(SpringExtension.class)
-@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT)
-@TestPropertySource(properties = { //
-        "server.ssl.key-store=./config/keystore.jks", //
-        "app.webclient.trust-store=./config/truststore.jks", //
-        "app.configuration-filepath=./src/test/resources/test_application_configuration.json", //
-        "app.ics-base-url=https://localhost:8434" //
-})
-class IntegrationWithIcs {
-
-    private static final String DMAAP_JOB_ID = "DMAAP_JOB_ID";
-    private static final String DMAAP_TYPE_ID = "DmaapInformationType";
-
-    @Autowired
-    private ApplicationConfig applicationConfig;
-
-    @Autowired
-    private ProducerRegstrationTask producerRegstrationTask;
-
-    @Autowired
-    private Jobs jobs;
-
-    @Autowired
-    private InfoTypes types;
-
-    @Autowired
-    private ConsumerController consumerController;
-
-    private static Gson gson = new GsonBuilder().create();
-
-    static class TestApplicationConfig extends ApplicationConfig {
-
-        @Override
-        public String getIcsBaseUrl() {
-            return "https://localhost:8434";
-        }
-
-        @Override
-        public String getDmaapBaseUrl() {
-            return thisProcessUrl();
-        }
-
-        @Override
-        public String getSelfUrl() {
-            return thisProcessUrl();
-        }
-
-        private String thisProcessUrl() {
-            final String url = "https://localhost:" + getLocalServerHttpPort();
-            return url;
-        }
-    }
-
-    /**
-     * Overrides the BeanFactory.
-     */
-    @TestConfiguration
-    static class TestBeanFactory extends BeanFactory {
-
-        @Override
-        @Bean
-        public ServletWebServerFactory servletContainer() {
-            return new TomcatServletWebServerFactory();
-        }
-
-        @Override
-        @Bean
-        public ApplicationConfig getApplicationConfig() {
-            TestApplicationConfig cfg = new TestApplicationConfig();
-            return cfg;
-        }
-    }
-
-    @AfterEach
-    void reset() {
-        this.consumerController.testResults.reset();
-        assertThat(this.jobs.size()).isZero();
-    }
-
-    private AsyncRestClient restClient(boolean useTrustValidation) {
-        WebClientConfig config = this.applicationConfig.getWebClientConfig();
-        HttpProxyConfig httpProxyConfig = ImmutableHttpProxyConfig.builder() //
-                .httpProxyHost("") //
-                .httpProxyPort(0) //
-                .build();
-        config = ImmutableWebClientConfig.builder() //
-                .keyStoreType(config.keyStoreType()) //
-                .keyStorePassword(config.keyStorePassword()) //
-                .keyStore(config.keyStore()) //
-                .keyPassword(config.keyPassword()) //
-                .isTrustStoreUsed(useTrustValidation) //
-                .trustStore(config.trustStore()) //
-                .trustStorePassword(config.trustStorePassword()) //
-                .httpProxyConfig(httpProxyConfig).build();
-
-        AsyncRestClientFactory restClientFactory = new AsyncRestClientFactory(config);
-        return restClientFactory.createRestClientNoHttpProxy(selfBaseUrl());
-    }
-
-    private AsyncRestClient restClient() {
-        return restClient(false);
-    }
-
-    private String selfBaseUrl() {
-        return "https://localhost:" + this.applicationConfig.getLocalServerHttpPort();
-    }
-
-    private String icsBaseUrl() {
-        return applicationConfig.getIcsBaseUrl();
-    }
-
-    private String jobUrl(String jobId) {
-        return icsBaseUrl() + "/data-consumer/v1/info-jobs/" + jobId + "?typeCheck=true";
-    }
-
-    private void createInformationJobInIcs(String typeId, String jobId, String filter) {
-        String body = gson.toJson(consumerJobInfo(typeId, filter));
-        try {
-            // Delete the job if it already exists
-            deleteInformationJobInIcs(jobId);
-        } catch (Exception e) {
-        }
-        restClient().putForEntity(jobUrl(jobId), body).block();
-    }
-
-    private void deleteInformationJobInIcs(String jobId) {
-        restClient().delete(jobUrl(jobId)).block();
-    }
-
-    private ConsumerJobInfo consumerJobInfo(String typeId, String filter) {
-        return consumerJobInfo(typeId, DMAAP_JOB_ID, filter);
-    }
-
-    private Object jsonObject(String json) {
-        try {
-            return JsonParser.parseString(json).getAsJsonObject();
-        } catch (Exception e) {
-            throw new NullPointerException(e.toString());
-        }
-    }
-
-    private String quote(String str) {
-        return "\"" + str + "\"";
-    }
-
-    private String consumerUri() {
-        return selfBaseUrl() + ConsumerController.CONSUMER_TARGET_URL;
-    }
-
-    private ConsumerJobInfo consumerJobInfo(String typeId, String infoJobId, String filter) {
-        try {
-
-            String jsonStr = "{ \"filter\" :" + quote(filter) + "}";
-            return new ConsumerJobInfo(typeId, jsonObject(jsonStr), "owner", consumerUri(), "");
-        } catch (Exception e) {
-            return null;
-        }
-    }
-
-    @Test
-    void testCreateKafkaJob() {
-        await().untilAsserted(() -> assertThat(producerRegstrationTask.isRegisteredInIcs()).isTrue());
-        final String TYPE_ID = "KafkaInformationType";
-
-        Job.Parameters param = new Job.Parameters("filter", new Job.BufferTimeout(123, 456), 1);
-
-        ConsumerJobInfo jobInfo =
-                new ConsumerJobInfo(TYPE_ID, jsonObject(gson.toJson(param)), "owner", consumerUri(), "");
-        String body = gson.toJson(jobInfo);
-
-        restClient().putForEntity(jobUrl("KAFKA_JOB_ID"), body).block();
-
-        await().untilAsserted(() -> assertThat(this.jobs.size()).isEqualTo(1));
-
-        deleteInformationJobInIcs("KAFKA_JOB_ID");
-        await().untilAsserted(() -> assertThat(this.jobs.size()).isZero());
-    }
-
-    @Test
-    void testKafkaJobParameterOutOfRange() {
-        await().untilAsserted(() -> assertThat(producerRegstrationTask.isRegisteredInIcs()).isTrue());
-        final String TYPE_ID = "KafkaInformationType";
-
-        Job.Parameters param = new Job.Parameters("filter", new Job.BufferTimeout(123, 170 * 1000), 1);
-
-        ConsumerJobInfo jobInfo =
-                new ConsumerJobInfo(TYPE_ID, jsonObject(gson.toJson(param)), "owner", consumerUri(), "");
-        String body = gson.toJson(jobInfo);
-
-        ApplicationTest.testErrorCode(restClient().put(jobUrl("KAFKA_JOB_ID"), body), HttpStatus.BAD_REQUEST,
-                "Json validation failure");
-
-    }
-
-    @Test
-    void testDmaapMessage() throws Exception {
-        await().untilAsserted(() -> assertThat(producerRegstrationTask.isRegisteredInIcs()).isTrue());
-
-        createInformationJobInIcs(DMAAP_TYPE_ID, DMAAP_JOB_ID, ".*DmaapResponse.*");
-
-        await().untilAsserted(() -> assertThat(this.jobs.size()).isEqualTo(1));
-
-        DmaapSimulatorController.dmaapResponses.add("DmaapResponse1");
-        DmaapSimulatorController.dmaapResponses.add("DmaapResponse2");
-        DmaapSimulatorController.dmaapResponses.add("Junk");
-
-        ConsumerController.TestResults results = this.consumerController.testResults;
-        await().untilAsserted(() -> assertThat(results.receivedBodies.size()).isEqualTo(2));
-        assertThat(results.receivedBodies.get(0)).isEqualTo("DmaapResponse1");
-
-        deleteInformationJobInIcs(DMAAP_JOB_ID);
-
-        await().untilAsserted(() -> assertThat(this.jobs.size()).isZero());
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/IntegrationWithKafka.java b/dmaap-adaptor-java/src/test/java/org/oran/dmaapadapter/IntegrationWithKafka.java
deleted file mode 100644 (file)
index 5a48d61..0000000
+++ /dev/null
@@ -1,344 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2021 Nordix Foundation
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-
-package org.oran.dmaapadapter;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.awaitility.Awaitility.await;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import com.google.gson.JsonParser;
-
-import java.time.Duration;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.kafka.clients.producer.ProducerConfig;
-import org.apache.kafka.clients.producer.ProducerRecord;
-import org.apache.kafka.common.serialization.IntegerSerializer;
-import org.apache.kafka.common.serialization.StringSerializer;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.oran.dmaapadapter.clients.AsyncRestClient;
-import org.oran.dmaapadapter.clients.AsyncRestClientFactory;
-import org.oran.dmaapadapter.configuration.ApplicationConfig;
-import org.oran.dmaapadapter.configuration.ImmutableHttpProxyConfig;
-import org.oran.dmaapadapter.configuration.ImmutableWebClientConfig;
-import org.oran.dmaapadapter.configuration.WebClientConfig;
-import org.oran.dmaapadapter.configuration.WebClientConfig.HttpProxyConfig;
-import org.oran.dmaapadapter.r1.ConsumerJobInfo;
-import org.oran.dmaapadapter.repository.InfoType;
-import org.oran.dmaapadapter.repository.InfoTypes;
-import org.oran.dmaapadapter.repository.Job;
-import org.oran.dmaapadapter.repository.Jobs;
-import org.oran.dmaapadapter.tasks.KafkaJobDataConsumer;
-import org.oran.dmaapadapter.tasks.KafkaTopicConsumers;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
-import org.springframework.boot.test.context.TestConfiguration;
-import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
-import org.springframework.boot.web.server.LocalServerPort;
-import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit.jupiter.SpringExtension;
-
-import reactor.core.publisher.Flux;
-import reactor.kafka.sender.KafkaSender;
-import reactor.kafka.sender.SenderOptions;
-import reactor.kafka.sender.SenderRecord;
-
-@SuppressWarnings("java:S3577") // Rename class
-@ExtendWith(SpringExtension.class)
-@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT)
-@TestPropertySource(properties = { //
-        "server.ssl.key-store=./config/keystore.jks", //
-        "app.webclient.trust-store=./config/truststore.jks", //
-        "app.configuration-filepath=./src/test/resources/test_application_configuration.json"//
-})
-class IntegrationWithKafka {
-
-    final String TYPE_ID = "KafkaInformationType";
-
-    @Autowired
-    private ApplicationConfig applicationConfig;
-
-    @Autowired
-    private Jobs jobs;
-
-    @Autowired
-    private InfoTypes types;
-
-    @Autowired
-    private ConsumerController consumerController;
-
-    @Autowired
-    private IcsSimulatorController icsSimulatorController;
-
-    @Autowired
-    private KafkaTopicConsumers kafkaTopicConsumers;
-
-    private static com.google.gson.Gson gson = new com.google.gson.GsonBuilder().create();
-
-    private static final Logger logger = LoggerFactory.getLogger(IntegrationWithKafka.class);
-
-    @LocalServerPort
-    int localServerHttpPort;
-
-    static class TestApplicationConfig extends ApplicationConfig {
-        @Override
-        public String getIcsBaseUrl() {
-            return thisProcessUrl();
-        }
-
-        @Override
-        public String getDmaapBaseUrl() {
-            return thisProcessUrl();
-        }
-
-        @Override
-        public String getSelfUrl() {
-            return thisProcessUrl();
-        }
-
-        private String thisProcessUrl() {
-            final String url = "https://localhost:" + getLocalServerHttpPort();
-            return url;
-        }
-    }
-
-    /**
-     * Overrides the BeanFactory.
-     */
-    @TestConfiguration
-    static class TestBeanFactory extends BeanFactory {
-
-        @Override
-        @Bean
-        public ServletWebServerFactory servletContainer() {
-            return new TomcatServletWebServerFactory();
-        }
-
-        @Override
-        @Bean
-        public ApplicationConfig getApplicationConfig() {
-            TestApplicationConfig cfg = new TestApplicationConfig();
-            return cfg;
-        }
-    }
-
-    @AfterEach
-    void reset() {
-        this.consumerController.testResults.reset();
-        this.icsSimulatorController.testResults.reset();
-        this.jobs.clear();
-    }
-
-    private AsyncRestClient restClient(boolean useTrustValidation) {
-        WebClientConfig config = this.applicationConfig.getWebClientConfig();
-        HttpProxyConfig httpProxyConfig = ImmutableHttpProxyConfig.builder() //
-                .httpProxyHost("") //
-                .httpProxyPort(0) //
-                .build();
-        config = ImmutableWebClientConfig.builder() //
-                .keyStoreType(config.keyStoreType()) //
-                .keyStorePassword(config.keyStorePassword()) //
-                .keyStore(config.keyStore()) //
-                .keyPassword(config.keyPassword()) //
-                .isTrustStoreUsed(useTrustValidation) //
-                .trustStore(config.trustStore()) //
-                .trustStorePassword(config.trustStorePassword()) //
-                .httpProxyConfig(httpProxyConfig).build();
-
-        AsyncRestClientFactory restClientFactory = new AsyncRestClientFactory(config);
-        return restClientFactory.createRestClientNoHttpProxy(baseUrl());
-    }
-
-    private AsyncRestClient restClient() {
-        return restClient(false);
-    }
-
-    private String baseUrl() {
-        return "https://localhost:" + this.applicationConfig.getLocalServerHttpPort();
-    }
-
-    private static Object jobParametersAsJsonObject(String filter, long maxTimeMiliseconds, int maxSize,
-            int maxConcurrency) {
-        Job.Parameters param =
-                new Job.Parameters(filter, new Job.BufferTimeout(maxSize, maxTimeMiliseconds), maxConcurrency);
-        String str = gson.toJson(param);
-        return jsonObject(str);
-    }
-
-    private static Object jsonObject(String json) {
-        try {
-            return JsonParser.parseString(json).getAsJsonObject();
-        } catch (Exception e) {
-            throw new NullPointerException(e.toString());
-        }
-    }
-
-    ConsumerJobInfo consumerJobInfo(String filter, Duration maxTime, int maxSize, int maxConcurrency) {
-        try {
-            String targetUri = baseUrl() + ConsumerController.CONSUMER_TARGET_URL;
-            return new ConsumerJobInfo(TYPE_ID,
-                    jobParametersAsJsonObject(filter, maxTime.toMillis(), maxSize, maxConcurrency), "owner", targetUri,
-                    "");
-        } catch (Exception e) {
-            return null;
-        }
-    }
-
-    private SenderOptions<Integer, String> senderOptions() {
-        String bootstrapServers = this.applicationConfig.getKafkaBootStrapServers();
-
-        Map<String, Object> props = new HashMap<>();
-        props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
-        props.put(ProducerConfig.CLIENT_ID_CONFIG, "sample-producerx");
-        props.put(ProducerConfig.ACKS_CONFIG, "all");
-        props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, IntegerSerializer.class);
-        props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
-        return SenderOptions.create(props);
-    }
-
-    private SenderRecord<Integer, String, Integer> senderRecord(String data) {
-        final InfoType infoType = this.types.get(TYPE_ID);
-        int key = 1;
-        int correlationMetadata = 2;
-        return SenderRecord.create(new ProducerRecord<>(infoType.getKafkaInputTopic(), key, data), correlationMetadata);
-    }
-
-    private void sendDataToStream(Flux<SenderRecord<Integer, String, Integer>> dataToSend) {
-        final KafkaSender<Integer, String> sender = KafkaSender.create(senderOptions());
-
-        sender.send(dataToSend) //
-                .doOnError(e -> logger.error("Send failed", e)) //
-                .blockLast();
-
-        sender.close();
-
-    }
-
-    private void verifiedReceivedByConsumer(String... strings) {
-        ConsumerController.TestResults consumer = this.consumerController.testResults;
-        await().untilAsserted(() -> assertThat(consumer.receivedBodies.size()).isEqualTo(strings.length));
-        for (String s : strings) {
-            assertTrue(consumer.hasReceived(s));
-        }
-    }
-
-    @Test
-    void simpleCase() throws InterruptedException {
-        final String JOB_ID = "ID";
-
-        // Register producer, Register types
-        await().untilAsserted(() -> assertThat(icsSimulatorController.testResults.registrationInfo).isNotNull());
-        assertThat(icsSimulatorController.testResults.registrationInfo.supportedTypeIds).hasSize(this.types.size());
-
-        this.icsSimulatorController.addJob(consumerJobInfo(null, Duration.ZERO, 0, 1), JOB_ID, restClient());
-        await().untilAsserted(() -> assertThat(this.jobs.size()).isEqualTo(1));
-
-        Thread.sleep(4000);
-        var dataToSend = Flux.just(senderRecord("Message"));
-        sendDataToStream(dataToSend);
-
-        verifiedReceivedByConsumer("Message");
-
-        this.icsSimulatorController.deleteJob(JOB_ID, restClient());
-
-        await().untilAsserted(() -> assertThat(this.jobs.size()).isZero());
-        await().untilAsserted(() -> assertThat(this.kafkaTopicConsumers.getConsumers().keySet()).isEmpty());
-    }
-
-    @Test
-    void kafkaIntegrationTest() throws Exception {
-        final String JOB_ID1 = "ID1";
-        final String JOB_ID2 = "ID2";
-
-        // Register producer, Register types
-        await().untilAsserted(() -> assertThat(icsSimulatorController.testResults.registrationInfo).isNotNull());
-        assertThat(icsSimulatorController.testResults.registrationInfo.supportedTypeIds).hasSize(this.types.size());
-
-        // Create two jobs. One buffering and one with a filter
-        this.icsSimulatorController.addJob(consumerJobInfo(null, Duration.ofMillis(400), 10, 20), JOB_ID1,
-                restClient());
-        this.icsSimulatorController.addJob(consumerJobInfo("^Message_1$", Duration.ZERO, 0, 1), JOB_ID2, restClient());
-
-        await().untilAsserted(() -> assertThat(this.jobs.size()).isEqualTo(2));
-
-        Thread.sleep(2000);
-        var dataToSend = Flux.range(1, 3).map(i -> senderRecord("Message_" + i)); // Message_1, Message_2 etc.
-        sendDataToStream(dataToSend);
-
-        verifiedReceivedByConsumer("Message_1", "[\"Message_1\", \"Message_2\", \"Message_3\"]");
-
-        // Delete the jobs
-        this.icsSimulatorController.deleteJob(JOB_ID1, restClient());
-        this.icsSimulatorController.deleteJob(JOB_ID2, restClient());
-
-        await().untilAsserted(() -> assertThat(this.jobs.size()).isZero());
-        await().untilAsserted(() -> assertThat(this.kafkaTopicConsumers.getConsumers().keySet()).isEmpty());
-    }
-
-    @Test
-    void kafkaIOverflow() throws InterruptedException {
-        final String JOB_ID1 = "ID1";
-        final String JOB_ID2 = "ID2";
-
-        // Register producer, Register types
-        await().untilAsserted(() -> assertThat(icsSimulatorController.testResults.registrationInfo).isNotNull());
-        assertThat(icsSimulatorController.testResults.registrationInfo.supportedTypeIds).hasSize(this.types.size());
-
-        // Create two jobs.
-        this.icsSimulatorController.addJob(consumerJobInfo(null, Duration.ofMillis(400), 1000, 1), JOB_ID1,
-                restClient());
-        this.icsSimulatorController.addJob(consumerJobInfo(null, Duration.ZERO, 0, 1), JOB_ID2, restClient());
-
-        await().untilAsserted(() -> assertThat(this.jobs.size()).isEqualTo(2));
-
-        var dataToSend = Flux.range(1, 1000000).map(i -> senderRecord("Message_" + i)); // Message_1, Message_2 etc.
-        sendDataToStream(dataToSend); // this should overflow
-
-        KafkaJobDataConsumer consumer = kafkaTopicConsumers.getConsumers().get(TYPE_ID).iterator().next();
-        await().untilAsserted(() -> assertThat(consumer.isRunning()).isFalse());
-        this.consumerController.testResults.reset();
-
-        this.icsSimulatorController.deleteJob(JOB_ID2, restClient()); // Delete one job
-        kafkaTopicConsumers.restartNonRunningTopics();
-        Thread.sleep(1000); // Restarting the input seems to take some asynch time
-
-        dataToSend = Flux.just(senderRecord("Howdy\""));
-        sendDataToStream(dataToSend);
-
-        verifiedReceivedByConsumer("[\"Howdy\\\"\"]");
-
-        // Delete the jobs
-        this.icsSimulatorController.deleteJob(JOB_ID1, restClient());
-        this.icsSimulatorController.deleteJob(JOB_ID2, restClient());
-
-        await().untilAsserted(() -> assertThat(this.jobs.size()).isZero());
-        await().untilAsserted(() -> assertThat(this.kafkaTopicConsumers.getConsumers().keySet()).isEmpty());
-    }
-
-}
diff --git a/dmaap-adaptor-java/src/test/resources/test_application_configuration.json b/dmaap-adaptor-java/src/test/resources/test_application_configuration.json
deleted file mode 100644 (file)
index 32e6c32..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-   "types": [
-      {
-         "id": "DmaapInformationType",
-         "dmaapTopicUrl": "/dmaap-topic-1",
-         "useHttpProxy": false
-      },
-      {
-         "id": "KafkaInformationType",
-         "kafkaInputTopic": "TutorialTopic",
-         "useHttpProxy": false
-      }
-   ]
-}
\ No newline at end of file
index 7c6b6c2..27cd338 100644 (file)
@@ -21,7 +21,6 @@ The core Non-RT RIC consists of several parts, with available APIs described in
 
 * The A1 Policy Management Service
 * The Information Coordinator Service
-* DMaaP Adaptor
 * K8S Helm Chart LCM Manager (Initial) **<ToDo>**
 
 A1 Policy Management Service
@@ -42,22 +41,6 @@ The API is also described in Swagger-JSON and YAML:
 
    "A1 Information Coordination Service API", ":download:`link <../information-coordinator-service/api/ics-api.json>`", ":download:`link <../information-coordinator-service/api/ics-api.yaml>`"
 
-DMaaP Adaptor
-=============
-
-The DMaaP Adaptor provides support for push delivery of any data received from DMaaP or Kafka.
-
-See `DMaaP Adaptor API <./dmaap-adaptor-api.html>`_ for full details of the API.
-
-The API is also described in Swagger-JSON and YAML:
-
-
-.. csv-table::
-   :header: "API name", "|swagger-icon|", "|yaml-icon|"
-   :widths: 10,5, 5
-
-   "DMaaP Adaptor API", ":download:`link <../dmaap-adaptor-java/api/api.json>`", ":download:`link <../dmaap-adaptor-java/api/api.yaml>`"
-
 K8S Helm Chart LCM Manager (Initial)
 ====================================
 
index 21bfee9..bef5392 100644 (file)
@@ -9,8 +9,6 @@ linkcheck_ignore = [
     'http://127.0.0.1.*',
     'https://gerrit.o-ran-sc.org.*',
     './ics-api.html', #Generated file that doesn't exist at link check.
-    './dmaap-adaptor-api.html', #Generated file that doesn't exist at link check.
-    './dmaap-mediator-producer-api.html' #Generated file that doesn't exist at link check.
 ]
 
 extensions = ['sphinxcontrib.redoc', 'sphinx.ext.intersphinx',]
@@ -21,11 +19,6 @@ redoc = [
                 'page': 'ics-api',
                 'spec': '../information-coordinator-service/api/ics-api.json',
                 'embed': True,
-            },
-            {
-                'name': 'DMaaP Adaptor API',
-                'page': 'dmaap-adaptor-api',
-                'spec': '../dmaap-adaptor-java/api/api.json',
             }
         ]
 
index 94c7d2d..f61a867 100644 (file)
@@ -58,16 +58,6 @@ Then start the container by running the following command:
     | docker run nonrtric-information-coordinator-service                |
     +--------------------------------------------------------------------+
 
-DMaaP Adaptor Service
----------------------
-
-This Java implementation is run in the same way as the Information Coordinator Service.
-
-The following properties in the application.yaml file have to be modified:
-* server.ssl.key-store=./config/keystore.jks
-* app.webclient.trust-store=./config/truststore.jks
-* app.configuration-filepath=./src/test/resources/test_application_configuration.json
-
 O-DU & O-RU fronthaul recovery
 ------------------------------
 
index 2271707..2d3ee66 100644 (file)
@@ -184,7 +184,7 @@ Information jobs defined using ICS then allow information consumers to retrieve
 
 There are two alternative implementations to allow Information Consumers to consume DMaaP or Kafka events as coordinated Information Jobs.
 
-1. A version implemented in Java Spring (DMaaP Adaptor Service).
+1. A version implemented in Java Spring (DMaaP Adaptor Service), see `DMaaP Adapter documentation site <https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-plt-dmaapadapter/en/latest/>`_.
 2. A version implemented in Go (DMaaP Mediator Producer), see `DMaaP Mediator Producer documentation site <https://docs.o-ran-sc.org/projects/o-ran-sc-nonrtric-plt-dmaapmediatorproducer>`_.
 
 Initial Non-RT-RIC App Catalogue
index 9366cab..223bf4d 100644 (file)
@@ -118,24 +118,6 @@ Version history SDNC A1 Controller
 +------------+----------+------------------+--------------------+
 
 
-Version history DMaaP Adator
-============================
-
-+------------+----------+------------------+-----------------+
-| **Date**   | **Ver.** | **Author**       | **Comment**     |
-|            |          |                  |                 |
-+------------+----------+------------------+-----------------+
-| 2021-12-13 | 1.0.0    | Henrik Andersson | E Release       |
-|            |          |                  | Initial version |
-+------------+----------+------------------+-----------------+
-| 2022-02-07 | 1.0.1    | Henrik Andersson | E Maintenance   |
-|            |          |                  | Release         |
-|            |          |                  | Non root user   |
-|            |          |                  | in Docker       |
-|            |          |                  | Bugfixes        |
-+------------+----------+------------------+-----------------+
-
-
 Version history usecase O-RU Front-Haul Recovery Script version
 ===============================================================
 
diff --git a/information-coordinator-service/api/README.md b/information-coordinator-service/api/README.md
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/pom.xml b/pom.xml
index 3ec1617..469b04e 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -36,7 +36,6 @@
         <module>a1-policy-management-service</module>
         <module>information-coordinator-service</module>
         <module>helm-manager</module>
-        <module>dmaap-adaptor-java</module>
     </modules>
     <build>
         <plugins>