From c65550a581e4776272711b0177ca35d8d56c6ca1 Mon Sep 17 00:00:00 2001 From: pierrebrunin Date: Tue, 21 Mar 2023 16:10:39 +0100 Subject: [PATCH] Add trace --- .../automate/certificate/views/AllDomainView.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/fr/maif/automate/certificate/views/AllDomainView.kt b/src/main/java/fr/maif/automate/certificate/views/AllDomainView.kt index 4b550ae..2a5f3f5 100644 --- a/src/main/java/fr/maif/automate/certificate/views/AllDomainView.kt +++ b/src/main/java/fr/maif/automate/certificate/views/AllDomainView.kt @@ -11,6 +11,8 @@ import io.reactivex.Single import io.vertx.core.json.JsonObject import io.vertx.kotlin.core.json.json import io.vertx.kotlin.core.json.obj +import org.slf4j.Logger +import org.slf4j.LoggerFactory import java.time.LocalDateTime import java.time.format.DateTimeFormatter import java.util.concurrent.ConcurrentHashMap @@ -76,6 +78,10 @@ class AllDomainView( private val datas = ConcurrentHashMap() + companion object { + private val LOGGER: Logger = LoggerFactory.getLogger(AllDomainView::class.java) + } + private fun update(domain: String, mayBeSubdomain: Option, f: (CertificateDomainResume) -> CertificateDomainResume) { val domainResume = datas.getOrPut(domain){ DomainResume(domain) } domainResume.updateCertificate(mayBeSubdomain, f) @@ -124,7 +130,12 @@ class AllDomainView( val (domain, subdomain) = event datas[domain].toOption().toList().forEach { it.deleteCertificate(subdomain) } } - else -> throw IllegalStateException("Unknown event type") + is CertificateReOrderedStarted -> { + LOGGER.info("Scheduler CertificateRenewer started") + } + else -> { + LOGGER.warn("Unmanaged event: ${event.type()}") + } } } }