From 4153bae2b7b092a912f728c07adc47b526734f54 Mon Sep 17 00:00:00 2001 From: sergiyvamz Date: Wed, 13 Dec 2023 15:21:19 -0800 Subject: [PATCH] expose AuroraInitialConnectionStrategyPlugin with a plugin code --- .../software/amazon/jdbc/ConnectionPluginChainBuilder.java | 3 +++ .../java/software/amazon/jdbc/ConnectionPluginManager.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/wrapper/src/main/java/software/amazon/jdbc/ConnectionPluginChainBuilder.java b/wrapper/src/main/java/software/amazon/jdbc/ConnectionPluginChainBuilder.java index 353e3eeb6..7bb29f661 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/ConnectionPluginChainBuilder.java +++ b/wrapper/src/main/java/software/amazon/jdbc/ConnectionPluginChainBuilder.java @@ -28,6 +28,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; import software.amazon.jdbc.plugin.AuroraConnectionTrackerPluginFactory; import software.amazon.jdbc.plugin.AuroraHostListConnectionPluginFactory; +import software.amazon.jdbc.plugin.AuroraInitialConnectionStrategyPluginFactory; import software.amazon.jdbc.plugin.AwsSecretsManagerConnectionPluginFactory; import software.amazon.jdbc.plugin.ConnectTimeConnectionPluginFactory; import software.amazon.jdbc.plugin.DataCacheConnectionPluginFactory; @@ -73,6 +74,7 @@ public class ConnectionPluginChainBuilder { put("connectTime", ConnectTimeConnectionPluginFactory.class); put("dev", DeveloperConnectionPluginFactory.class); put("fastestResponseStrategy", FastestResponseStrategyPluginFactory.class); + put("initialConnection", AuroraInitialConnectionStrategyPluginFactory.class); } }; @@ -87,6 +89,7 @@ public class ConnectionPluginChainBuilder { put(DriverMetaDataConnectionPluginFactory.class, 100); put(DataCacheConnectionPluginFactory.class, 200); put(AuroraHostListConnectionPluginFactory.class, 300); + put(AuroraInitialConnectionStrategyPluginFactory.class, 390); put(AuroraConnectionTrackerPluginFactory.class, 400); put(AuroraStaleDnsPluginFactory.class, 500); put(ReadWriteSplittingPluginFactory.class, 600); diff --git a/wrapper/src/main/java/software/amazon/jdbc/ConnectionPluginManager.java b/wrapper/src/main/java/software/amazon/jdbc/ConnectionPluginManager.java index 39f659c1f..fb78ccfa6 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/ConnectionPluginManager.java +++ b/wrapper/src/main/java/software/amazon/jdbc/ConnectionPluginManager.java @@ -33,6 +33,7 @@ import software.amazon.jdbc.cleanup.CanReleaseResources; import software.amazon.jdbc.plugin.AuroraConnectionTrackerPlugin; import software.amazon.jdbc.plugin.AuroraHostListConnectionPlugin; +import software.amazon.jdbc.plugin.AuroraInitialConnectionStrategyPlugin; import software.amazon.jdbc.plugin.AwsSecretsManagerConnectionPlugin; import software.amazon.jdbc.plugin.DataCacheConnectionPlugin; import software.amazon.jdbc.plugin.DefaultConnectionPlugin; @@ -79,6 +80,7 @@ public class ConnectionPluginManager implements CanReleaseResources, Wrapper { put(ReadWriteSplittingPlugin.class, "plugin:readWriteSplitting"); put(FastestResponseStrategyPlugin.class, "plugin:fastestResponseStrategy"); put(DefaultConnectionPlugin.class, "plugin:targetDriver"); + put(AuroraInitialConnectionStrategyPlugin.class, "plugin:initialConnection"); } };