List of usage examples for com.mongodb MongoURI MONGODB_PREFIX
String MONGODB_PREFIX
To view the source code for com.mongodb MongoURI MONGODB_PREFIX.
Click Source Link
From source file:org.mule.module.mongo.MongoCloudConnector.java
License:Open Source License
private MongoClientURI getMongoClientURI(final String username, final String password, final String database) { List<String> hostsWithPort = new LinkedList<String>(); for (String hostname : host.split(",\\s?")) { hostsWithPort.add(hostname + ":" + port); }/*from w w w .j a v a 2 s. c o m*/ return new MongoClientURI(MongoURI.MONGODB_PREFIX + // username + ":" + password + "@" + StringUtils.join(hostsWithPort, ",") + "/" + database, getMongoOptions(database)); }