@Override public Cluster create(final ClusterSettings settings, final ServerSettings serverSettings, final ConnectionPoolSettings connectionPoolSettings, final StreamFactory streamFactory, final StreamFactory heartbeatStreamFactory, final List<MongoCredential> credentialList, final ClusterListener clusterListener, final ConnectionPoolListener connectionPoolListener, final com.mongodb.event.ConnectionListener connectionListener) { return createCluster(getClusterSettings(settings, clusterListener), serverSettings, getConnectionPoolSettings(connectionPoolSettings, connectionPoolListener), streamFactory, heartbeatStreamFactory, credentialList, null, null, null, Collections.<MongoCompressor>emptyList()); }
private static Cluster createCluster(final MongoClientSettings settings, @Nullable final MongoDriverInformation mongoDriverInformation) { notNull("settings", settings); List<MongoCredential> credentialList = settings.getCredential() != null ? Collections.singletonList(settings.getCredential()) : Collections.<MongoCredential>emptyList(); return new DefaultClusterFactory().createCluster(settings.getClusterSettings(), settings.getServerSettings(), settings.getConnectionPoolSettings(), getStreamFactory(settings, false), getStreamFactory(settings, true), credentialList, getCommandListener(settings.getCommandListeners()), settings.getApplicationName(), mongoDriverInformation, settings.getCompressorList()); }
/** * Creates a cluster with the given settings. The cluster mode will be based on the mode from the settings. * * @param clusterSettings the cluster settings * @param serverSettings the server settings * @param connectionPoolSettings the connection pool settings * @param streamFactory the stream factory * @param heartbeatStreamFactory the heartbeat stream factory * @param credentialList the credential list * @param commandListener an optional listener for command-related events * @param applicationName an optional application name to associate with connections to the servers in this cluster * @param mongoDriverInformation the optional driver information associate with connections to the servers in this cluster * @return the cluster * * @since 3.5 * @deprecated use {@link #createCluster(ClusterSettings, ServerSettings, ConnectionPoolSettings, StreamFactory, StreamFactory, * List, CommandListener, String, MongoDriverInformation, List)} instead */ @Deprecated public Cluster createCluster(final ClusterSettings clusterSettings, final ServerSettings serverSettings, final ConnectionPoolSettings connectionPoolSettings, final StreamFactory streamFactory, final StreamFactory heartbeatStreamFactory, final List<MongoCredential> credentialList, final CommandListener commandListener, final String applicationName, final MongoDriverInformation mongoDriverInformation) { return createCluster(clusterSettings, serverSettings, connectionPoolSettings, streamFactory, heartbeatStreamFactory, credentialList, commandListener, applicationName, mongoDriverInformation, Collections.<MongoCompressor>emptyList()); }
private static Cluster createCluster(final ClusterSettings clusterSettings, final List<MongoCredential> credentialsList, final MongoClientOptions options, @Nullable final MongoDriverInformation mongoDriverInformation) { MongoDriverInformation.Builder builder = mongoDriverInformation == null ? MongoDriverInformation.builder() : MongoDriverInformation.builder(mongoDriverInformation); return new DefaultClusterFactory().createCluster(clusterSettings, options.getServerSettings(), options.getConnectionPoolSettings(), new SocketStreamFactory(options.getSocketSettings(), options.getSslSettings(), options.getSocketFactory()), new SocketStreamFactory(options.getHeartbeatSocketSettings(), options.getSslSettings(), options.getSocketFactory()), credentialsList, getCommandListener(options.getCommandListeners()), options.getApplicationName(), builder.driverName("legacy").build(), options.getCompressorList()); }
/** * Creates a cluster with the given settings. The cluster mode will be based on the mode from the settings. * * @param clusterSettings the cluster settings * @param serverSettings the server settings * @param connectionPoolSettings the connection pool settings * @param streamFactory the stream factory * @param heartbeatStreamFactory the heartbeat stream factory * @param credentialList the credential list * @param commandListener an optional listener for command-related events * @param applicationName an optional application name to associate with connections to the servers in this cluster * @param mongoDriverInformation the optional driver information associate with connections to the servers in this cluster * @return the cluster * * @since 3.5 * @deprecated use {@link #createCluster(ClusterSettings, ServerSettings, ConnectionPoolSettings, StreamFactory, StreamFactory, * List, CommandListener, String, MongoDriverInformation, List)} instead */ @Deprecated public Cluster createCluster(final ClusterSettings clusterSettings, final ServerSettings serverSettings, final ConnectionPoolSettings connectionPoolSettings, final StreamFactory streamFactory, final StreamFactory heartbeatStreamFactory, final List<MongoCredential> credentialList, final CommandListener commandListener, final String applicationName, final MongoDriverInformation mongoDriverInformation) { return createCluster(clusterSettings, serverSettings, connectionPoolSettings, streamFactory, heartbeatStreamFactory, credentialList, commandListener, applicationName, mongoDriverInformation, Collections.<MongoCompressor>emptyList()); }
final com.mongodb.event.ConnectionListener connectionListener, final CommandListener commandListener) { return createCluster(getClusterSettings(settings, clusterListener), serverSettings, getConnectionPoolSettings(connectionPoolSettings, connectionPoolListener), streamFactory, heartbeatStreamFactory, credentialList, commandListener, null, null, Collections.<MongoCompressor>emptyList());
private static Cluster createCluster(final MongoClientSettings settings, @Nullable final MongoDriverInformation mongoDriverInformation) { notNull("settings", settings); List<MongoCredential> credentialList = settings.getCredential() != null ? Collections.singletonList(settings.getCredential()) : Collections.<MongoCredential>emptyList(); return new DefaultClusterFactory().createCluster(settings.getClusterSettings(), settings.getServerSettings(), settings.getConnectionPoolSettings(), getStreamFactory(settings, false), getStreamFactory(settings, true), credentialList, getCommandListener(settings.getCommandListeners()), settings.getApplicationName(), mongoDriverInformation, settings.getCompressorList()); }
final String applicationName, final MongoDriverInformation mongoDriverInformation) { return createCluster(getClusterSettings(settings, clusterListener), serverSettings, getConnectionPoolSettings(connectionPoolSettings, connectionPoolListener), streamFactory, heartbeatStreamFactory, credentialList, commandListener, applicationName, mongoDriverInformation, Collections.<MongoCompressor>emptyList());
private static Cluster createCluster(final MongoClientSettings settings, @Nullable final MongoDriverInformation mongoDriverInformation) { notNull("settings", settings); List<MongoCredential> credentialList = settings.getCredential() != null ? Collections.singletonList(settings.getCredential()) : Collections.<MongoCredential>emptyList(); return new DefaultClusterFactory().createCluster(settings.getClusterSettings(), settings.getServerSettings(), settings.getConnectionPoolSettings(), getStreamFactory(settings, false), getStreamFactory(settings, true), credentialList, getCommandListener(settings.getCommandListeners()), settings.getApplicationName(), mongoDriverInformation, settings.getCompressorList()); }
@Override public Cluster create(final ClusterSettings settings, final ServerSettings serverSettings, final ConnectionPoolSettings connectionPoolSettings, final StreamFactory streamFactory, final StreamFactory heartbeatStreamFactory, final List<MongoCredential> credentialList, final ClusterListener clusterListener, final ConnectionPoolListener connectionPoolListener, final com.mongodb.event.ConnectionListener connectionListener) { return createCluster(getClusterSettings(settings, clusterListener), serverSettings, getConnectionPoolSettings(connectionPoolSettings, connectionPoolListener), streamFactory, heartbeatStreamFactory, credentialList, null, null, null, Collections.<MongoCompressor>emptyList()); }
private static Cluster createCluster(final ClusterSettings clusterSettings, final List<MongoCredential> credentialsList, final MongoClientOptions options, @Nullable final MongoDriverInformation mongoDriverInformation) { MongoDriverInformation.Builder builder = mongoDriverInformation == null ? MongoDriverInformation.builder() : MongoDriverInformation.builder(mongoDriverInformation); return new DefaultClusterFactory().createCluster(clusterSettings, options.getServerSettings(), options.getConnectionPoolSettings(), new SocketStreamFactory(options.getSocketSettings(), options.getSslSettings(), options.getSocketFactory()), new SocketStreamFactory(options.getHeartbeatSocketSettings(), options.getSslSettings(), options.getSocketFactory()), credentialsList, getCommandListener(options.getCommandListeners()), options.getApplicationName(), builder.driverName("legacy").build(), options.getCompressorList()); }
final com.mongodb.event.ConnectionListener connectionListener, final CommandListener commandListener) { return createCluster(getClusterSettings(settings, clusterListener), serverSettings, getConnectionPoolSettings(connectionPoolSettings, connectionPoolListener), streamFactory, heartbeatStreamFactory, credentialList, commandListener, null, null, Collections.<MongoCompressor>emptyList());
final String applicationName, final MongoDriverInformation mongoDriverInformation) { return createCluster(getClusterSettings(settings, clusterListener), serverSettings, getConnectionPoolSettings(connectionPoolSettings, connectionPoolListener), streamFactory, heartbeatStreamFactory, credentialList, commandListener, applicationName, mongoDriverInformation, Collections.<MongoCompressor>emptyList());