From c7a3e0738abf581640059587dbb81790339340c9 Mon Sep 17 00:00:00 2001 From: Piotr Jaszczyk Date: Wed, 3 Apr 2019 12:12:17 +0200 Subject: Simplify factory/provider logic Change-Id: I59467c41e1de63ead7c190a7c8fd688e3216237a Issue-ID: DCAEGEN2-1385 Signed-off-by: Piotr Jaszczyk --- .../org/onap/dcae/collectors/veshv/main/servers/VesServer.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'sources/hv-collector-main') diff --git a/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/servers/VesServer.kt b/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/servers/VesServer.kt index fc4d8662..a34b7118 100644 --- a/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/servers/VesServer.kt +++ b/sources/hv-collector-main/src/main/kotlin/org/onap/dcae/collectors/veshv/main/servers/VesServer.kt @@ -21,13 +21,12 @@ package org.onap.dcae.collectors.veshv.main.servers import org.onap.dcae.collectors.veshv.boundary.Server import org.onap.dcae.collectors.veshv.config.api.model.HvVesConfiguration -import org.onap.dcae.collectors.veshv.factory.CollectorFactory +import org.onap.dcae.collectors.veshv.factory.HvVesCollectorFactory import org.onap.dcae.collectors.veshv.factory.ServerFactory import org.onap.dcae.collectors.veshv.factory.AdapterFactory import org.onap.dcae.collectors.veshv.main.metrics.MicrometerMetrics import org.onap.dcae.collectors.veshv.model.ServiceContext import org.onap.dcae.collectors.veshv.utils.ServerHandle -import org.onap.dcae.collectors.veshv.utils.arrow.then import org.onap.dcae.collectors.veshv.utils.logging.Logger import reactor.core.publisher.Mono @@ -45,8 +44,7 @@ object VesServer { .doOnNext(::logServerStarted) private fun createVesServer(config: HvVesConfiguration): Server = - initializeCollectorFactory(config) - .createVesHvCollectorProvider() + createCollectorProvider(config) .let { collectorProvider -> ServerFactory.createNettyTcpServer( config.server, @@ -56,8 +54,8 @@ object VesServer { ) } - private fun initializeCollectorFactory(config: HvVesConfiguration): CollectorFactory = - CollectorFactory( + private fun createCollectorProvider(config: HvVesConfiguration): HvVesCollectorFactory = + HvVesCollectorFactory( config.collector, AdapterFactory.sinkCreatorFactory(), MicrometerMetrics.INSTANCE, -- cgit 1.2.3-korg