From dd827e2c1cc984d9ed1fed9914cbef0e985ea625 Mon Sep 17 00:00:00 2001 From: Jakub Dudycz Date: Tue, 7 Aug 2018 14:18:37 +0200 Subject: Create health check module Create ves-hv-collector-health-check module with dummy api server and connect it with ves-hv-collector-main This is a preparation for health check mechanism implementation Change-Id: I2f668ab7337b1ed7e2afea6c56f34880de3ef1b5 Issue-ID: DCAEGEN2-659 Signed-off-by: Jakub Dudycz --- .../collectors/veshv/utils/commandline/ArgBasedConfiguration.kt | 3 +++ .../dcae/collectors/veshv/utils/commandline/CommandLineOption.kt | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'hv-collector-utils') diff --git a/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/ArgBasedConfiguration.kt b/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/ArgBasedConfiguration.kt index c00ce68d..16634889 100644 --- a/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/ArgBasedConfiguration.kt +++ b/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/ArgBasedConfiguration.kt @@ -60,6 +60,9 @@ abstract class ArgBasedConfiguration(private val parser: CommandLineParser) { protected fun CommandLine.stringValue(cmdLineOpt: CommandLineOption, default: String): String = optionValue(cmdLineOpt).getOrElse { default } + protected fun CommandLine.intValue(cmdLineOpt: CommandLineOption, default: Int): Int = + intValue(cmdLineOpt).getOrElse { default } + protected fun CommandLine.intValue(cmdLineOpt: CommandLineOption): Option = optionValue(cmdLineOpt).map(String::toInt) diff --git a/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt b/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt index 44de9d7a..836a05df 100644 --- a/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt +++ b/hv-collector-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/utils/commandline/CommandLineOption.kt @@ -23,6 +23,12 @@ import org.apache.commons.cli.Option enum class CommandLineOption(val option: Option) { + HEALTH_CHECK_API_PORT(Option.builder("H") + .longOpt("health-check-api-port") + .hasArg() + .desc("Health check rest api listen port") + .build() + ), LISTEN_PORT(Option.builder("p") .longOpt("listen-port") .required() -- cgit 1.2.3-korg