public class ProxyDataSourceBuilder extends Object
ProxyDataSource.| Modifier and Type | Class and Description |
|---|---|
static interface |
ProxyDataSourceBuilder.SingleMethodExecution
Functional interface to simplify adding
MethodExecutionListener. |
static interface |
ProxyDataSourceBuilder.SingleQueryExecution
Functional interface to simplify adding
QueryExecutionListener. |
| Constructor and Description |
|---|
ProxyDataSourceBuilder() |
ProxyDataSourceBuilder(DataSource dataSource) |
public ProxyDataSourceBuilder()
public ProxyDataSourceBuilder(DataSource dataSource)
public static ProxyDataSourceBuilder create()
public static ProxyDataSourceBuilder create(DataSource dataSource)
public static ProxyDataSourceBuilder create(String dataSourceName, DataSource dataSource)
public ProxyDataSourceBuilder dataSource(DataSource dataSource)
dataSource - actual datasourcepublic ProxyDataSourceBuilder logQueryByCommons()
CommonsQueryLoggingListener.public ProxyDataSourceBuilder logQueryByCommons(CommonsLogLevel logLevel)
CommonsQueryLoggingListener.logLevel - log level for commonspublic ProxyDataSourceBuilder logQueryByCommons(String commonsLoggerName)
CommonsQueryLoggingListener.commonsLoggerName - commons logger namepublic ProxyDataSourceBuilder logQueryByCommons(CommonsLogLevel logLevel, String commonsLoggerName)
CommonsQueryLoggingListener.logLevel - log level for commonscommonsLoggerName - commons logger namepublic ProxyDataSourceBuilder logSlowQueryByCommons(long thresholdTime, TimeUnit timeUnit)
CommonsSlowQueryListener.thresholdTime - slow query threshold timetimeUnit - slow query threshold time unitpublic ProxyDataSourceBuilder logSlowQueryByCommons(long thresholdTime, TimeUnit timeUnit, CommonsLogLevel logLevel)
CommonsSlowQueryListener.thresholdTime - slow query threshold timetimeUnit - slow query threshold time unitlogLevel - log level for commonspublic ProxyDataSourceBuilder logSlowQueryByCommons(long thresholdTime, TimeUnit timeUnit, String logName)
CommonsSlowQueryListener.thresholdTime - slow query threshold timetimeUnit - slow query threshold time unitlogName - commons logger namepublic ProxyDataSourceBuilder logSlowQueryByCommons(long thresholdTime, TimeUnit timeUnit, CommonsLogLevel logLevel, String logName)
CommonsSlowQueryListener.thresholdTime - slow query threshold timetimeUnit - slow query threshold time unitlogLevel - log level for commonslogName - commons logger namepublic ProxyDataSourceBuilder logQueryBySlf4j()
SLF4JQueryLoggingListener.public ProxyDataSourceBuilder logQueryBySlf4j(SLF4JLogLevel logLevel)
SLF4JQueryLoggingListener.logLevel - log level for slf4jpublic ProxyDataSourceBuilder logQueryBySlf4j(String slf4jLoggerName)
SLF4JQueryLoggingListener.slf4jLoggerName - slf4j logger namepublic ProxyDataSourceBuilder logQueryBySlf4j(SLF4JLogLevel logLevel, String slf4jLoggerName)
SLF4JQueryLoggingListener.logLevel - log level for slf4jslf4jLoggerName - slf4j logger namepublic ProxyDataSourceBuilder logSlowQueryBySlf4j(long thresholdTime, TimeUnit timeUnit)
SLF4JSlowQueryListener.thresholdTime - slow query threshold timetimeUnit - slow query threshold time unitpublic ProxyDataSourceBuilder logSlowQueryBySlf4j(long thresholdTime, TimeUnit timeUnit, SLF4JLogLevel logLevel)
SLF4JSlowQueryListener.thresholdTime - slow query threshold timetimeUnit - slow query threshold time unitlogLevel - log level for slf4jpublic ProxyDataSourceBuilder logSlowQueryBySlf4j(long thresholdTime, TimeUnit timeUnit, String loggerName)
SLF4JSlowQueryListener.thresholdTime - slow query threshold timetimeUnit - slow query threshold time unitloggerName - slf4j logger namepublic ProxyDataSourceBuilder logSlowQueryBySlf4j(long thresholdTime, TimeUnit timeUnit, SLF4JLogLevel logLevel, String loggerName)
SLF4JSlowQueryListener.thresholdTime - slow query threshold timetimeUnit - slow query threshold time unitlogLevel - log level for slf4jloggerName - slf4j logger namepublic ProxyDataSourceBuilder logQueryByJUL()
JULQueryLoggingListener.public ProxyDataSourceBuilder logQueryByJUL(Level logLevel)
JULQueryLoggingListener.logLevel - log level for JULpublic ProxyDataSourceBuilder logQueryByJUL(String julLoggerName)
JULQueryLoggingListener.julLoggerName - JUL logger namepublic ProxyDataSourceBuilder logQueryByJUL(Level logLevel, String julLoggerName)
JULQueryLoggingListener.logLevel - log level for JULjulLoggerName - JUL logger namepublic ProxyDataSourceBuilder logSlowQueryByJUL(long thresholdTime, TimeUnit timeUnit)
JULSlowQueryListener.thresholdTime - slow query threshold timetimeUnit - slow query threshold time unitpublic ProxyDataSourceBuilder logSlowQueryByJUL(long thresholdTime, TimeUnit timeUnit, Level logLevel)
JULSlowQueryListener.thresholdTime - slow query threshold timetimeUnit - slow query threshold time unitlogLevel - log level for JULpublic ProxyDataSourceBuilder logSlowQueryByJUL(long thresholdTime, TimeUnit timeUnit, String loggerName)
JULSlowQueryListener.thresholdTime - slow query threshold timetimeUnit - slow query threshold time unitloggerName - JUL logger namepublic ProxyDataSourceBuilder logSlowQueryByJUL(long thresholdTime, TimeUnit timeUnit, Level logLevel, String loggerName)
JULSlowQueryListener.thresholdTime - slow query threshold timetimeUnit - slow query threshold time unitlogLevel - log level for JULloggerName - JUL logger namepublic ProxyDataSourceBuilder logQueryToSysOut()
SystemOutQueryLoggingListener.public ProxyDataSourceBuilder logSlowQueryToSysOut(long thresholdTime, TimeUnit timeUnit)
SystemOutSlowQueryListener.public ProxyDataSourceBuilder countQuery()
DataSourceQueryCountListener.public ProxyDataSourceBuilder countQuery(QueryCountStrategy queryCountStrategy)
DataSourceQueryCountListener.public ProxyDataSourceBuilder listener(QueryExecutionListener listener)
listener - a listener to registerpublic ProxyDataSourceBuilder beforeQuery(ProxyDataSourceBuilder.SingleQueryExecution callback)
QueryExecutionListener that performs given lambda on QueryExecutionListener.beforeQuery(ExecutionInfo, List).callback - a lambda function executed on QueryExecutionListener.beforeQuery(ExecutionInfo, List)public ProxyDataSourceBuilder afterQuery(ProxyDataSourceBuilder.SingleQueryExecution callback)
QueryExecutionListener that performs given lambda on QueryExecutionListener.afterQuery(ExecutionInfo, List).callback - a lambda function executed on QueryExecutionListener.afterQuery(ExecutionInfo, List)public ProxyDataSourceBuilder asJson()
public ProxyDataSourceBuilder name(String dataSourceName)
dataSourceName - datasource namepublic ProxyDataSourceBuilder queryTransformer(QueryTransformer queryTransformer)
QueryTransformer.queryTransformer - a query-transformer to registerpublic ProxyDataSourceBuilder parameterTransformer(ParameterTransformer parameterTransformer)
ParameterTransformer.parameterTransformer - a query-parameter-transformer to registerpublic ProxyDataSourceBuilder multiline()
public ProxyDataSourceBuilder jdbcProxyFactory(JdbcProxyFactory jdbcProxyFactory)
JdbcProxyFactory.jdbcProxyFactory - a JdbcProxyFactory to registerpublic ProxyDataSourceBuilder connectionIdManager(ConnectionIdManager connectionIdManager)
ConnectionIdManager.connectionIdManager - a ConnectionIdManager to registerpublic ProxyDataSourceBuilder proxyResultSet()
public ProxyDataSourceBuilder proxyResultSet(ResultSetProxyLogicFactory factory)
public ProxyDataSourceBuilder repeatableReadResultSet()
proxyResultSet(new RepeatableReadResultSetProxyLogicFactory())public ProxyDataSourceBuilder methodListener(MethodExecutionListener listener)
listener - a method execution listenerpublic ProxyDataSourceBuilder beforeMethod(ProxyDataSourceBuilder.SingleMethodExecution callback)
MethodExecutionListener that performs given lambda on MethodExecutionListener.beforeMethod(MethodExecutionContext).callback - a lambda function executed on MethodExecutionListener.beforeMethod(MethodExecutionContext)public ProxyDataSourceBuilder afterMethod(ProxyDataSourceBuilder.SingleMethodExecution callback)
MethodExecutionListener that performs given lambda on MethodExecutionListener.afterMethod(MethodExecutionContext).callback - a lambda function executed on MethodExecutionListener.afterMethod(MethodExecutionContext)public ProxyDataSource build()
Copyright © 2017. All rights reserved.