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

dev.logchange.hofund.graph.springboot.autoconfigure.HofundGraphAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package dev.logchange.hofund.graph.springboot.autoconfigure;

import dev.logchange.hofund.connection.HofundConnectionsProvider;
import dev.logchange.hofund.connection.springboot.autoconfigure.HofundConnectionAutoConfiguration;
import dev.logchange.hofund.graph.edge.HofundEdgeMeter;
import dev.logchange.hofund.graph.node.HofundNodeMeter;
import dev.logchange.hofund.info.HofundInfoProvider;
import dev.logchange.hofund.info.springboot.autoconfigure.HofundInfoAutoConfiguration;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.actuate.autoconfigure.metrics.export.ConditionalOnEnabledMetricsExport;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@RequiredArgsConstructor
@Configuration(proxyBeanMethods = false)
@ConditionalOnEnabledMetricsExport(value="prometheus")
@AutoConfigureAfter({HofundInfoAutoConfiguration.class, HofundConnectionAutoConfiguration.class})
public class HofundGraphAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    @ConditionalOnBean(HofundInfoProvider.class)
    public HofundNodeMeter hofundNodeMeter(HofundInfoProvider infoProvider, List hofundConnectionsProviders) {
        return new HofundNodeMeter(infoProvider, hofundConnectionsProviders);
    }

    @Bean
    @ConditionalOnMissingBean
    @ConditionalOnBean(HofundInfoProvider.class)
    public HofundEdgeMeter hofundEdgeMeter(HofundInfoProvider infoProvider, List hofundConnectionsProviders) {
        return new HofundEdgeMeter(infoProvider, hofundConnectionsProviders);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy