Class ProxyConnectionFactory.Builder
java.lang.Object
io.r2dbc.proxy.ProxyConnectionFactory.Builder
- Enclosing class:
ProxyConnectionFactory
Builder to create a proxy
ConnectionFactory.
The returned ConnectionFactory is a proxy.
Registered listeners and configuration will be used throughout the operations of the proxy.
This class is not threadsafe.- Author:
- Tadaya Tsuyukubo
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a proxyConnectionFactory.Return theConnectionFactorypassed at creation.Return theProxyConfig.listener(ProxyExecutionListener listener) Register aProxyExecutionListener.onAfterMethod(Consumer<MethodExecutionInfo> consumer) Register a callback consumer for after method execution.onAfterQuery(Consumer<QueryExecutionInfo> consumer) Register a callback consumer for after query execution.onBeforeMethod(Consumer<MethodExecutionInfo> consumer) Register a callback consumer for before method executiononBeforeQuery(Consumer<QueryExecutionInfo> consumer) Register a callback consumer for before query execution.onEachQueryResult(Consumer<QueryExecutionInfo> consumer) Register a callback consumer for processing each query result.proxyConfig(ProxyConfig proxyConfig) Set aProxyConfigto use.
-
Method Details
-
build
Build a proxyConnectionFactory.- Returns:
- a proxy
ConnectionFactory
-
proxyConfig
Set aProxyConfigto use.- Parameters:
proxyConfig- proxy config- Returns:
- builder
- Throws:
IllegalArgumentException- ifproxyConfigisnull
-
onBeforeMethod
Register a callback consumer for before method execution- Parameters:
consumer- a consumer for before method execution- Returns:
- builder
- Throws:
IllegalArgumentException- ifconsumerisnull
-
onAfterMethod
Register a callback consumer for after method execution.- Parameters:
consumer- a consumer for after method execution- Returns:
- builder
- Throws:
IllegalArgumentException- ifconsumerisnull
-
onBeforeQuery
Register a callback consumer for before query execution.- Parameters:
consumer- a consumer for before query execution- Returns:
- builder
- Throws:
IllegalArgumentException- ifconsumerisnull
-
onAfterQuery
Register a callback consumer for after query execution.- Parameters:
consumer- a consumer for after query execution- Returns:
- builder
- Throws:
IllegalArgumentException- ifconsumerisnull
-
onEachQueryResult
Register a callback consumer for processing each query result.- Parameters:
consumer- a consumer for each query result- Returns:
- builder
- Throws:
IllegalArgumentException- ifconsumerisnull
-
listener
Register aProxyExecutionListener.- Parameters:
listener- a listener to register- Returns:
- builder
- Throws:
IllegalArgumentException- iflistenerisnull
-
getConnectionFactory
Return theConnectionFactorypassed at creation.- Returns:
- the connection factory
- Since:
- 1.1.5
-
getProxyConfig
-