@@ -66,11 +66,15 @@ public class PooledBoltConnectionProvider implements BoltConnectionProvider {
6666 private final long maxLifetime ;
6767 private final long idleBeforeTest ;
6868 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 ;
7376
77+ private CompletionStage <Void > closeStage ;
7478 private long minAuthTimestamp ;
7579
7680 public PooledBoltConnectionProvider (
@@ -80,7 +84,13 @@ public PooledBoltConnectionProvider(
8084 long maxLifetime ,
8185 long idleBeforeTest ,
8286 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 ) {
8494 this .boltConnectionProvider = boltConnectionProvider ;
8595 this .pooledConnectionEntries = new ArrayList <>();
8696 this .pendingAcquisitions = new ArrayDeque <>(100 );
@@ -90,19 +100,13 @@ public PooledBoltConnectionProvider(
90100 this .idleBeforeTest = idleBeforeTest ;
91101 this .clock = Objects .requireNonNull (clock );
92102 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 );
103104 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 ;
104109 this .poolId = poolId (address );
105- this .metricsListener = Objects .requireNonNull (metricsListener );
106110 metricsListener .registerPoolMetrics (
107111 poolId ,
108112 address ,
@@ -120,13 +124,16 @@ public CompletionStage<Void> init(
120124 .count ();
121125 }
122126 });
123- return boltConnectionProvider .init (
124- address , routingContext , boltAgent , userAgent , connectTimeoutMillis , metricsListener );
125127 }
126128
127129 @ SuppressWarnings ({"ReassignedVariable" })
128130 @ Override
129131 public CompletionStage <BoltConnection > connect (
132+ BoltServerAddress ignoredAddress ,
133+ RoutingContext ignoredRoutingContext ,
134+ BoltAgent ignoredBoltAgent ,
135+ String ignoredUserAgent ,
136+ int ignoredConnectTimeoutMillis ,
130137 SecurityPlan securityPlan ,
131138 DatabaseName databaseName ,
132139 Supplier <CompletionStage <AuthToken >> authTokenStageSupplier ,
@@ -334,6 +341,11 @@ private void connect(
334341 var entry = connectionEntryWithMetadata .connectionEntry ;
335342 boltConnectionProvider
336343 .connect (
344+ address ,
345+ routingContext ,
346+ boltAgent ,
347+ userAgent ,
348+ connectTimeoutMillis ,
337349 securityPlan ,
338350 databaseName ,
339351 empty .get ()
@@ -502,8 +514,20 @@ private CompletionStage<Void> livenessCheckStage(ConnectionEntry entry) {
502514 }
503515
504516 @ 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 ) {
506525 return connect (
526+ address ,
527+ routingContext ,
528+ boltAgent ,
529+ userAgent ,
530+ connectTimeoutMillis ,
507531 securityPlan ,
508532 null ,
509533 () -> CompletableFuture .completedStage (authToken ),
@@ -518,8 +542,20 @@ public CompletionStage<Void> verifyConnectivity(SecurityPlan securityPlan, AuthT
518542 }
519543
520544 @ 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 ) {
522553 return connect (
554+ address ,
555+ routingContext ,
556+ boltAgent ,
557+ userAgent ,
558+ connectTimeoutMillis ,
523559 securityPlan ,
524560 null ,
525561 () -> CompletableFuture .completedStage (authToken ),
@@ -537,8 +573,20 @@ public CompletionStage<Boolean> supportsMultiDb(SecurityPlan securityPlan, AuthT
537573 }
538574
539575 @ 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 ) {
541584 return connect (
585+ address ,
586+ routingContext ,
587+ boltAgent ,
588+ userAgent ,
589+ connectTimeoutMillis ,
542590 securityPlan ,
543591 null ,
544592 () -> CompletableFuture .completedStage (authToken ),
0 commit comments