Module io.github.bucket4j.core
Class AbstractJdbcProxyManagerBuilder<K,P extends ProxyManager<K>,B extends AbstractJdbcProxyManagerBuilder<K,P,B>>
- java.lang.Object
-
- io.github.bucket4j.distributed.proxy.AbstractProxyManagerBuilder<K,P,B>
-
- io.github.bucket4j.distributed.jdbc.AbstractJdbcProxyManagerBuilder<K,P,B>
-
- Type Parameters:
K- type of keyP- type of proxy manager that is being buildB- the type of builder extendingAbstractJdbcProxyManagerBuilder
public abstract class AbstractJdbcProxyManagerBuilder<K,P extends ProxyManager<K>,B extends AbstractJdbcProxyManagerBuilder<K,P,B>> extends AbstractProxyManagerBuilder<K,P,B>
Base class for all JDBC proxy-manager builders.
-
-
Field Summary
Fields Modifier and Type Field Description protected PrimaryKeyMapper<K>primaryKeyMapper
-
Constructor Summary
Constructors Constructor Description AbstractJdbcProxyManagerBuilder(DataSource dataSource, PrimaryKeyMapper<K> primaryKeyMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BaddCustomColumn(CustomColumnProvider<K> column)Specifies provider of custom field valueBexpiresAtColumn(String expiresAtColumnName)Specifies name of column that used to store expiration date, instead of name "expires_at" that is configured by default.List<CustomColumnProvider<K>>getCustomColumns()DataSourcegetDataSource()StringgetExpiresAtColumnName()StringgetIdColumnName()PrimaryKeyMapper<K>getPrimaryKeyMapper()StringgetStateColumnName()StringgetTableName()BidColumn(String idColumnName)Specifies name of primary key in buckets tableBstateColumn(String stateColumnName)Specifies name column that used to store a state of bucketBtable(String tableName)Specifies name of table to use as a Buckets store-
Methods inherited from class io.github.bucket4j.distributed.proxy.AbstractProxyManagerBuilder
backwardCompatibleWith, build, clientClock, defaultListener, defaultRecoveryStrategy, executionStrategy, expirationAfterWrite, getBackwardCompatibilityVersion, getClientSideClock, getClientSideConfig, getExecutionStrategy, getExpirationAfterWrite, getRequestTimeoutNanos, isExpireAfterWriteSupported, requestTimeout
-
-
-
-
Field Detail
-
primaryKeyMapper
protected PrimaryKeyMapper<K> primaryKeyMapper
-
-
Constructor Detail
-
AbstractJdbcProxyManagerBuilder
public AbstractJdbcProxyManagerBuilder(DataSource dataSource, PrimaryKeyMapper<K> primaryKeyMapper)
-
-
Method Detail
-
table
public B table(String tableName)
Specifies name of table to use as a Buckets store- Parameters:
tableName- of table to use as a Buckets store- Returns:
- this builder instance
-
idColumn
public B idColumn(String idColumnName)
Specifies name of primary key in buckets table- Parameters:
idColumnName- name of primary key in buckets table- Returns:
- this builder instance
-
stateColumn
public B stateColumn(String stateColumnName)
Specifies name column that used to store a state of bucket- Parameters:
stateColumnName- name of column that used to store a state of bucket- Returns:
- this builder instance
-
expiresAtColumn
public B expiresAtColumn(String expiresAtColumnName)
Specifies name of column that used to store expiration date, instead of name "expires_at" that is configured by default.- Parameters:
expiresAtColumnName- name of column that used to store expiration date- Returns:
- this builder instance
-
addCustomColumn
public B addCustomColumn(CustomColumnProvider<K> column)
Specifies provider of custom field value- Parameters:
column- provider of custom field value- Returns:
- this builder instance
-
getDataSource
public DataSource getDataSource()
-
getPrimaryKeyMapper
public PrimaryKeyMapper<K> getPrimaryKeyMapper()
-
getTableName
public String getTableName()
-
getIdColumnName
public String getIdColumnName()
-
getStateColumnName
public String getStateColumnName()
-
getExpiresAtColumnName
public String getExpiresAtColumnName()
-
getCustomColumns
public List<CustomColumnProvider<K>> getCustomColumns()
-
-