All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.lsdconsulting.interceptors.http.autoconfigure.NamingConfig.kt Maven / Gradle / Ivy

Go to download

Provides various interceptors to capture events for the lsd-core library to generate sequence diagrams

There is a newer version: 8.0.63
Show newest version
package io.lsdconsulting.interceptors.http.autoconfigure

import io.lsdconsulting.interceptors.common.AppName.Factory.create
import io.lsdconsulting.interceptors.http.naming.AlwaysAppName
import io.lsdconsulting.interceptors.http.naming.DestinationNameMappings
import io.lsdconsulting.interceptors.http.naming.RegexResolvingNameMapper
import io.lsdconsulting.interceptors.http.naming.SourceNameMappings
import org.springframework.beans.factory.annotation.Value
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.context.annotation.Bean

internal class NamingConfig {
    @Value("\${info.app.name:App}")
    private lateinit var appName: String

    @Bean
    @ConditionalOnMissingBean(name = ["defaultSourceNameMapping"])
    fun defaultSourceNameMapping(): SourceNameMappings {
        return AlwaysAppName(create(appName))
    }

    @Bean
    @ConditionalOnMissingBean(name = ["defaultDestinationNameMapping"])
    fun defaultDestinationNameMapping(): DestinationNameMappings {
        return RegexResolvingNameMapper()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy