34
34
35
35
class InternalStreamConnectionFactory implements InternalConnectionFactory {
36
36
private final ClusterConnectionMode clusterConnectionMode ;
37
+ private final boolean isMonitoringConnection ;
37
38
private final StreamFactory streamFactory ;
38
39
private final BsonDocument clientMetadataDocument ;
39
40
private final List <MongoCompressor > compressorList ;
@@ -42,12 +43,23 @@ class InternalStreamConnectionFactory implements InternalConnectionFactory {
42
43
private final ServerApi serverApi ;
43
44
private final MongoCredentialWithCache credential ;
44
45
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 ,
46
57
@ Nullable final MongoCredentialWithCache credential ,
47
58
@ Nullable final String applicationName , final MongoDriverInformation mongoDriverInformation ,
48
59
final List <MongoCompressor > compressorList ,
49
60
@ Nullable final CommandListener commandListener , @ Nullable final ServerApi serverApi ) {
50
61
this .clusterConnectionMode = clusterConnectionMode ;
62
+ this .isMonitoringConnection = isMonitoringConnection ;
51
63
this .streamFactory = notNull ("streamFactory" , streamFactory );
52
64
this .compressorList = notNull ("compressorList" , compressorList );
53
65
this .commandListener = commandListener ;
@@ -59,9 +71,9 @@ class InternalStreamConnectionFactory implements InternalConnectionFactory {
59
71
@ Override
60
72
public InternalConnection create (final ServerId serverId , final ConnectionGenerationSupplier connectionGenerationSupplier ) {
61
73
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 ));
65
77
}
66
78
67
79
private Authenticator createAuthenticator (final MongoCredentialWithCache credential ) {
0 commit comments