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()Builds a proxyConnectionFactory.Return theConnectionFactorypassed at creation.Return theProxyConfig.listener(ProxyExecutionListener listener) Registers aProxyExecutionListener.onAfterMethod(Consumer<MethodExecutionInfo> consumer) Registers a callback consumer for after-method execution.onAfterQuery(Consumer<QueryExecutionInfo> consumer) Registers a callback consumer for after-query execution.onBeforeMethod(Consumer<MethodExecutionInfo> consumer) Registers a callback consumer for before-method executiononBeforeQuery(Consumer<QueryExecutionInfo> consumer) Registers a callback consumer for before-query execution.onEachQueryResult(Consumer<QueryExecutionInfo> consumer) Registers a callback consumer for processing each query result.proxyConfig(ProxyConfig proxyConfig) Sets theProxyConfigto use.
-
Method Details
-
build
Builds a proxyConnectionFactory.- Returns:
- a proxy
ConnectionFactory
-
proxyConfig
Sets theProxyConfigto use.- Parameters:
proxyConfig- proxy config- Returns:
- builder
- Throws:
IllegalArgumentException- ifproxyConfigisnull
-
onBeforeMethod
Registers a callback consumer for before-method execution- Parameters:
consumer- a consumer for before method execution- Returns:
- builder
- Throws:
IllegalArgumentException- ifconsumerisnull
-
onAfterMethod
Registers a callback consumer for after-method execution.- Parameters:
consumer- a consumer for after method execution- Returns:
- builder
- Throws:
IllegalArgumentException- ifconsumerisnull
-
onBeforeQuery
Registers a callback consumer for before-query execution.- Parameters:
consumer- a consumer for before query execution- Returns:
- builder
- Throws:
IllegalArgumentException- ifconsumerisnull
-
onAfterQuery
Registers a callback consumer for after-query execution.- Parameters:
consumer- a consumer for after query execution- Returns:
- builder
- Throws:
IllegalArgumentException- ifconsumerisnull
-
onEachQueryResult
Registers a callback consumer for processing each query result.- Parameters:
consumer- a consumer for each query result- Returns:
- builder
- Throws:
IllegalArgumentException- ifconsumerisnull
-
listener
Registers 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
-