diff --git a/README.md b/README.md index 34c46293..1877b09b 100644 --- a/README.md +++ b/README.md @@ -11,14 +11,14 @@ The Bucket4j is distributed through [Maven Central](http://search.maven.org/): com.bucket4j bucket4j-core - 8.10.0 + 8.10.1 com.bucket4j bucket4j_jdk8-core - 8.10.0 + 8.10.1 ``` #### Quick start @@ -42,8 +42,8 @@ private void doSomethingProtected() { More examples [can be found there](https://bucket4j.github.io/8.3.0/toc.html#quick-start-examples) ## [Documentation](https://bucket4j.github.io) -* [Reference](https://bucket4j.github.io/8.9.0/toc.html) -* [Quick start examples](https://bucket4j.github.io/8.9.0/toc.html#quick-start-examples) +* [Reference](https://bucket4j.github.io/8.10.1/toc.html) +* [Quick start examples](https://bucket4j.github.io/8.10.1/toc.html#quick-start-examples) * [Third-party articles](https://bucket4j.github.io/#third-party-articles) ## Bucket4j basic features @@ -81,13 +81,13 @@ In addition to local in-memory buckets, the Bucket4j supports clustered usage sc | ```Redis/Lettuce``` | Yes | Yes | [bucket4j-redis/Lettuce](https://bucket4j.github.io/8.7.0/toc.html#example-of-bucket-instantiation-via-lettucebasedproxymanager) | ### JDBC back-ends -| Back-end | Documentation link | -|:---------------------------|:------------------------------------------------------------------------------------------:| -| ```MySQL``` | [bucket4j-mysql](https://bucket4j.github.io/8.9.0/toc.html#mysql-integration) | -| ```PostgreSQL``` | [bucket4j-postgresql](https://bucket4j.github.io/8.9.0/toc.html#postgresql-integration) | -| ```Oracle``` | [bucket4j-oracle](https://bucket4j.github.io/8.9.0/toc.html#oracle-integration) | -| ```Microsoft SQL Server``` | [bucket4j-mssql](https://bucket4j.github.io/8.9.0/toc.html#microsoftsqlserver-integration) | -| ```MariaDB``` | [bucket4j-mariadb](https://bucket4j.github.io/8.9.0/toc.html#mariadb-integration) | +| Back-end | Documentation link | +|:---------------------------|:-------------------------------------------------------------------------------------------:| +| ```MySQL``` | [bucket4j-mysql](https://bucket4j.github.io/8.10.1/toc.html#mysql-integration) | +| ```PostgreSQL``` | [bucket4j-postgresql](https://bucket4j.github.io/8.10.1/toc.html#postgresql-integration) | +| ```Oracle``` | [bucket4j-oracle](https://bucket4j.github.io/8.10.1/toc.html#oracle-integration) | +| ```Microsoft SQL Server``` | [bucket4j-mssql](https://bucket4j.github.io/8.10.1/toc.html#microsoftsqlserver-integration) | +| ```MariaDB``` | [bucket4j-mariadb](https://bucket4j.github.io/8.10.1/toc.html#mariadb-integration) | ### Local caches support diff --git a/asciidoc/pom.xml b/asciidoc/pom.xml index 40c93803..104a3640 100644 --- a/asciidoc/pom.xml +++ b/asciidoc/pom.xml @@ -8,7 +8,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent asciidoc diff --git a/backward-compatibility-tests/common/pom.xml b/backward-compatibility-tests/common/pom.xml index ad95734c..5c573c7f 100644 --- a/backward-compatibility-tests/common/pom.xml +++ b/backward-compatibility-tests/common/pom.xml @@ -8,7 +8,7 @@ com.bucket4j backward-compatibility-tests - 8.10.0 + 8.10.1 ../../backward-compatibility-tests backward-compatibility-tests-common @@ -24,7 +24,7 @@ com.bucket4j bucket4j-core - 8.10.0 + 8.10.1 compile diff --git a/backward-compatibility-tests/current/pom.xml b/backward-compatibility-tests/current/pom.xml index 6aa122fb..ad35967c 100644 --- a/backward-compatibility-tests/current/pom.xml +++ b/backward-compatibility-tests/current/pom.xml @@ -8,7 +8,7 @@ com.bucket4j backward-compatibility-tests - 8.10.0 + 8.10.1 ../../backward-compatibility-tests backward-compatibility-tests-current @@ -16,7 +16,7 @@ backward_compatibility_tests_current - 8.10.0 + 8.10.1 true true diff --git a/backward-compatibility-tests/pom.xml b/backward-compatibility-tests/pom.xml index 2ad2ac90..217ce04b 100644 --- a/backward-compatibility-tests/pom.xml +++ b/backward-compatibility-tests/pom.xml @@ -5,7 +5,7 @@ bucket4j-parent com.bucket4j - 8.10.0 + 8.10.1 ../bucket4j-parent pom diff --git a/backward-compatibility-tests/previous/pom.xml b/backward-compatibility-tests/previous/pom.xml index 6ba3a1c6..ce422209 100644 --- a/backward-compatibility-tests/previous/pom.xml +++ b/backward-compatibility-tests/previous/pom.xml @@ -8,7 +8,7 @@ com.bucket4j backward-compatibility-tests - 8.10.0 + 8.10.1 ../../backward-compatibility-tests backward-compatibility-tests-prevoius diff --git a/bucket4j-benchmarks/pom.xml b/bucket4j-benchmarks/pom.xml index 45de8224..1da5d5a9 100644 --- a/bucket4j-benchmarks/pom.xml +++ b/bucket4j-benchmarks/pom.xml @@ -8,7 +8,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent bucket4j-benchmarks diff --git a/bucket4j-caffeine/pom.xml b/bucket4j-caffeine/pom.xml index acb0b37d..972a679f 100644 --- a/bucket4j-caffeine/pom.xml +++ b/bucket4j-caffeine/pom.xml @@ -8,7 +8,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent bucket4j-caffeine diff --git a/bucket4j-coherence/pom.xml b/bucket4j-coherence/pom.xml index d5b525cd..96c2f5ba 100644 --- a/bucket4j-coherence/pom.xml +++ b/bucket4j-coherence/pom.xml @@ -9,7 +9,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent diff --git a/bucket4j-core/pom.xml b/bucket4j-core/pom.xml index 8a0743cc..c105bf49 100644 --- a/bucket4j-core/pom.xml +++ b/bucket4j-core/pom.xml @@ -7,7 +7,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent 4.0.0 diff --git a/bucket4j-examples/pom.xml b/bucket4j-examples/pom.xml index 93ffa34b..1f9c3955 100644 --- a/bucket4j-examples/pom.xml +++ b/bucket4j-examples/pom.xml @@ -23,7 +23,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent 4.0.0 diff --git a/bucket4j-hazelcast-all/bucket4j-hazelcast-4/pom.xml b/bucket4j-hazelcast-all/bucket4j-hazelcast-4/pom.xml index cec4bbbd..dd82bec4 100644 --- a/bucket4j-hazelcast-all/bucket4j-hazelcast-4/pom.xml +++ b/bucket4j-hazelcast-all/bucket4j-hazelcast-4/pom.xml @@ -8,7 +8,7 @@ com.bucket4j bucket4j-hazelcast-all - 8.10.0 + 8.10.1 ../../bucket4j-hazelcast-all bucket4j-hazelcast-4 diff --git a/bucket4j-hazelcast-all/bucket4j-hazelcast/pom.xml b/bucket4j-hazelcast-all/bucket4j-hazelcast/pom.xml index 09fe738d..5e4b92d2 100644 --- a/bucket4j-hazelcast-all/bucket4j-hazelcast/pom.xml +++ b/bucket4j-hazelcast-all/bucket4j-hazelcast/pom.xml @@ -8,7 +8,7 @@ com.bucket4j bucket4j-hazelcast-all - 8.10.0 + 8.10.1 ../../bucket4j-hazelcast-all bucket4j-hazelcast diff --git a/bucket4j-hazelcast-all/pom.xml b/bucket4j-hazelcast-all/pom.xml index 0a2ff27b..29e6d293 100644 --- a/bucket4j-hazelcast-all/pom.xml +++ b/bucket4j-hazelcast-all/pom.xml @@ -5,7 +5,7 @@ bucket4j-parent com.bucket4j - 8.10.0 + 8.10.1 ../bucket4j-parent pom diff --git a/bucket4j-ignite/pom.xml b/bucket4j-ignite/pom.xml index 40db6be0..538766fb 100644 --- a/bucket4j-ignite/pom.xml +++ b/bucket4j-ignite/pom.xml @@ -8,7 +8,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent bucket4j-ignite diff --git a/bucket4j-infinispan-all/bucket4j-infinispan/pom.xml b/bucket4j-infinispan-all/bucket4j-infinispan/pom.xml index 16eecbed..78d9f502 100644 --- a/bucket4j-infinispan-all/bucket4j-infinispan/pom.xml +++ b/bucket4j-infinispan-all/bucket4j-infinispan/pom.xml @@ -8,7 +8,7 @@ com.bucket4j bucket4j-infinispan-all - 8.10.0 + 8.10.1 ../../bucket4j-infinispan-all bucket4j-infinispan diff --git a/bucket4j-infinispan-all/pom.xml b/bucket4j-infinispan-all/pom.xml index df42d4b4..69036e99 100644 --- a/bucket4j-infinispan-all/pom.xml +++ b/bucket4j-infinispan-all/pom.xml @@ -6,7 +6,7 @@ bucket4j-parent com.bucket4j - 8.10.0 + 8.10.1 ../bucket4j-parent 4.0.0 diff --git a/bucket4j-jcache/pom.xml b/bucket4j-jcache/pom.xml index d7e45d7c..09bc588c 100644 --- a/bucket4j-jcache/pom.xml +++ b/bucket4j-jcache/pom.xml @@ -7,7 +7,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent 4.0.0 diff --git a/bucket4j-mariadb/pom.xml b/bucket4j-mariadb/pom.xml index 925309fb..d86cc1c8 100644 --- a/bucket4j-mariadb/pom.xml +++ b/bucket4j-mariadb/pom.xml @@ -7,7 +7,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent diff --git a/bucket4j-mariadb/src/main/java/io/github/bucket4j/mariadb/MariaDBSelectForUpdateBasedProxyManager.java b/bucket4j-mariadb/src/main/java/io/github/bucket4j/mariadb/MariaDBSelectForUpdateBasedProxyManager.java index 81cfc424..9b347d61 100644 --- a/bucket4j-mariadb/src/main/java/io/github/bucket4j/mariadb/MariaDBSelectForUpdateBasedProxyManager.java +++ b/bucket4j-mariadb/src/main/java/io/github/bucket4j/mariadb/MariaDBSelectForUpdateBasedProxyManager.java @@ -62,15 +62,7 @@ public class MariaDBSelectForUpdateBasedProxyManager extends AbstractSelectFo * @param configuration {@link SQLProxyConfiguration} configuration. */ public MariaDBSelectForUpdateBasedProxyManager(SQLProxyConfiguration configuration) { - this(configuration, ClientSideConfig.getDefault()); - } - - /** - * - * @param configuration {@link SQLProxyConfiguration} configuration. - */ - public MariaDBSelectForUpdateBasedProxyManager(SQLProxyConfiguration configuration, ClientSideConfig clientSideConfig) { - super(clientSideConfig); + super(configuration.getClientSideConfig()); this.dataSource = Objects.requireNonNull(configuration.getDataSource()); this.configuration = configuration; this.removeSqlQuery = MessageFormat.format("DELETE FROM {0} WHERE {1} = ?", configuration.getTableName(), configuration.getIdName()); diff --git a/bucket4j-mariadb/src/test/java/io/github/bucket4j/mariadb/MariaDBSelectForUpdateLockBasedTransactionTest.java b/bucket4j-mariadb/src/test/java/io/github/bucket4j/mariadb/MariaDBSelectForUpdateLockBasedTransactionTest.java index 6bfbc43d..136ae94b 100644 --- a/bucket4j-mariadb/src/test/java/io/github/bucket4j/mariadb/MariaDBSelectForUpdateLockBasedTransactionTest.java +++ b/bucket4j-mariadb/src/test/java/io/github/bucket4j/mariadb/MariaDBSelectForUpdateLockBasedTransactionTest.java @@ -38,20 +38,23 @@ public static void initializeInstance() throws SQLException { statement.execute(query); } } - SQLProxyConfiguration configuration = SQLProxyConfiguration.builder() - .withTableSettings(tableSettings) - .build(dataSource); specs = Arrays.asList( new ProxyManagerSpec<>( "MariaDBSelectForUpdateBasedProxyManager", () -> ThreadLocalRandom.current().nextLong(1_000_000_000), - clientConfig -> new MariaDBSelectForUpdateBasedProxyManager<>(configuration, clientConfig) + clientConfig -> new MariaDBSelectForUpdateBasedProxyManager<>(SQLProxyConfiguration.builder() + .withTableSettings(tableSettings) + .withClientSideConfig(clientConfig) + .build(dataSource)) ), new ProxyManagerSpec<>( "MariaDBSelectForUpdateBasedProxyManager_withTimeout", () -> ThreadLocalRandom.current().nextLong(1_000_000_000), - clientConfig -> new MariaDBSelectForUpdateBasedProxyManager<>(configuration, clientConfig.withRequestTimeout(Duration.ofSeconds(3))) + clientConfig -> new MariaDBSelectForUpdateBasedProxyManager<>(SQLProxyConfiguration.builder() + .withTableSettings(tableSettings) + .withClientSideConfig(clientConfig.withRequestTimeout(Duration.ofSeconds(3))) + .build(dataSource)) ) ); } diff --git a/bucket4j-mssql/pom.xml b/bucket4j-mssql/pom.xml index 574c9057..e284757e 100644 --- a/bucket4j-mssql/pom.xml +++ b/bucket4j-mssql/pom.xml @@ -7,7 +7,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent diff --git a/bucket4j-mssql/src/main/java/io/github/bucket4j/mssql/MSSQLSelectForUpdateBasedProxyManager.java b/bucket4j-mssql/src/main/java/io/github/bucket4j/mssql/MSSQLSelectForUpdateBasedProxyManager.java index d797ba0f..1f105e28 100644 --- a/bucket4j-mssql/src/main/java/io/github/bucket4j/mssql/MSSQLSelectForUpdateBasedProxyManager.java +++ b/bucket4j-mssql/src/main/java/io/github/bucket4j/mssql/MSSQLSelectForUpdateBasedProxyManager.java @@ -54,8 +54,8 @@ public class MSSQLSelectForUpdateBasedProxyManager extends AbstractSelectForU * * @param configuration {@link SQLProxyConfiguration} configuration. */ - public MSSQLSelectForUpdateBasedProxyManager(SQLProxyConfiguration configuration, ClientSideConfig clientSideConfig) { - super(clientSideConfig); + public MSSQLSelectForUpdateBasedProxyManager(SQLProxyConfiguration configuration) { + super(configuration.getClientSideConfig()); this.dataSource = Objects.requireNonNull(configuration.getDataSource()); this.configuration = configuration; this.removeSqlQuery = MessageFormat.format("DELETE FROM {0} WHERE {1} = ?", configuration.getTableName(), configuration.getIdName()); @@ -66,14 +66,6 @@ public MSSQLSelectForUpdateBasedProxyManager(SQLProxyConfiguration configurat this.selectSqlQuery = MessageFormat.format("SELECT {0} FROM {1} WITH(ROWLOCK, UPDLOCK) WHERE {2} = ?", configuration.getStateName(), configuration.getTableName(), configuration.getIdName()); } - /** - * - * @param configuration {@link SQLProxyConfiguration} configuration. - */ - public MSSQLSelectForUpdateBasedProxyManager(SQLProxyConfiguration configuration) { - this(configuration, ClientSideConfig.getDefault()); - } - @Override protected SelectForUpdateBasedTransaction allocateTransaction(K key, Optional requestTimeoutNanos) { Connection connection; diff --git a/bucket4j-mssql/src/test/java/io/github/bucket4j/mssql/MSSQLSelectForUpdateBasedProxyManagerTest.java b/bucket4j-mssql/src/test/java/io/github/bucket4j/mssql/MSSQLSelectForUpdateBasedProxyManagerTest.java index 9680f821..657d25dc 100644 --- a/bucket4j-mssql/src/test/java/io/github/bucket4j/mssql/MSSQLSelectForUpdateBasedProxyManagerTest.java +++ b/bucket4j-mssql/src/test/java/io/github/bucket4j/mssql/MSSQLSelectForUpdateBasedProxyManagerTest.java @@ -47,20 +47,23 @@ public static void initializeInstance() throws SQLException { statement.execute(query); } } - SQLProxyConfiguration configuration = SQLProxyConfiguration.builder() - .withTableSettings(tableSettings) - .build(dataSource); specs = Arrays.asList( new ProxyManagerSpec<>( "MSSQLSelectForUpdateBasedProxyManager", () -> ThreadLocalRandom.current().nextLong(1_000_000_000), - clientConfig -> new MSSQLSelectForUpdateBasedProxyManager<>(configuration, clientConfig) + clientConfig -> new MSSQLSelectForUpdateBasedProxyManager<>(SQLProxyConfiguration.builder() + .withTableSettings(tableSettings) + .withClientSideConfig(clientConfig) + .build(dataSource)) ), new ProxyManagerSpec<>( "MSSQLSelectForUpdateBasedProxyManager_withTimeout", () -> ThreadLocalRandom.current().nextLong(1_000_000_000), - clientConfig -> new MSSQLSelectForUpdateBasedProxyManager<>(configuration, clientConfig.withRequestTimeout(Duration.ofSeconds(3))) + clientConfig -> new MSSQLSelectForUpdateBasedProxyManager<>(SQLProxyConfiguration.builder() + .withTableSettings(tableSettings) + .withClientSideConfig(clientConfig.withRequestTimeout(Duration.ofSeconds(3))) + .build(dataSource)) ) ); } diff --git a/bucket4j-mysql/pom.xml b/bucket4j-mysql/pom.xml index a20fc1c3..e534ca58 100644 --- a/bucket4j-mysql/pom.xml +++ b/bucket4j-mysql/pom.xml @@ -7,7 +7,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent diff --git a/bucket4j-oracle/pom.xml b/bucket4j-oracle/pom.xml index 49282e7a..75488191 100644 --- a/bucket4j-oracle/pom.xml +++ b/bucket4j-oracle/pom.xml @@ -7,7 +7,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent diff --git a/bucket4j-oracle/src/main/java/io/github/bucket4j/oracle/OracleSelectForUpdateBasedProxyManager.java b/bucket4j-oracle/src/main/java/io/github/bucket4j/oracle/OracleSelectForUpdateBasedProxyManager.java index cb5f8f81..5d00b9f5 100644 --- a/bucket4j-oracle/src/main/java/io/github/bucket4j/oracle/OracleSelectForUpdateBasedProxyManager.java +++ b/bucket4j-oracle/src/main/java/io/github/bucket4j/oracle/OracleSelectForUpdateBasedProxyManager.java @@ -58,11 +58,7 @@ public class OracleSelectForUpdateBasedProxyManager extends AbstractSelectFor * @param configuration {@link SQLProxyConfiguration} configuration. */ public OracleSelectForUpdateBasedProxyManager(SQLProxyConfiguration configuration) { - this(configuration, ClientSideConfig.getDefault()); - } - - public OracleSelectForUpdateBasedProxyManager(SQLProxyConfiguration configuration, ClientSideConfig clientSideConfig) { - super(clientSideConfig); + super(configuration.getClientSideConfig()); this.dataSource = Objects.requireNonNull(configuration.getDataSource()); this.configuration = configuration; this.removeSqlQuery = MessageFormat.format("DELETE FROM {0} WHERE {1} = ?", configuration.getTableName(), configuration.getIdName()); diff --git a/bucket4j-oracle/src/test/java/io/github/bucket4j/oracle/OracleSelectForUpdateLockBasedTransactionTest.java b/bucket4j-oracle/src/test/java/io/github/bucket4j/oracle/OracleSelectForUpdateLockBasedTransactionTest.java index fb38e3a5..f8792e29 100644 --- a/bucket4j-oracle/src/test/java/io/github/bucket4j/oracle/OracleSelectForUpdateLockBasedTransactionTest.java +++ b/bucket4j-oracle/src/test/java/io/github/bucket4j/oracle/OracleSelectForUpdateLockBasedTransactionTest.java @@ -38,20 +38,23 @@ public static void initializeInstance() throws SQLException { statement.execute(query); } } - SQLProxyConfiguration configuration = SQLProxyConfiguration.builder() - .withTableSettings(tableSettings) - .build(dataSource); specs = Arrays.asList( new ProxyManagerSpec<>( "OracleSelectForUpdateBasedProxyManager", () -> ThreadLocalRandom.current().nextLong(1_000_000_000), - clientConfig -> new OracleSelectForUpdateBasedProxyManager<>(configuration, clientConfig) + clientConfig -> new OracleSelectForUpdateBasedProxyManager<>(SQLProxyConfiguration.builder() + .withTableSettings(tableSettings) + .withClientSideConfig(clientConfig) + .build(dataSource)) ), new ProxyManagerSpec<>( "OracleSelectForUpdateBasedProxyManager_withTimeout", () -> ThreadLocalRandom.current().nextLong(1_000_000_000), - clientConfig -> new OracleSelectForUpdateBasedProxyManager<>(configuration, clientConfig.withRequestTimeout(Duration.ofSeconds(3))) + clientConfig -> new OracleSelectForUpdateBasedProxyManager<>(SQLProxyConfiguration.builder() + .withTableSettings(tableSettings) + .withClientSideConfig(clientConfig.withRequestTimeout(Duration.ofSeconds(3))) + .build(dataSource)) ) ); } diff --git a/bucket4j-parent/pom.xml b/bucket4j-parent/pom.xml index d515f174..e29ffc87 100644 --- a/bucket4j-parent/pom.xml +++ b/bucket4j-parent/pom.xml @@ -7,7 +7,7 @@ 4.0.0 com.bucket4j - 8.10.0 + 8.10.1 bucket4j-parent pom bucket4j-parent diff --git a/bucket4j-postgresql/pom.xml b/bucket4j-postgresql/pom.xml index e3bdd5df..a487bedf 100644 --- a/bucket4j-postgresql/pom.xml +++ b/bucket4j-postgresql/pom.xml @@ -7,7 +7,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent diff --git a/bucket4j-postgresql/src/main/java/io/github/bucket4j/postgresql/PostgreSQLSelectForUpdateBasedProxyManager.java b/bucket4j-postgresql/src/main/java/io/github/bucket4j/postgresql/PostgreSQLSelectForUpdateBasedProxyManager.java index 83c4a11b..b1377d92 100644 --- a/bucket4j-postgresql/src/main/java/io/github/bucket4j/postgresql/PostgreSQLSelectForUpdateBasedProxyManager.java +++ b/bucket4j-postgresql/src/main/java/io/github/bucket4j/postgresql/PostgreSQLSelectForUpdateBasedProxyManager.java @@ -70,15 +70,7 @@ public class PostgreSQLSelectForUpdateBasedProxyManager extends AbstractSelec * @param configuration {@link SQLProxyConfiguration} configuration. */ public PostgreSQLSelectForUpdateBasedProxyManager(SQLProxyConfiguration configuration) { - this(configuration, ClientSideConfig.getDefault()); - } - - /** - * - * @param configuration {@link SQLProxyConfiguration} configuration. - */ - public PostgreSQLSelectForUpdateBasedProxyManager(SQLProxyConfiguration configuration, ClientSideConfig clientSideConfig) { - super(clientSideConfig); + super(configuration.getClientSideConfig()); this.dataSource = Objects.requireNonNull(configuration.getDataSource()); this.configuration = configuration; this.removeSqlQuery = MessageFormat.format("DELETE FROM {0} WHERE {1} = ?", configuration.getTableName(), configuration.getIdName()); diff --git a/bucket4j-postgresql/src/main/java/io/github/bucket4j/postgresql/PostgreSQLadvisoryLockBasedProxyManager.java b/bucket4j-postgresql/src/main/java/io/github/bucket4j/postgresql/PostgreSQLadvisoryLockBasedProxyManager.java index b24832e0..439eec1d 100644 --- a/bucket4j-postgresql/src/main/java/io/github/bucket4j/postgresql/PostgreSQLadvisoryLockBasedProxyManager.java +++ b/bucket4j-postgresql/src/main/java/io/github/bucket4j/postgresql/PostgreSQLadvisoryLockBasedProxyManager.java @@ -63,16 +63,12 @@ public class PostgreSQLadvisoryLockBasedProxyManager extends AbstractLockBase private final String insertSqlQuery; private final String selectSqlQuery; - public PostgreSQLadvisoryLockBasedProxyManager(SQLProxyConfiguration configuration) { - this(configuration, ClientSideConfig.getDefault()); - } - /** * * @param configuration {@link SQLProxyConfiguration} configuration. */ - public PostgreSQLadvisoryLockBasedProxyManager(SQLProxyConfiguration configuration, ClientSideConfig clientSideConfig) { - super(clientSideConfig); + public PostgreSQLadvisoryLockBasedProxyManager(SQLProxyConfiguration configuration) { + super(configuration.getClientSideConfig()); this.dataSource = Objects.requireNonNull(configuration.getDataSource()); this.configuration = configuration; this.removeSqlQuery = MessageFormat.format("DELETE FROM {0} WHERE {1} = ?", configuration.getTableName(), configuration.getIdName()); diff --git a/bucket4j-postgresql/src/test/java/io/github/bucket4j/postgresql/PostgreSQLTest.java b/bucket4j-postgresql/src/test/java/io/github/bucket4j/postgresql/PostgreSQLTest.java index 29701513..c69a1127 100644 --- a/bucket4j-postgresql/src/test/java/io/github/bucket4j/postgresql/PostgreSQLTest.java +++ b/bucket4j-postgresql/src/test/java/io/github/bucket4j/postgresql/PostgreSQLTest.java @@ -39,9 +39,6 @@ public static void initializeInstance() throws SQLException { statement.execute(query); } } - SQLProxyConfiguration configuration_1 = SQLProxyConfiguration.builder() - .withTableSettings(tableSettings_1) - .build(dataSource); BucketTableSettings tableSettings_2 = BucketTableSettings.customSettings("buckets_String_key", "id", "state"); @@ -52,36 +49,50 @@ public static void initializeInstance() throws SQLException { statement.execute(query); } } - SQLProxyConfiguration configuration_2 = SQLProxyConfiguration.builder() - .withPrimaryKeyMapper(PrimaryKeyMapper.STRING) - .withTableSettings(tableSettings_2) - .build(dataSource); specs = Arrays.asList( new ProxyManagerSpec<>( "PostgreSQLadvisoryLockBasedProxyManager", () -> ThreadLocalRandom.current().nextLong(1_000_000_000), - clientConfig -> new PostgreSQLadvisoryLockBasedProxyManager<>(configuration_1, clientConfig) + clientConfig -> new PostgreSQLadvisoryLockBasedProxyManager<>(SQLProxyConfiguration.builder() + .withTableSettings(tableSettings_1) + .withClientSideConfig(clientConfig) + .build(dataSource)) ), new ProxyManagerSpec<>( "PostgreSQLSelectForUpdateBasedProxyManager", () -> ThreadLocalRandom.current().nextLong(1_000_000_000), - clientConfig -> new PostgreSQLSelectForUpdateBasedProxyManager<>(configuration_1, clientConfig) + clientConfig -> new PostgreSQLSelectForUpdateBasedProxyManager<>(SQLProxyConfiguration.builder() + .withTableSettings(tableSettings_1) + .withClientSideConfig(clientConfig) + .build(dataSource)) ), new ProxyManagerSpec<>( "PostgreSQLadvisoryLockBasedProxyManager_withRequestTimeout", () -> ThreadLocalRandom.current().nextLong(1_000_000_000), - clientConfig -> new PostgreSQLadvisoryLockBasedProxyManager<>(configuration_1, clientConfig.withRequestTimeout(Duration.ofSeconds(3))) + clientConfig -> new PostgreSQLadvisoryLockBasedProxyManager<>(SQLProxyConfiguration.builder() + .withTableSettings(tableSettings_1) + .withClientSideConfig(clientConfig.withRequestTimeout(Duration.ofSeconds(3))) + .build(dataSource) + ) ), new ProxyManagerSpec<>( "PostgreSQLSelectForUpdateBasedProxyManager_withRequestTimeout", () -> ThreadLocalRandom.current().nextLong(1_000_000_000), - clientConfig -> new PostgreSQLSelectForUpdateBasedProxyManager<>(configuration_1, clientConfig.withRequestTimeout(Duration.ofSeconds(3))) + clientConfig -> new PostgreSQLadvisoryLockBasedProxyManager<>(SQLProxyConfiguration.builder() + .withTableSettings(tableSettings_1) + .withClientSideConfig(clientConfig.withRequestTimeout(Duration.ofSeconds(3))) + .build(dataSource) + ) ), new ProxyManagerSpec<>( "PostgreSQLadvisoryLockBasedProxyManager_StringKey", () -> UUID.randomUUID().toString(), - clientConfig -> new PostgreSQLadvisoryLockBasedProxyManager<>(configuration_2, clientConfig) + clientConfig -> new PostgreSQLadvisoryLockBasedProxyManager<>(SQLProxyConfiguration.builder() + .withPrimaryKeyMapper(PrimaryKeyMapper.STRING) + .withTableSettings(tableSettings_2) + .withClientSideConfig(clientConfig) + .build(dataSource)) ) ); } diff --git a/bucket4j-redis/pom.xml b/bucket4j-redis/pom.xml index a22539a8..31273552 100644 --- a/bucket4j-redis/pom.xml +++ b/bucket4j-redis/pom.xml @@ -8,7 +8,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent bucket4j-redis diff --git a/experimental/bucket4j-lua/pom.xml b/experimental/bucket4j-lua/pom.xml index a57c3e73..973b0bcb 100644 --- a/experimental/bucket4j-lua/pom.xml +++ b/experimental/bucket4j-lua/pom.xml @@ -24,7 +24,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../../bucket4j-parent bucket4j-lua diff --git a/experimental/pom.xml b/experimental/pom.xml index e573196d..aa597391 100644 --- a/experimental/pom.xml +++ b/experimental/pom.xml @@ -6,7 +6,7 @@ com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ../bucket4j-parent 4.0.0 diff --git a/lincheck-tests/pom.xml b/lincheck-tests/pom.xml index 4a71ebeb..f30f5a59 100644 --- a/lincheck-tests/pom.xml +++ b/lincheck-tests/pom.xml @@ -5,7 +5,7 @@ com.bucket4j - 8.10.0 + 8.10.1 bucket4j-parent ../bucket4j-parent diff --git a/pom.xml b/pom.xml index c0dbba3b..cd711b1f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,13 +5,13 @@ com.bucket4j bucket4j - 8.10.0 + 8.10.1 pom com.bucket4j bucket4j-parent - 8.10.0 + 8.10.1 ./bucket4j-parent