|
| 1 | +package org.prebid.server.hooks.modules.liveintent.omni.channel.identity.config; |
| 2 | + |
| 3 | +import org.prebid.server.hooks.modules.liveintent.omni.channel.identity.model.config.LiveIntentOmniChannelProperties; |
| 4 | +import org.prebid.server.hooks.modules.liveintent.omni.channel.identity.v1.LiveIntentOmniChannelIdentityModule; |
| 5 | +import org.prebid.server.hooks.modules.liveintent.omni.channel.identity.v1.hooks.LiveIntentOmniChannelIdentityProcessedAuctionRequestHook; |
| 6 | +import org.prebid.server.hooks.v1.Module; |
| 7 | +import org.prebid.server.json.JacksonMapper; |
| 8 | +import org.prebid.server.vertx.httpclient.HttpClient; |
| 9 | +import org.springframework.beans.factory.annotation.Value; |
| 10 | +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| 11 | +import org.springframework.boot.context.properties.ConfigurationProperties; |
| 12 | +import org.springframework.context.annotation.Bean; |
| 13 | +import org.springframework.context.annotation.Configuration; |
| 14 | + |
| 15 | +import java.util.Collections; |
| 16 | + |
| 17 | +@Configuration |
| 18 | +@ConditionalOnProperty( |
| 19 | + prefix = "hooks." + LiveIntentOmniChannelIdentityModule.CODE, |
| 20 | + name = "enabled", |
| 21 | + havingValue = "true") |
| 22 | +public class LiveIntentOmniChannelIdentityConfiguration { |
| 23 | + |
| 24 | + @Bean |
| 25 | + @ConfigurationProperties(prefix = "hooks.modules." + LiveIntentOmniChannelIdentityModule.CODE) |
| 26 | + LiveIntentOmniChannelProperties properties() { |
| 27 | + return new LiveIntentOmniChannelProperties(); |
| 28 | + } |
| 29 | + |
| 30 | + @Bean |
| 31 | + Module liveIntentOmniChannelIdentityModule(LiveIntentOmniChannelProperties properties, |
| 32 | + JacksonMapper mapper, |
| 33 | + HttpClient httpClient, |
| 34 | + @Value("${logging.sampling-rate:0.01}") double logSamplingRate) { |
| 35 | + |
| 36 | + final LiveIntentOmniChannelIdentityProcessedAuctionRequestHook hook = |
| 37 | + new LiveIntentOmniChannelIdentityProcessedAuctionRequestHook( |
| 38 | + properties, mapper, httpClient, logSamplingRate); |
| 39 | + |
| 40 | + return new LiveIntentOmniChannelIdentityModule(Collections.singleton(hook)); |
| 41 | + } |
| 42 | +} |
0 commit comments