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

uk.co.caeldev.spring.moprhia.MongoConfiguration Maven / Gradle / Ivy

There is a newer version: 0.1.5
Show newest version
package uk.co.caeldev.spring.moprhia;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(MongoSettings.class)
@ConditionalOnProperty({
        "mongo.servers[0].name",
        "mongo.servers[0].port",
        "mongo.database",
        "mongo.username",
        "mongo.password"})
public class MongoConfiguration {

    @Bean
    public MongoServer mongoServer() {
        return new MongoServer();
    }

    @Bean
    public MongoSettings mongoSettings() {
        return new MongoSettings();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy