From bfbfba1a5fc87667bc0e38c688a5d936b33af276 Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Sat, 11 Apr 2015 15:28:25 -0500 Subject: [PATCH 1/2] Update Spring Cloud references in README. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f5964e0..73f9802 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# Spring Cloud [![Build Status](https://build.spring.io/plugins/servlet/buildStatusImage/CLOUD-NIGHTLY "Optional title")](https://build.spring.io/browse/CLOUD-NIGHTLY) +# Spring Cloud Connectors [![Build Status](https://build.spring.io/plugins/servlet/buildStatusImage/CLOUD-NIGHTLY "Optional title")](https://build.spring.io/browse/CLOUD-NIGHTLY) -Spring Cloud provides a simple abstraction for JVM-based applications running on cloud platforms +Spring Cloud Connectors provides a simple abstraction for JVM-based applications running on cloud platforms to discover bound services and deployment information at runtime and provides support for registering discovered services as Spring beans. It is based on a plugin model so that the identical compiled application can be deployed locally or on multiple clouds, and it supports custom service definitions through Java SPI. -Spring Cloud provides out-of-the-box support for discovering common services on Heroku and +Spring Cloud Connectors provides out-of-the-box support for discovering common services on Heroku and Cloud Foundry clouds as well as a properties-based configuration for development and testing. The core concepts used in this project are: @@ -51,7 +51,7 @@ connectors is perfectly fine; each connector will determine whether it should be particular environment. ````xml - + org.springframework.cloud spring-cloud-localconfig-connector @@ -115,5 +115,5 @@ the `` namespace](spring-cloud-spring-service-connector). The [`spring-cloud-core`](core) dependency is included by each cloud connector, so simply include the connectors for the platforms you want. -Then follow the [instructions](spring-cloud-core) on using the Spring Cloud API. +Then follow the [instructions](spring-cloud-core) on using the Spring Cloud Connectors API. From 337c572d2acef9bfba4c86dd7bf25377a3870060 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Wed, 29 Apr 2015 14:29:16 -0600 Subject: [PATCH 2/2] Support creation of a MongoDbFactory with default (no) credentials --- .../cloud/service/document/MongoDbFactoryCreator.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spring-cloud-spring-service-connector/src/main/java/org/springframework/cloud/service/document/MongoDbFactoryCreator.java b/spring-cloud-spring-service-connector/src/main/java/org/springframework/cloud/service/document/MongoDbFactoryCreator.java index 850a13c..09a6721 100644 --- a/spring-cloud-spring-service-connector/src/main/java/org/springframework/cloud/service/document/MongoDbFactoryCreator.java +++ b/spring-cloud-spring-service-connector/src/main/java/org/springframework/cloud/service/document/MongoDbFactoryCreator.java @@ -42,8 +42,14 @@ public class MongoDbFactoryCreator extends AbstractServiceConnectorCreator serverAddressList = getServerAddresses(mongoClientURI); MongoClient mongo = new MongoClient(serverAddressList, mongoOptionsToUse); - UserCredentials credentials = new UserCredentials(mongoClientURI.getUsername(), new String(mongoClientURI.getPassword())); - SimpleMongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(mongo, mongoClientURI.getDatabase(), credentials); + + SimpleMongoDbFactory mongoDbFactory; + if (mongoClientURI.getUsername() != null && mongoClientURI.getPassword() != null) { + UserCredentials credentials = new UserCredentials(mongoClientURI.getUsername(), new String(mongoClientURI.getPassword())); + mongoDbFactory = new SimpleMongoDbFactory(mongo, mongoClientURI.getDatabase(), credentials); + } else { + mongoDbFactory = new SimpleMongoDbFactory(mongo, mongoClientURI.getDatabase()); + } return configure(mongoDbFactory, (MongoDbFactoryConfig) config); } catch (UnknownHostException e) {