Mongo(final List<ServerAddress> seedList, final List<MongoCredential> credentialsList, final MongoClientOptions options, @Nullable final MongoDriverInformation mongoDriverInformation) { this(createCluster(seedList, credentialsList, options, mongoDriverInformation), options, credentialsList); }
Mongo(final ServerAddress serverAddress, final List<MongoCredential> credentialsList, final MongoClientOptions options, @Nullable final MongoDriverInformation mongoDriverInformation) { this(createCluster(serverAddress, credentialsList, options, mongoDriverInformation), options, credentialsList); }
private static Cluster createCluster(final List<ServerAddress> seedList, final List<MongoCredential> credentialsList, final MongoClientOptions options, @Nullable final MongoDriverInformation mongoDriverInformation) { return createCluster(getClusterSettings(seedList, options, ClusterConnectionMode.MULTIPLE), credentialsList, options, mongoDriverInformation); }
private static Cluster createCluster(final ServerAddress serverAddress, final List<MongoCredential> credentialsList, final MongoClientOptions options, @Nullable final MongoDriverInformation mongoDriverInformation) { return createCluster(getClusterSettings(singletonList(serverAddress), options, getSingleServerClusterMode(options)), credentialsList, options, mongoDriverInformation); }
Mongo(final MongoClientURI mongoURI, @Nullable final MongoDriverInformation mongoDriverInformation) { this(createCluster(mongoURI, mongoDriverInformation), mongoURI.getOptions(), mongoURI.getCredentials() != null ? asList(mongoURI.getCredentials()) : Collections.<MongoCredential>emptyList()); }
private static Cluster createCluster(final MongoClientURI mongoURI, @Nullable final MongoDriverInformation mongoDriverInformation) { List<MongoCredential> credentialList = mongoURI.getCredentials() != null ? singletonList(mongoURI.getCredentials()) : Collections.<MongoCredential>emptyList(); if (mongoURI.getHosts().size() == 1) { return createCluster(createServerAddress(mongoURI.getHosts().get(0)), credentialList, mongoURI.getOptions(), null); } else { List<ServerAddress> seedList = new ArrayList<ServerAddress>(mongoURI.getHosts().size()); for (final String host : mongoURI.getHosts()) { seedList.add(createServerAddress(host)); } return createCluster(seedList, credentialList, mongoURI.getOptions(), mongoDriverInformation); } }
Mongo(final ServerAddress serverAddress, final List<MongoCredential> credentialsList, final MongoClientOptions options, @Nullable final MongoDriverInformation mongoDriverInformation) { this(createCluster(serverAddress, credentialsList, options, mongoDriverInformation), options, credentialsList); }
Mongo(final List<ServerAddress> seedList, final List<MongoCredential> credentialsList, final MongoClientOptions options, @Nullable final MongoDriverInformation mongoDriverInformation) { this(createCluster(seedList, credentialsList, options, mongoDriverInformation), options, credentialsList); }
private static Cluster createCluster(final List<ServerAddress> seedList, final List<MongoCredential> credentialsList, final MongoClientOptions options, @Nullable final MongoDriverInformation mongoDriverInformation) { return createCluster(getClusterSettings(seedList, options, ClusterConnectionMode.MULTIPLE), credentialsList, options, mongoDriverInformation); }
private static Cluster createCluster(final ServerAddress serverAddress, final List<MongoCredential> credentialsList, final MongoClientOptions options, @Nullable final MongoDriverInformation mongoDriverInformation) { return createCluster(getClusterSettings(singletonList(serverAddress), options, getSingleServerClusterMode(options)), credentialsList, options, mongoDriverInformation); }
Mongo(final MongoClientURI mongoURI, @Nullable final MongoDriverInformation mongoDriverInformation) { this(createCluster(mongoURI, mongoDriverInformation), mongoURI.getOptions(), mongoURI.getCredentials() != null ? asList(mongoURI.getCredentials()) : Collections.<MongoCredential>emptyList()); }
private static Cluster createCluster(final MongoClientURI mongoURI, @Nullable final MongoDriverInformation mongoDriverInformation) { List<MongoCredential> credentialList = mongoURI.getCredentials() != null ? singletonList(mongoURI.getCredentials()) : Collections.<MongoCredential>emptyList(); if (mongoURI.getHosts().size() == 1) { return createCluster(createServerAddress(mongoURI.getHosts().get(0)), credentialList, mongoURI.getOptions(), null); } else { List<ServerAddress> seedList = new ArrayList<ServerAddress>(mongoURI.getHosts().size()); for (final String host : mongoURI.getHosts()) { seedList.add(createServerAddress(host)); } return createCluster(seedList, credentialList, mongoURI.getOptions(), mongoDriverInformation); } }