@Override public ClusterableServer create(final ServerAddress serverAddress, final ServerListener serverListener, final ClusterClock clusterClock) { ConnectionPool connectionPool = new DefaultConnectionPool(new ServerId(clusterId, serverAddress), new InternalStreamConnectionFactory(streamFactory, credentialList, applicationName, mongoDriverInformation, compressorList, commandListener), connectionPoolSettings); // no credentials, compressor list, or command listener for the server monitor factory ServerMonitorFactory serverMonitorFactory = new DefaultServerMonitorFactory(new ServerId(clusterId, serverAddress), serverSettings, clusterClock, new InternalStreamConnectionFactory(heartbeatStreamFactory, Collections.<MongoCredentialWithCache>emptyList(), applicationName, mongoDriverInformation, Collections.<MongoCompressor>emptyList(), null), connectionPool); return new DefaultServer(new ServerId(clusterId, serverAddress), clusterSettings.getMode(), connectionPool, new DefaultConnectionFactory(), serverMonitorFactory, serverListener, commandListener, clusterClock); }
@Override public ClusterableServer create(final ServerAddress serverAddress, final ServerListener serverListener, final ClusterClock clusterClock) { ConnectionPool connectionPool = new DefaultConnectionPool(new ServerId(clusterId, serverAddress), new InternalStreamConnectionFactory(streamFactory, credentialList, applicationName, mongoDriverInformation, compressorList, commandListener), connectionPoolSettings); // no credentials, compressor list, or command listener for the server monitor factory ServerMonitorFactory serverMonitorFactory = new DefaultServerMonitorFactory(new ServerId(clusterId, serverAddress), serverSettings, clusterClock, new InternalStreamConnectionFactory(heartbeatStreamFactory, Collections.<MongoCredentialWithCache>emptyList(), applicationName, mongoDriverInformation, Collections.<MongoCompressor>emptyList(), null), connectionPool); return new DefaultServer(new ServerId(clusterId, serverAddress), clusterSettings.getMode(), connectionPool, new DefaultConnectionFactory(), serverMonitorFactory, serverListener, commandListener, clusterClock); }
EmbeddedInternalConnection(final Pointer instancePointer, final CommandListener commandListener, final BsonDocument clientMetadataDocument) { this.clientStatusPointer = MongoDBCAPIHelper.createStatusPointer(); this.clientPointer = MongoDBCAPIHelper.create_client(instancePointer, clientStatusPointer); this.wrapped = new InternalStreamConnection(new ServerId(new ClusterId(), new ServerAddress()), new StreamFactory() { @Override public Stream create(final ServerAddress serverAddress) { return new EmbeddedInternalStream(); } }, Collections.<MongoCompressor>emptyList(), commandListener, new InternalStreamConnectionInitializer(Collections.<Authenticator>emptyList(), clientMetadataDocument, Collections.<MongoCompressor>emptyList())); }