From 516014379cdc27d163be223bb8ce9f87d72dea1f Mon Sep 17 00:00:00 2001 From: Michal Banka Date: Wed, 31 Mar 2021 13:43:34 +0200 Subject: Add stndDefined domain to HV-VES - 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 Change-Id: Ia27f2de7a4b64df5e8a182888006f7e8a941ca63 Issue-ID: DCAEGEN2-2702 --- sources/hv-collector-commandline/pom.xml | 2 +- sources/hv-collector-configuration/pom.xml | 4 +- sources/hv-collector-core/pom.xml | 4 +- .../org/onap/dcae/collectors/veshv/impl/Router.kt | 22 ++++++--- .../onap/dcae/collectors/veshv/impl/RouterTest.kt | 53 +++++++++++++++----- sources/hv-collector-ct/pom.xml | 4 +- sources/hv-collector-dcae-app-simulator/pom.xml | 4 +- sources/hv-collector-domain/pom.xml | 4 +- .../dcae/collectors/veshv/domain/VesEventDomain.kt | 3 +- .../veshv/domain/VesEventStndDefinedNamespace.kt | 27 ++++++++++ sources/hv-collector-health-check/pom.xml | 2 +- sources/hv-collector-kafka-consumer/pom.xml | 2 +- sources/hv-collector-kafka/pom.xml | 2 +- sources/hv-collector-main/pom.xml | 4 +- sources/hv-collector-server/pom.xml | 4 +- sources/hv-collector-ssl/pom.xml | 4 +- sources/hv-collector-test-utils/pom.xml | 2 +- .../dcae/collectors/veshv/tests/utils/vesEvents.kt | 57 ++++++++++++---------- sources/hv-collector-utils/pom.xml | 4 +- sources/hv-collector-ves-message-generator/pom.xml | 4 +- sources/hv-collector-xnf-simulator/pom.xml | 4 +- sources/pom.xml | 6 +-- 22 files changed, 145 insertions(+), 77 deletions(-) create mode 100644 sources/hv-collector-domain/src/main/kotlin/org/onap/dcae/collectors/veshv/domain/VesEventStndDefinedNamespace.kt (limited to 'sources') 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 @@ hv-collector-sources org.onap.dcaegen2.collectors.hv-ves - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT hv-collector-commandline 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT hv-collector-configuration 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT .. 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>, - private val ctx: ClientContext, - private val metrics: Metrics) { + private val messageSinks: Map>, + 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 = + 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>) = Router(routing, kafkaPublisherMap, ClientContext(), mock()) -private val perf3gppTopic = "PERF_PERF" +private const val perf3gppTopic = "PERF_PERF" private val perf3gppSinkMock = mock() -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() +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() -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() 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT .. 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT .. 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT hv-collector-domain 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT hv-collector-health-check 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT .. 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT .. 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT hv-collector-main 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT .. 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT .. 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT .. 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT .. 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT .. 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 @@ org.onap.dcaegen2.collectors.hv-ves hv-collector-sources - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT .. 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 @@ org.onap.dcaegen2.collectors.hv-ves ves-hv-collector - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT .. @@ -126,7 +126,7 @@ ${project.groupId} hv-collector-analysis - 1.7.0-SNAPSHOT + 1.8.0-SNAPSHOT -- cgit 1.2.3-korg