@@ -66,11 +66,15 @@ public class PooledBoltConnectionProvider implements BoltConnectionProvider {
66
66
private final long maxLifetime ;
67
67
private final long idleBeforeTest ;
68
68
private final Clock clock ;
69
- private MetricsListener metricsListener ;
70
- private CompletionStage <Void > closeStage ;
71
- private BoltServerAddress address ;
72
- private String poolId ;
69
+ private final MetricsListener metricsListener ;
70
+ private final BoltServerAddress address ;
71
+ private final RoutingContext routingContext ;
72
+ private final BoltAgent boltAgent ;
73
+ private final String userAgent ;
74
+ private final int connectTimeoutMillis ;
75
+ private final String poolId ;
73
76
77
+ private CompletionStage <Void > closeStage ;
74
78
private long minAuthTimestamp ;
75
79
76
80
public PooledBoltConnectionProvider (
@@ -80,7 +84,13 @@ public PooledBoltConnectionProvider(
80
84
long maxLifetime ,
81
85
long idleBeforeTest ,
82
86
Clock clock ,
83
- LoggingProvider logging ) {
87
+ LoggingProvider logging ,
88
+ MetricsListener metricsListener ,
89
+ BoltServerAddress address ,
90
+ RoutingContext routingContext ,
91
+ BoltAgent boltAgent ,
92
+ String userAgent ,
93
+ int connectTimeoutMillis ) {
84
94
this .boltConnectionProvider = boltConnectionProvider ;
85
95
this .pooledConnectionEntries = new ArrayList <>();
86
96
this .pendingAcquisitions = new ArrayDeque <>(100 );
@@ -90,19 +100,13 @@ public PooledBoltConnectionProvider(
90
100
this .idleBeforeTest = idleBeforeTest ;
91
101
this .clock = Objects .requireNonNull (clock );
92
102
this .log = logging .getLog (getClass ());
93
- }
94
-
95
- @ Override
96
- public CompletionStage <Void > init (
97
- BoltServerAddress address ,
98
- RoutingContext routingContext ,
99
- BoltAgent boltAgent ,
100
- String userAgent ,
101
- int connectTimeoutMillis ,
102
- MetricsListener metricsListener ) {
103
+ this .metricsListener = Objects .requireNonNull (metricsListener );
103
104
this .address = Objects .requireNonNull (address );
105
+ this .routingContext = Objects .requireNonNull (routingContext );
106
+ this .boltAgent = Objects .requireNonNull (boltAgent );
107
+ this .userAgent = Objects .requireNonNull (userAgent );
108
+ this .connectTimeoutMillis = connectTimeoutMillis ;
104
109
this .poolId = poolId (address );
105
- this .metricsListener = Objects .requireNonNull (metricsListener );
106
110
metricsListener .registerPoolMetrics (
107
111
poolId ,
108
112
address ,
@@ -120,13 +124,16 @@ public CompletionStage<Void> init(
120
124
.count ();
121
125
}
122
126
});
123
- return boltConnectionProvider .init (
124
- address , routingContext , boltAgent , userAgent , connectTimeoutMillis , metricsListener );
125
127
}
126
128
127
129
@ SuppressWarnings ({"ReassignedVariable" })
128
130
@ Override
129
131
public CompletionStage <BoltConnection > connect (
132
+ BoltServerAddress ignoredAddress ,
133
+ RoutingContext ignoredRoutingContext ,
134
+ BoltAgent ignoredBoltAgent ,
135
+ String ignoredUserAgent ,
136
+ int ignoredConnectTimeoutMillis ,
130
137
SecurityPlan securityPlan ,
131
138
DatabaseName databaseName ,
132
139
Supplier <CompletionStage <AuthToken >> authTokenStageSupplier ,
@@ -334,6 +341,11 @@ private void connect(
334
341
var entry = connectionEntryWithMetadata .connectionEntry ;
335
342
boltConnectionProvider
336
343
.connect (
344
+ address ,
345
+ routingContext ,
346
+ boltAgent ,
347
+ userAgent ,
348
+ connectTimeoutMillis ,
337
349
securityPlan ,
338
350
databaseName ,
339
351
empty .get ()
@@ -502,8 +514,20 @@ private CompletionStage<Void> livenessCheckStage(ConnectionEntry entry) {
502
514
}
503
515
504
516
@ Override
505
- public CompletionStage <Void > verifyConnectivity (SecurityPlan securityPlan , AuthToken authToken ) {
517
+ public CompletionStage <Void > verifyConnectivity (
518
+ BoltServerAddress ignoredAddress ,
519
+ RoutingContext ignoredRoutingContext ,
520
+ BoltAgent ignoredBoltAgent ,
521
+ String ignoredUserAgent ,
522
+ int ignoredConnectTimeoutMillis ,
523
+ SecurityPlan securityPlan ,
524
+ AuthToken authToken ) {
506
525
return connect (
526
+ address ,
527
+ routingContext ,
528
+ boltAgent ,
529
+ userAgent ,
530
+ connectTimeoutMillis ,
507
531
securityPlan ,
508
532
null ,
509
533
() -> CompletableFuture .completedStage (authToken ),
@@ -518,8 +542,20 @@ public CompletionStage<Void> verifyConnectivity(SecurityPlan securityPlan, AuthT
518
542
}
519
543
520
544
@ Override
521
- public CompletionStage <Boolean > supportsMultiDb (SecurityPlan securityPlan , AuthToken authToken ) {
545
+ public CompletionStage <Boolean > supportsMultiDb (
546
+ BoltServerAddress ignoredAddress ,
547
+ RoutingContext ignoredRoutingContext ,
548
+ BoltAgent ignoredBoltAgent ,
549
+ String ignoredUserAgent ,
550
+ int ignoredConnectTimeoutMillis ,
551
+ SecurityPlan securityPlan ,
552
+ AuthToken authToken ) {
522
553
return connect (
554
+ address ,
555
+ routingContext ,
556
+ boltAgent ,
557
+ userAgent ,
558
+ connectTimeoutMillis ,
523
559
securityPlan ,
524
560
null ,
525
561
() -> CompletableFuture .completedStage (authToken ),
@@ -537,8 +573,20 @@ public CompletionStage<Boolean> supportsMultiDb(SecurityPlan securityPlan, AuthT
537
573
}
538
574
539
575
@ Override
540
- public CompletionStage <Boolean > supportsSessionAuth (SecurityPlan securityPlan , AuthToken authToken ) {
576
+ public CompletionStage <Boolean > supportsSessionAuth (
577
+ BoltServerAddress ignoredAddress ,
578
+ RoutingContext ignoredRoutingContext ,
579
+ BoltAgent ignoredBoltAgent ,
580
+ String ignoredUserAgent ,
581
+ int ignoredConnectTimeoutMillis ,
582
+ SecurityPlan securityPlan ,
583
+ AuthToken authToken ) {
541
584
return connect (
585
+ address ,
586
+ routingContext ,
587
+ boltAgent ,
588
+ userAgent ,
589
+ connectTimeoutMillis ,
542
590
securityPlan ,
543
591
null ,
544
592
() -> CompletableFuture .completedStage (authToken ),
0 commit comments