diff options
author | Michal Banka <michal.banka@nokia.com> | 2021-03-31 13:43:34 +0200 |
---|---|---|
committer | Michal Banka <michal.banka@nokia.com> | 2021-04-01 10:51:50 +0200 |
commit | 516014379cdc27d163be223bb8ce9f87d72dea1f (patch) | |
tree | 680fa171ca6b9fa2b439f0ea727b96618c8ca158 | |
parent | c398d5afd86d1aedab9cbd7b8f8c3d7b48eb2e2b (diff) |
Add stndDefined domain to HV-VES1.8.0
- Updated SDK dependency to 1.8.2 so HV-VES recognizes
stndDefinedNamespace field during events deserialization
- Added new domain stndDefined
- Added routings specific for stndDefined events which is controled
by stndDefinedNamespace field, not domain
- Bumped HV-VES to 1.8.0
Signed-off-by: Michal Banka <michal.banka@nokia.com>
Change-Id: Ia27f2de7a4b64df5e8a182888006f7e8a941ca63
Issue-ID: DCAEGEN2-2702
30 files changed, 229 insertions, 109 deletions
diff --git a/Changelog.md b/Changelog.md index 5931e540..6db7aa27 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,8 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [1.8.0] - 31/03/2021 + - [DCAEGEN2-2701](https://jira.onap.org/browse/DCAEGEN2-2701) - Add stndDefined domain and stndDefined routing + ## [1.7.0] - 29/03/2021 - - [DCAEGEN2-2696](https://jira.onap.org/browse/DCAEGEN2-2696) - Update all HV-VES dependencies to newest versions + - [DCAEGEN2-2696](https://jira.onap.org/browse/DCAEGEN2-2696) - Update all HV-VES dependencies to newest versions ## [1.6.0] - 17/12/2020 - - [DCAEGEN2-2537](https://jira.onap.org/browse/DCAEGEN2-2537) - Upgrade Reactor and SpringBoot in DFC, PM-Mapper, BBS
\ No newline at end of file + - [DCAEGEN2-2537](https://jira.onap.org/browse/DCAEGEN2-2537) - Upgrade Reactor and SpringBoot in DFC, PM-Mapper, BBS
\ No newline at end of file diff --git a/build/hv-collector-analysis/pom.xml b/build/hv-collector-analysis/pom.xml index 618667ff..9f25f9d0 100644 --- a/build/hv-collector-analysis/pom.xml +++ b/build/hv-collector-analysis/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2018 NOKIA + ~ Copyright (C) 2018-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-build</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/build/hv-collector-coverage/pom.xml b/build/hv-collector-coverage/pom.xml index eb2c6c2f..78196d62 100644 --- a/build/hv-collector-coverage/pom.xml +++ b/build/hv-collector-coverage/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2018-2019 NOKIA + ~ Copyright (C) 2018-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-build</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/build/pom.xml b/build/pom.xml index 4b743efb..e51dbb0f 100644 --- a/build/pom.xml +++ b/build/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2018 NOKIA + ~ Copyright (C) 2018-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>ves-hv-collector</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/dpo/spec/hv-ves-collector.componentspec.json b/dpo/spec/hv-ves-collector.componentspec.json index 7937e19b..af24a45c 100644 --- a/dpo/spec/hv-ves-collector.componentspec.json +++ b/dpo/spec/hv-ves-collector.componentspec.json @@ -128,7 +128,7 @@ "artifacts": [ { "type": "docker image", - "uri": "nexus.onap.org:10001/onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-main:1.6.0" + "uri": "nexus.onap.org:10001/onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-main:1.8.0" } ] } @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2018-2019 NOKIA + ~ Copyright (C) 2018-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>ves-hv-collector</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <name>dcaegen2-collectors-veshv</name> <description>VES HighVolume Collector</description> <packaging>pom</packaging> @@ -77,7 +77,7 @@ <build-helper-maven-plugin.version>3.2.0</build-helper-maven-plugin.version> <jacoco.version>0.8.3</jacoco.version> <detekt.version>1.15.0</detekt.version> - <sdk.version>1.8.0</sdk.version> + <sdk.version>1.8.2</sdk.version> <!-- Protocol buffers --> <protobuf.version>4.0.0-rc-2</protobuf.version> diff --git a/sources/hv-collector-commandline/pom.xml b/sources/hv-collector-commandline/pom.xml index 0048337b..5346cbff 100644 --- a/sources/hv-collector-commandline/pom.xml +++ b/sources/hv-collector-commandline/pom.xml @@ -7,7 +7,7 @@ <parent> <artifactId>hv-collector-sources</artifactId> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> </parent> <artifactId>hv-collector-commandline</artifactId> diff --git a/sources/hv-collector-configuration/pom.xml b/sources/hv-collector-configuration/pom.xml index 41284421..542ed4fb 100644 --- a/sources/hv-collector-configuration/pom.xml +++ b/sources/hv-collector-configuration/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2019 NOKIA + ~ Copyright (C) 2019-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> </parent> <artifactId>hv-collector-configuration</artifactId> diff --git a/sources/hv-collector-core/pom.xml b/sources/hv-collector-core/pom.xml index 0f1d2c3b..95820d07 100644 --- a/sources/hv-collector-core/pom.xml +++ b/sources/hv-collector-core/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2018-2019 NOKIA + ~ Copyright (C) 2018-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/Router.kt b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/Router.kt index c4e877bf..dfa40006 100644 --- a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/Router.kt +++ b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/Router.kt @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * dcaegen2-collectors-veshv * ================================================================================ - * Copyright (C) 2018-2019 NOKIA + * Copyright (C) 2018-2021 NOKIA * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,15 +20,17 @@ package org.onap.dcae.collectors.veshv.impl import arrow.core.None +import arrow.core.Option import arrow.core.toOption import org.onap.dcae.collectors.veshv.boundary.Metrics import org.onap.dcae.collectors.veshv.boundary.Sink import org.onap.dcae.collectors.veshv.boundary.SinkFactory import org.onap.dcae.collectors.veshv.config.api.model.Route import org.onap.dcae.collectors.veshv.config.api.model.Routing -import org.onap.dcae.collectors.veshv.domain.logging.ClientContext import org.onap.dcae.collectors.veshv.domain.RoutedMessage +import org.onap.dcae.collectors.veshv.domain.VesEventDomain import org.onap.dcae.collectors.veshv.domain.VesMessage +import org.onap.dcae.collectors.veshv.domain.logging.ClientContext import org.onap.dcae.collectors.veshv.model.ConsumedMessage import org.onap.dcae.collectors.veshv.model.MessageDropCause import org.onap.dcae.collectors.veshv.utils.logging.Logger @@ -36,9 +38,9 @@ import org.onap.ves.VesEventOuterClass.CommonEventHeader import reactor.core.publisher.Flux internal class Router internal constructor(private val routing: Routing, - private val messageSinks: Map<String, Lazy<Sink>>, - private val ctx: ClientContext, - private val metrics: Metrics) { + private val messageSinks: Map<String, Lazy<Sink>>, + private val ctx: ClientContext, + private val metrics: Metrics) { constructor(routing: Routing, sinkFactory: SinkFactory, ctx: ClientContext, @@ -70,8 +72,14 @@ internal class Router internal constructor(private val routing: Routing, } - private fun routeFor(header: CommonEventHeader) = - routing.find { it.domain == header.domain }.toOption() + private fun routeFor(header: CommonEventHeader): Option<Route> = + routing.find { + if (header.domain == VesEventDomain.STND_DEFINED.domainName) + it.domain == header.stndDefinedNamespace + else { + it.domain == header.domain + } + }.toOption() private fun messageSinkFor(sinkTopic: String) = messageSinks .getOrElse(sinkTopic) { diff --git a/sources/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt b/sources/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt index 533581d5..ad655f68 100644 --- a/sources/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt +++ b/sources/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * dcaegen2-collectors-veshv * ================================================================================ - * Copyright (C) 2018-2019 NOKIA + * Copyright (C) 2018-2021 NOKIA * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,9 +33,8 @@ import org.onap.dcae.collectors.veshv.config.api.model.Route import org.onap.dcae.collectors.veshv.config.api.model.Routing import org.onap.dcae.collectors.veshv.boundary.Sink import org.onap.dcae.collectors.veshv.domain.RoutedMessage -import org.onap.dcae.collectors.veshv.domain.VesEventDomain.PERF3GPP -import org.onap.dcae.collectors.veshv.domain.VesEventDomain.HEARTBEAT -import org.onap.dcae.collectors.veshv.domain.VesEventDomain.SYSLOG +import org.onap.dcae.collectors.veshv.domain.VesEventDomain +import org.onap.dcae.collectors.veshv.domain.VesEventStndDefinedNamespace import org.onap.dcae.collectors.veshv.domain.logging.ClientContext import org.onap.dcae.collectors.veshv.domain.VesMessage import org.onap.dcae.collectors.veshv.model.SuccessfullyConsumedMessage @@ -55,10 +54,12 @@ object RouterTest : Spek({ describe("Router") { whenever(perf3gppSinkMock.topicName()).thenReturn(perf3gppTopic) + whenever(ves3gppHeartbeatSinkMock.topicName()).thenReturn(ves3gppHeartbeatTopic) whenever(syslogSinkMock.topicName()).thenReturn(syslogTopic) val messageSinkMap = mapOf( Pair(perf3gppTopic, lazyOf(messageSinkMock)), + Pair(ves3gppHeartbeatTopic, lazyOf(messageSinkMock)), Pair(syslogTopic, lazyOf(messageSinkMock)) ) @@ -72,7 +73,7 @@ object RouterTest : Spek({ it("should be properly routed") { val result = cut.route(perf3gppMessage) - assertThat(result).isNotNull() + assertThat(result).isNotNull StepVerifier.create(result) .expectNext(successfullyConsumedPerf3gppMessage) .verifyComplete() @@ -97,8 +98,23 @@ object RouterTest : Spek({ } } + on("message with existing stndDefined route (ves3gppHeartbeat)") { + whenever(messageSinkMock.send(routedVes3gppHeartbeatMessage)) + .thenReturn(Flux.just(successfullyConsumedVes3gppHeartbeatMessage)) + val result = cut.route(ves3gppHeartbeatMessage) + + it("should be properly routed") { + StepVerifier.create(result) + .expectNext(successfullyConsumedVes3gppHeartbeatMessage) + .verifyComplete() + + verify(ves3gppHeartbeatSinkMock).topicName() + verify(messageSinkMock).send(routedVes3gppHeartbeatMessage) + } + } + on("message with unknown route") { - val message = VesMessage(commonHeader(HEARTBEAT), emptyWireProtocolFrame()) + val message = VesMessage(commonHeader(VesEventDomain.HEARTBEAT), emptyWireProtocolFrame()) val result = cut.route(message) it("should not have route available") { @@ -113,23 +129,34 @@ object RouterTest : Spek({ private fun router(routing: Routing, kafkaPublisherMap: Map<String, Lazy<Sink>>) = Router(routing, kafkaPublisherMap, ClientContext(), mock()) -private val perf3gppTopic = "PERF_PERF" +private const val perf3gppTopic = "PERF_PERF" private val perf3gppSinkMock = mock<KafkaSink>() -private val default3gppRoute = Route(PERF3GPP.domainName, perf3gppSinkMock) +private val default3gppRoute = Route(VesEventDomain.PERF3GPP.domainName, perf3gppSinkMock) + +private const val ves3gppHeartbeatTopic = "SEC_3GPP_HEARTBEAT_OUTPUT" +private val ves3gppHeartbeatSinkMock = mock<KafkaSink>() +private val defaultVes3gppHeartbeatRoute = + Route(VesEventStndDefinedNamespace.VES_3GPP_HEARTBEAT.stndDefinedNamespace, ves3gppHeartbeatSinkMock) -private val syslogTopic = "SYS_LOG" +private const val syslogTopic = "SYS_LOG" private val syslogSinkMock = mock<KafkaSink>() -private val defaultSyslogRoute = Route(SYSLOG.domainName, syslogSinkMock) +private val defaultSyslogRoute = Route(VesEventDomain.SYSLOG.domainName, syslogSinkMock) + +private val defaultRouting = listOf(default3gppRoute, defaultVes3gppHeartbeatRoute, defaultSyslogRoute) -private val defaultRouting = listOf(default3gppRoute, defaultSyslogRoute) private val messageSinkMock = mock<Sink>() private val default_partition = None -private val perf3gppMessage = VesMessage(commonHeader(PERF3GPP), emptyWireProtocolFrame()) +private val perf3gppMessage = VesMessage(commonHeader(VesEventDomain.PERF3GPP), emptyWireProtocolFrame()) private val routedPerf3GppMessage = RoutedMessage(perf3gppMessage, perf3gppTopic, default_partition) private val successfullyConsumedPerf3gppMessage = SuccessfullyConsumedMessage(routedPerf3GppMessage) -private val syslogMessage = VesMessage(commonHeader(SYSLOG), emptyWireProtocolFrame()) +private val ves3gppHeartbeatMessage = VesMessage(commonHeader(domain = VesEventDomain.STND_DEFINED, + stndDefinedNamespace = VesEventStndDefinedNamespace.VES_3GPP_HEARTBEAT), emptyWireProtocolFrame()) +private val routedVes3gppHeartbeatMessage = RoutedMessage(ves3gppHeartbeatMessage, ves3gppHeartbeatTopic, default_partition) +private val successfullyConsumedVes3gppHeartbeatMessage = SuccessfullyConsumedMessage(routedVes3gppHeartbeatMessage) + +private val syslogMessage = VesMessage(commonHeader(VesEventDomain.SYSLOG), emptyWireProtocolFrame()) private val routedSyslogMessage = RoutedMessage(syslogMessage, syslogTopic, default_partition) private val successfullyConsumedSyslogMessage = SuccessfullyConsumedMessage(routedSyslogMessage)
\ No newline at end of file diff --git a/sources/hv-collector-ct/pom.xml b/sources/hv-collector-ct/pom.xml index b0737f85..953f84c1 100644 --- a/sources/hv-collector-ct/pom.xml +++ b/sources/hv-collector-ct/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2018 NOKIA + ~ Copyright (C) 2018-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/sources/hv-collector-dcae-app-simulator/pom.xml b/sources/hv-collector-dcae-app-simulator/pom.xml index 45771e4d..797a70a1 100644 --- a/sources/hv-collector-dcae-app-simulator/pom.xml +++ b/sources/hv-collector-dcae-app-simulator/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2018 NOKIA + ~ Copyright (C) 2018-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/sources/hv-collector-domain/pom.xml b/sources/hv-collector-domain/pom.xml index 635f2dfc..1ff21312 100644 --- a/sources/hv-collector-domain/pom.xml +++ b/sources/hv-collector-domain/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2018-2019 NOKIA + ~ Copyright (C) 2018-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> </parent> <artifactId>hv-collector-domain</artifactId> diff --git a/sources/hv-collector-domain/src/main/kotlin/org/onap/dcae/collectors/veshv/domain/VesEventDomain.kt b/sources/hv-collector-domain/src/main/kotlin/org/onap/dcae/collectors/veshv/domain/VesEventDomain.kt index 0b18337d..b5b3d0ab 100644 --- a/sources/hv-collector-domain/src/main/kotlin/org/onap/dcae/collectors/veshv/domain/VesEventDomain.kt +++ b/sources/hv-collector-domain/src/main/kotlin/org/onap/dcae/collectors/veshv/domain/VesEventDomain.kt @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * dcaegen2-collectors-veshv * ================================================================================ - * Copyright (C) 2018 NOKIA + * Copyright (C) 2018-2021 NOKIA * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ enum class VesEventDomain(val domainName: String) { PNF_REGISTRATION("pnfRegistration"), SIP_SIGNALING("sipSignaling"), STATE_CHANGE("stateChange"), + STND_DEFINED("stndDefined"), SYSLOG("syslog"), THRESHOLD_CROSSING_ALERT("thresholdCrossingAlert"), VOICE_QUALITY("voiceQuality"), diff --git a/sources/hv-collector-domain/src/main/kotlin/org/onap/dcae/collectors/veshv/domain/VesEventStndDefinedNamespace.kt b/sources/hv-collector-domain/src/main/kotlin/org/onap/dcae/collectors/veshv/domain/VesEventStndDefinedNamespace.kt new file mode 100644 index 00000000..05c7684e --- /dev/null +++ b/sources/hv-collector-domain/src/main/kotlin/org/onap/dcae/collectors/veshv/domain/VesEventStndDefinedNamespace.kt @@ -0,0 +1,27 @@ +/* + * ============LICENSE_START======================================================= + * dcaegen2-collectors-veshv + * ================================================================================ + * Copyright (C) 2018-2021 NOKIA + * ================================================================================ + * 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.onap.dcae.collectors.veshv.domain + +enum class VesEventStndDefinedNamespace(val stndDefinedNamespace: String) { + VES_3GPP_FAULT_SUPERVISION("ves-3gpp-fault-supervision"), + VES_3GPP_PROVISIONING("ves-3gpp-provisioning"), + VES_3GPP_HEARTBEAT("ves-3gpp-heartbeat"), + VES_3GPP_PERFORMANCE_ASSURANCE("ves-3gpp-performance-assurance") +} diff --git a/sources/hv-collector-health-check/pom.xml b/sources/hv-collector-health-check/pom.xml index f215d4c0..ed1bd2a4 100644 --- a/sources/hv-collector-health-check/pom.xml +++ b/sources/hv-collector-health-check/pom.xml @@ -15,7 +15,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> </parent> <artifactId>hv-collector-health-check</artifactId> diff --git a/sources/hv-collector-kafka-consumer/pom.xml b/sources/hv-collector-kafka-consumer/pom.xml index 6b6f0251..8537e0ef 100644 --- a/sources/hv-collector-kafka-consumer/pom.xml +++ b/sources/hv-collector-kafka-consumer/pom.xml @@ -15,7 +15,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/sources/hv-collector-kafka/pom.xml b/sources/hv-collector-kafka/pom.xml index 67303ec3..cfeeb33f 100644 --- a/sources/hv-collector-kafka/pom.xml +++ b/sources/hv-collector-kafka/pom.xml @@ -15,7 +15,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/sources/hv-collector-main/pom.xml b/sources/hv-collector-main/pom.xml index 75d18728..91d30c6f 100644 --- a/sources/hv-collector-main/pom.xml +++ b/sources/hv-collector-main/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2018 NOKIA + ~ Copyright (C) 2018-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> </parent> <artifactId>hv-collector-main</artifactId> diff --git a/sources/hv-collector-server/pom.xml b/sources/hv-collector-server/pom.xml index bfc5cbb5..a311c13b 100644 --- a/sources/hv-collector-server/pom.xml +++ b/sources/hv-collector-server/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2019 NOKIA + ~ Copyright (C) 2019-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/sources/hv-collector-ssl/pom.xml b/sources/hv-collector-ssl/pom.xml index 160d17da..1e7a235c 100644 --- a/sources/hv-collector-ssl/pom.xml +++ b/sources/hv-collector-ssl/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2018 NOKIA + ~ Copyright (C) 2018-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/sources/hv-collector-test-utils/pom.xml b/sources/hv-collector-test-utils/pom.xml index d1e75660..67eee86a 100644 --- a/sources/hv-collector-test-utils/pom.xml +++ b/sources/hv-collector-test-utils/pom.xml @@ -14,7 +14,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/sources/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt b/sources/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt index 3013e904..2583d219 100644 --- a/sources/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt +++ b/sources/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * dcaegen2-collectors-veshv * ================================================================================ - * Copyright (C) 2018 NOKIA + * Copyright (C) 2018-2021 NOKIA * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import com.google.protobuf.MessageLite import org.onap.dcae.collectors.veshv.domain.ByteData import org.onap.dcae.collectors.veshv.domain.PayloadContentType import org.onap.dcae.collectors.veshv.domain.VesEventDomain -import org.onap.dcae.collectors.veshv.domain.VesEventDomain.PERF3GPP +import org.onap.dcae.collectors.veshv.domain.VesEventStndDefinedNamespace import org.onap.dcae.collectors.veshv.domain.WireFrameMessage import org.onap.ves.VesEventOuterClass import org.onap.ves.VesEventOuterClass.CommonEventHeader @@ -34,7 +34,7 @@ import java.time.Instant import java.time.temporal.Temporal import java.util.UUID.randomUUID -fun vesEvent(domain: VesEventDomain = PERF3GPP, +fun vesEvent(domain: VesEventDomain = VesEventDomain.PERF3GPP, id: String = randomUUID().toString(), eventFields: ByteString = ByteString.EMPTY, vesEventListenerVersion: String = "7.0.2" @@ -50,32 +50,37 @@ fun vesEvent(commonEventHeader: CommonEventHeader, .setEventFields(eventFields) .build() -fun commonHeader(domain: VesEventDomain = PERF3GPP, +fun commonHeader(domain: VesEventDomain = VesEventDomain.PERF3GPP, id: String = randomUUID().toString(), vesEventListenerVersion: String = "7.0.2", priority: Priority = Priority.NORMAL, - lastEpochMicrosec: Long = 100000005 -): CommonEventHeader = - CommonEventHeader.newBuilder() - .setVersion("sample-version") - .setDomain(domain.domainName) - .setSequence(1) - .setPriority(priority) - .setEventId(id) - .setEventName("sample-event-name") - .setEventType("sample-event-type") - .setStartEpochMicrosec(100000000) - .setLastEpochMicrosec(lastEpochMicrosec) - .setNfNamingCode("sample-nf-naming-code") - .setNfcNamingCode("sample-nfc-naming-code") - .setNfVendorName("vendor-name") - .setReportingEntityId(ByteString.copyFromUtf8("sample-reporting-entity-id")) - .setReportingEntityName("sample-reporting-entity-name") - .setSourceId(ByteString.copyFromUtf8("sample-source-id")) - .setSourceName("sample-source-name") - .setTimeZoneOffset("+1") - .setVesEventListenerVersion(vesEventListenerVersion) - .build() + lastEpochMicrosec: Long = 100000005, + stndDefinedNamespace: VesEventStndDefinedNamespace? = null): CommonEventHeader { + val builder = CommonEventHeader.newBuilder().setVersion("sample-version") + .setDomain(domain.domainName) + .setSequence(1) + .setPriority(priority) + .setEventId(id) + .setEventName("sample-event-name") + .setEventType("sample-event-type") + .setStartEpochMicrosec(100000000) + .setLastEpochMicrosec(lastEpochMicrosec) + .setNfNamingCode("sample-nf-naming-code") + .setNfcNamingCode("sample-nfc-naming-code") + .setNfVendorName("vendor-name") + .setReportingEntityId(ByteString.copyFromUtf8("sample-reporting-entity-id")) + .setReportingEntityName("sample-reporting-entity-name") + .setSourceId(ByteString.copyFromUtf8("sample-source-id")) + .setSourceName("sample-source-name") + .setTimeZoneOffset("+1") + .setVesEventListenerVersion(vesEventListenerVersion) + + stndDefinedNamespace?.let { + builder.setStndDefinedNamespace(stndDefinedNamespace.stndDefinedNamespace) + } + return builder.build() +} + fun emptyWireProtocolFrame(): WireFrameMessage = wireProtocolFrameWithPayloadSize(0) diff --git a/sources/hv-collector-utils/pom.xml b/sources/hv-collector-utils/pom.xml index 2718705e..83c41af3 100644 --- a/sources/hv-collector-utils/pom.xml +++ b/sources/hv-collector-utils/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2018-2019 NOKIA + ~ Copyright (C) 2018-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/sources/hv-collector-ves-message-generator/pom.xml b/sources/hv-collector-ves-message-generator/pom.xml index 0fa7265a..3fe2a95e 100644 --- a/sources/hv-collector-ves-message-generator/pom.xml +++ b/sources/hv-collector-ves-message-generator/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2018 NOKIA + ~ Copyright (C) 2018-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/sources/hv-collector-xnf-simulator/pom.xml b/sources/hv-collector-xnf-simulator/pom.xml index 73057dce..5c32e158 100644 --- a/sources/hv-collector-xnf-simulator/pom.xml +++ b/sources/hv-collector-xnf-simulator/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2018 NOKIA + ~ Copyright (C) 2018-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/sources/pom.xml b/sources/pom.xml index 9b227382..964ff456 100644 --- a/sources/pom.xml +++ b/sources/pom.xml @@ -3,7 +3,7 @@ ~ ============LICENSE_START======================================================= ~ dcaegen2-collectors-veshv ~ ================================================================================ - ~ Copyright (C) 2018 NOKIA + ~ Copyright (C) 2018-2021 NOKIA ~ ================================================================================ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>ves-hv-collector</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> @@ -126,7 +126,7 @@ <dependency> <groupId>${project.groupId}</groupId> <artifactId>hv-collector-analysis</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> </dependency> </dependencies> </plugin> diff --git a/tools/development/docker-compose.yml b/tools/development/docker-compose.yml index 1f655df2..df8fee0b 100644 --- a/tools/development/docker-compose.yml +++ b/tools/development/docker-compose.yml @@ -56,22 +56,12 @@ services: consul-config: image: docker.io/consul:1.0.6 restart: on-failure - command: ["kv", "put", "-http-addr=http://consul-server:8500", "dcae-hv-ves-collector", '{ - "streams_publishes": { - "perf3gpp": { - "type": "kafka", - "aaf_credentials": { - "username": "admin", - "password": "admin_secret" - }, - "kafka_info": { - "bootstrap_servers": "message-router-kafka-0:9093", - "topic_name": "HV_VES_PERF3GPP" - } - } - } - }' - ] + command: "kv put -http-addr=http://consul-server:8500 dcae-hv-ves-collector '@/home/consul/routing.json'" + volumes: + - type: bind + source: ./routing.json + target: /home/consul/routing.json + read_only: true depends_on: - consul-server @@ -89,7 +79,7 @@ services: # ves-hv-collector: - image: onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-main:1.7.0-SNAPSHOT + image: onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-main:1.8.0-SNAPSHOT ports: - "6060:6060" - "6061:6061/tcp" @@ -120,7 +110,7 @@ services: # xnf-simulator: - image: onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-xnf-simulator:1.7.0-SNAPSHOT + image: onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-xnf-simulator:1.8.0-SNAPSHOT ports: - "6062:6062/tcp" - "6063:6063" @@ -144,12 +134,12 @@ services: - ../ssl/:/etc/ves-hv/ dcae-app-simulator: - image: onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-dcae-app-simulator:1.7.0-SNAPSHOT + image: onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-dcae-app-simulator:1.8.0-SNAPSHOT ports: - "6064:6064/tcp" command: ["--listen-port", "6064", "--kafka-bootstrap-servers", "message-router-kafka-0:9092", - "--kafka-topics", "HV_VES_PERF3GPP"] + "--kafka-topics", "HV_VES_PERF3GPP,SEC_3GPP_FAULTSUPERVISION_OUTPUT,SEC_3GPP_PROVISIONING_OUTPUT,SEC_3GPP_HEARTBEAT_OUTPUT,SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT"] depends_on: - message-router-kafka-0 diff --git a/tools/development/routing.json b/tools/development/routing.json new file mode 100644 index 00000000..caeafd21 --- /dev/null +++ b/tools/development/routing.json @@ -0,0 +1,59 @@ +{ + "streams_publishes": { + "perf3gpp": { + "type": "kafka", + "aaf_credentials": { + "username": "admin", + "password": "admin_secret" + }, + "kafka_info": { + "bootstrap_servers": "message-router-kafka-0:9093", + "topic_name": "HV_VES_PERF3GPP" + } + }, + "ves-3gpp-fault-supervision": { + "type": "kafka", + "aaf_credentials": { + "username": "admin", + "password": "admin_secret" + }, + "kafka_info": { + "bootstrap_servers": "message-router-kafka-0:9093", + "topic_name": "SEC_3GPP_FAULTSUPERVISION_OUTPUT" + } + }, + "ves-3gpp-provisioning": { + "type": "kafka", + "aaf_credentials": { + "username": "admin", + "password": "admin_secret" + }, + "kafka_info": { + "bootstrap_servers": "message-router-kafka-0:9093", + "topic_name": "SEC_3GPP_PROVISIONING_OUTPUT" + } + }, + "ves-3gpp-heartbeat": { + "type": "kafka", + "aaf_credentials": { + "username": "admin", + "password": "admin_secret" + }, + "kafka_info": { + "bootstrap_servers": "message-router-kafka-0:9093", + "topic_name": "SEC_3GPP_HEARTBEAT_OUTPUT" + } + }, + "ves-3gpp-performance-assurance": { + "type": "kafka", + "aaf_credentials": { + "username": "admin", + "password": "admin_secret" + }, + "kafka_info": { + "bootstrap_servers": "message-router-kafka-0:9093", + "topic_name": "SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT" + } + } + } +}
\ No newline at end of file |