3434
3535class InternalStreamConnectionFactory implements InternalConnectionFactory {
3636 private final ClusterConnectionMode clusterConnectionMode ;
37+ private final boolean isMonitoringConnection ;
3738 private final StreamFactory streamFactory ;
3839 private final BsonDocument clientMetadataDocument ;
3940 private final List <MongoCompressor > compressorList ;
@@ -42,12 +43,23 @@ class InternalStreamConnectionFactory implements InternalConnectionFactory {
4243 private final ServerApi serverApi ;
4344 private final MongoCredentialWithCache credential ;
4445
45- InternalStreamConnectionFactory (final ClusterConnectionMode clusterConnectionMode , final StreamFactory streamFactory ,
46+ InternalStreamConnectionFactory (final ClusterConnectionMode clusterConnectionMode ,
47+ final StreamFactory streamFactory ,
48+ @ Nullable final MongoCredentialWithCache credential ,
49+ @ Nullable final String applicationName , final MongoDriverInformation mongoDriverInformation ,
50+ final List <MongoCompressor > compressorList ,
51+ @ Nullable final CommandListener commandListener , @ Nullable final ServerApi serverApi ) {
52+ this (clusterConnectionMode , false , streamFactory , credential , applicationName , mongoDriverInformation , compressorList ,
53+ commandListener , serverApi );
54+ }
55+ InternalStreamConnectionFactory (final ClusterConnectionMode clusterConnectionMode , final boolean isMonitoringConnection ,
56+ final StreamFactory streamFactory ,
4657 @ Nullable final MongoCredentialWithCache credential ,
4758 @ Nullable final String applicationName , final MongoDriverInformation mongoDriverInformation ,
4859 final List <MongoCompressor > compressorList ,
4960 @ Nullable final CommandListener commandListener , @ Nullable final ServerApi serverApi ) {
5061 this .clusterConnectionMode = clusterConnectionMode ;
62+ this .isMonitoringConnection = isMonitoringConnection ;
5163 this .streamFactory = notNull ("streamFactory" , streamFactory );
5264 this .compressorList = notNull ("compressorList" , compressorList );
5365 this .commandListener = commandListener ;
@@ -59,9 +71,9 @@ class InternalStreamConnectionFactory implements InternalConnectionFactory {
5971 @ Override
6072 public InternalConnection create (final ServerId serverId , final ConnectionGenerationSupplier connectionGenerationSupplier ) {
6173 Authenticator authenticator = credential == null ? null : createAuthenticator (credential );
62- return new InternalStreamConnection (clusterConnectionMode , serverId , connectionGenerationSupplier , streamFactory , compressorList ,
63- commandListener , new InternalStreamConnectionInitializer (clusterConnectionMode , authenticator , clientMetadataDocument ,
64- compressorList , serverApi ));
74+ return new InternalStreamConnection (clusterConnectionMode , isMonitoringConnection , serverId , connectionGenerationSupplier ,
75+ streamFactory , compressorList , commandListener , new InternalStreamConnectionInitializer (clusterConnectionMode ,
76+ authenticator , clientMetadataDocument , compressorList , serverApi ));
6577 }
6678
6779 private Authenticator createAuthenticator (final MongoCredentialWithCache credential ) {
0 commit comments