From 482ff719edbb728827976622cef63c876cb6676e Mon Sep 17 00:00:00 2001 From: Izabela Zawadzka Date: Mon, 15 Apr 2019 13:03:45 +0200 Subject: Add internal modifiers to comply with new HvVesCustomRule Change-Id: I33ad24179d05ded58f6784544be9bbdd56210720 Signed-off-by: Izabela Zawadzka Issue-ID: DCAEGEN2-1438 --- .../kotlin/org/onap/dcae/collectors/veshv/impl/HeaderValidator.kt | 4 ++-- .../src/main/kotlin/org/onap/dcae/collectors/veshv/impl/Router.kt | 2 +- .../kotlin/org/onap/dcae/collectors/veshv/impl/ValidationError.kt | 2 +- .../org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt | 2 +- .../dcae/collectors/veshv/impl/adapters/kafka/ProtobufSerializer.kt | 2 +- .../dcae/collectors/veshv/impl/adapters/kafka/VesMessageSerializer.kt | 2 +- .../org/onap/dcae/collectors/veshv/impl/wire/WireFrameException.kt | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) (limited to 'sources/hv-collector-core/src/main/kotlin/org/onap/dcae') diff --git a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/HeaderValidator.kt b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/HeaderValidator.kt index 9d8accae..b88fe7fa 100644 --- a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/HeaderValidator.kt +++ b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/HeaderValidator.kt @@ -28,9 +28,9 @@ import org.onap.dcae.collectors.veshv.domain.headerRequiredFieldDescriptors import org.onap.dcae.collectors.veshv.domain.vesEventListenerVersionRegex import org.onap.ves.VesEventOuterClass.CommonEventHeader -typealias Validator = (CommonEventHeader) -> List +internal typealias Validator = (CommonEventHeader) -> List -object HeaderValidator { +internal object HeaderValidator { private val validators = (listOf(validateEventListenerVersion()) + headerRequiredFieldDescriptors.map { fieldDescriptor -> validateRequiredField(fieldDescriptor) 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 2190eba3..c4e877bf 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 @@ -35,7 +35,7 @@ import org.onap.dcae.collectors.veshv.utils.logging.Logger import org.onap.ves.VesEventOuterClass.CommonEventHeader import reactor.core.publisher.Flux -class Router internal constructor(private val routing: Routing, +internal class Router internal constructor(private val routing: Routing, private val messageSinks: Map>, private val ctx: ClientContext, private val metrics: Metrics) { diff --git a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/ValidationError.kt b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/ValidationError.kt index 56a77f4f..5724fed7 100644 --- a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/ValidationError.kt +++ b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/ValidationError.kt @@ -21,7 +21,7 @@ package org.onap.dcae.collectors.veshv.impl import org.onap.dcae.collectors.veshv.domain.vesEventListenerVersionRegex -sealed class ValidationError(val errorMessage: String) { +internal sealed class ValidationError(val errorMessage: String) { class MissingField(field: A) : ValidationError( "Invalid header - missing $field field" ) diff --git a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt index 8f66de2b..51eec024 100644 --- a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt +++ b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt @@ -30,7 +30,7 @@ import java.util.* * @author Jakub Dudycz * @since May 2018 */ -open class HttpAdapter(private val httpClient: HttpClient) { +internal open class HttpAdapter(private val httpClient: HttpClient) { open fun get(url: String, invocationId: UUID, queryParams: Map = emptyMap()): Mono = httpClient diff --git a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/kafka/ProtobufSerializer.kt b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/kafka/ProtobufSerializer.kt index 4e9932cc..8fc960d8 100644 --- a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/kafka/ProtobufSerializer.kt +++ b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/kafka/ProtobufSerializer.kt @@ -26,7 +26,7 @@ import org.apache.kafka.common.serialization.Serializer * @author Piotr Jaszczyk * @since June 2018 */ -class ProtobufSerializer : Serializer { +internal class ProtobufSerializer : Serializer { override fun configure(configs: MutableMap?, isKey: Boolean) { // no configuration } diff --git a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/kafka/VesMessageSerializer.kt b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/kafka/VesMessageSerializer.kt index a5f80707..084b3376 100644 --- a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/kafka/VesMessageSerializer.kt +++ b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/kafka/VesMessageSerializer.kt @@ -26,7 +26,7 @@ import org.onap.dcae.collectors.veshv.domain.VesMessage * @author Piotr Jaszczyk * @since June 2018 */ -class VesMessageSerializer : Serializer { +internal class VesMessageSerializer : Serializer { override fun configure(configs: MutableMap?, isKey: Boolean) { // not needed } diff --git a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/wire/WireFrameException.kt b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/wire/WireFrameException.kt index 81845400..4dd26597 100644 --- a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/wire/WireFrameException.kt +++ b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/wire/WireFrameException.kt @@ -25,5 +25,5 @@ import org.onap.dcae.collectors.veshv.domain.WireFrameDecodingError * @author Piotr Jaszczyk * @since June 2018 */ -class WireFrameException(val error: WireFrameDecodingError) +internal class WireFrameException(val error: WireFrameDecodingError) : Exception("${error::class.simpleName}: ${error.message}") -- cgit 1.2.3-korg