aboutsummaryrefslogtreecommitdiffstats
path: root/sources/hv-collector-dcae-app-simulator
diff options
context:
space:
mode:
Diffstat (limited to 'sources/hv-collector-dcae-app-simulator')
-rw-r--r--sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/DcaeAppSimulator.kt2
-rw-r--r--sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/MessageStreamValidation.kt4
-rw-r--r--sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/adapters/DcaeAppApiServer.kt8
-rw-r--r--sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/main.kt6
4 files changed, 10 insertions, 10 deletions
diff --git a/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/DcaeAppSimulator.kt b/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/DcaeAppSimulator.kt
index 417183fb..f7d94de5 100644
--- a/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/DcaeAppSimulator.kt
+++ b/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/DcaeAppSimulator.kt
@@ -46,7 +46,7 @@ class DcaeAppSimulator(private val consumerFactory: ConsumerFactory,
throw IllegalArgumentException(message)
}
- logger.info("Received new configuration. Creating consumer for topics: $topics")
+ logger.info { "Received new configuration. Creating consumer for topics: $topics" }
consumerState.set(consumerFactory.createConsumerForTopics(topics).bind())
}.fix()
diff --git a/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/MessageStreamValidation.kt b/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/MessageStreamValidation.kt
index 20c0f592..36f30e66 100644
--- a/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/MessageStreamValidation.kt
+++ b/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/MessageStreamValidation.kt
@@ -61,13 +61,13 @@ class MessageStreamValidation(
return messageParams.fold(
{
logger.warn { "Error while parsing message parameters: ${it::class.qualifiedName} : ${it.message}" }
- logger.debug { "Detailed stack trace: ${it}" }
+ logger.debug { "Detailed stack trace: $it" }
throw IllegalArgumentException("Parsing error: " + it.message)
},
{
if (it.isEmpty()) {
val message = "Message param list cannot be empty"
- logger.warn(message)
+ logger.warn { message }
throw IllegalArgumentException(message)
}
it
diff --git a/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/adapters/DcaeAppApiServer.kt b/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/adapters/DcaeAppApiServer.kt
index a6ee1122..e54eb359 100644
--- a/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/adapters/DcaeAppApiServer.kt
+++ b/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/adapters/DcaeAppApiServer.kt
@@ -71,15 +71,15 @@ class DcaeAppApiServer(private val simulator: DcaeAppSimulator) {
}
.delete("messages") { ctx ->
ctx.response.contentType(CONTENT_TEXT)
- logger.info("Resetting simulator state")
+ logger.info { "Resetting simulator state" }
ctx.response.sendOrError(simulator.resetState())
}
.get("messages/all/count") { ctx ->
- logger.info("Processing request for count of received messages")
+ logger.info { "Processing request for count of received messages" }
simulator.state().fold(
{
ctx.response.status(HttpConstants.STATUS_NOT_FOUND)
- logger.warn("Error - number of messages could not be specified")
+ logger.warn { "Error - number of messages could not be specified" }
},
{
logger.info { "Returned number of received messages: ${it.messagesCount}" }
@@ -90,7 +90,7 @@ class DcaeAppApiServer(private val simulator: DcaeAppSimulator) {
}
.post("messages/all/validate") { ctx ->
ctx.request.body.then { body ->
- logger.info("Processing request for message validation")
+ logger.info { "Processing request for message validation" }
val response = simulator.validate(body.inputStream)
.map { isValid ->
if (isValid) {
diff --git a/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/main.kt b/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/main.kt
index 06ff4d59..5856f044 100644
--- a/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/main.kt
+++ b/sources/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/main.kt
@@ -43,17 +43,17 @@ fun main(args: Array<String>) =
.map(::startApp)
.unsafeRunEitherSync(
{ ex ->
- logger.error("Failed to start a server", ex)
+ logger.withError { log("Failed to start a server", ex) }
ExitFailure(1)
},
{
- logger.info("Started DCAE-APP Simulator API server")
+ logger.info { "Started DCAE-APP Simulator API server" }
}
)
private fun startApp(config: DcaeAppSimConfiguration): IO<Unit> {
- logger.info("Using configuration: $config")
+ logger.info { "Using configuration: $config" }
val consumerFactory = ConsumerFactory(config.kafkaBootstrapServers)
val messageStreamValidation = MessageStreamValidation(MessageGeneratorFactory.create(config.maxPayloadSizeBytes))
return DcaeAppApiServer(DcaeAppSimulator(consumerFactory, messageStreamValidation))