List of usage examples for org.springframework.data.mongodb.core SimpleMongoDbFactory SimpleMongoDbFactory
public SimpleMongoDbFactory(MongoClient mongoClient, String databaseName)
From source file:strat.mining.multipool.stats.persistence.dao.donation.impl.MongoDBConfiguration.java
@Bean(name = "donationMongoFacotry") public MongoDbFactory mongoDbFactory() throws Exception { return new SimpleMongoDbFactory(new MongoClient("127.0.0.1:27017"), "donations"); }
From source file:strat.mining.multipool.stats.persistence.dao.waffle.impl.mongo.MongoDBConfiguration.java
@Bean(name = "waffleMongoFacotry") public MongoDbFactory mongoDbFactory() throws Exception { return new SimpleMongoDbFactory(new MongoClient("127.0.0.1:27017"), "waffleStats"); }
From source file:strat.mining.multipool.stats.persistence.dao.coinshift.impl.MongoDBConfiguration.java
@Bean(name = "coinshiftMongoFacotry") public MongoDbFactory mongoDbFactory() throws Exception { return new SimpleMongoDbFactory(new MongoClient("127.0.0.1:27017"), "coinshiftStats"); }
From source file:strat.mining.multipool.stats.persistence.dao.coinsolver.impl.MongoDBConfiguration.java
@Bean(name = "coinsolverMongoFacotry") public MongoDbFactory mongoDbFactory() throws Exception { return new SimpleMongoDbFactory(new MongoClient("127.0.0.1:27017"), "coinsolverStats"); }
From source file:strat.mining.multipool.stats.persistence.dao.middlecoin.impl.mongo.MongoDBConfiguration.java
@Bean(name = "middlecoinMongoFacotry") public MongoDbFactory mongoDbFactory() throws Exception { return new SimpleMongoDbFactory(new MongoClient("127.0.0.1:27017"), "middlecoinStats"); }
From source file:things.config.mongo.MongoConfig.java
@Bean @Override//from w w w . j a v a 2 s.c o m public MongoDbFactory mongoDbFactory() throws Exception { //UserCredentials userCredentials = new UserCredentials("joe", "secret"); return new SimpleMongoDbFactory(mongo(), getDatabaseName()); }
From source file:com.bcknds.demo.mongo.config.MongoConfig.java
@Bean public MongoDbFactory mongoDbFactory() throws Exception { return new SimpleMongoDbFactory(new MongoClient(), database); }
From source file:com.github.carlomicieli.nerdmovies.config.ComponentTestConfig.java
/** * Return the mongodb factory for the test environment. * * @return the mongodb factory bean./* w w w . j a v a 2s . co m*/ * @throws Exception */ @Bean public MongoDbFactory mongoDbFactory() throws Exception { return new SimpleMongoDbFactory( new Mongo(env.getProperty("mongo.hostName"), env.getProperty("mongo.portNumber", Integer.class)), env.getProperty("mongo.databaseName")); }
From source file:com.avanza.ymer.MirrorEnvironment.java
public ApplicationContext getMongoClientContext() { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); context.getBeanFactory().registerSingleton("mongoDbFactory", new SimpleMongoDbFactory(mongoServer.getMongo(), TEST_MIRROR_DB_NAME)); context.refresh();/* w ww. j a va2 s.co m*/ return context; }
From source file:eu.trentorise.game.config.MongoConfig.java
@Bean public MongoTemplate mongoTemplate() { try {//from w ww .java 2s.c o m MongoTemplate mongoTemplate = new MongoTemplate( new SimpleMongoDbFactory(mongo(), env.getProperty("mongo.dbname"))); return mongoTemplate; } catch (Exception e) { LogHub.error(null, logger, "Exception in mongotemplate configuration: {}", e.getMessage()); return null; } }