public class VerifyRoleOnConnect extends java.lang.Object implements InitialConnectionHandler
InitialConnectionHandler: validates the reader host-selector strategy and, for
the initial connection, verifies and corrects the connection role. Ports the legacy
ReadWriteSplittingPlugin.connect.| Constructor and Description |
|---|
VerifyRoleOnConnect(java.lang.String readerSelectorStrategy,
boolean verifyInitialConnectionRole) |
| Modifier and Type | Method and Description |
|---|---|
java.sql.Connection |
onConnect(RwSplitContext ctx,
java.lang.String driverProtocol,
HostSpec hostSpec,
java.util.Properties props,
boolean isInitialConnection,
@NonNull JdbcCallable<java.sql.Connection,java.sql.SQLException> connectFunc)
Invoked from the unified plugin's
connect. |
public VerifyRoleOnConnect(java.lang.String readerSelectorStrategy,
boolean verifyInitialConnectionRole)
public java.sql.Connection onConnect(RwSplitContext ctx, java.lang.String driverProtocol, HostSpec hostSpec, java.util.Properties props, boolean isInitialConnection, @NonNull JdbcCallable<java.sql.Connection,java.sql.SQLException> connectFunc) throws java.sql.SQLException
InitialConnectionHandlerconnect.onConnect in interface InitialConnectionHandlerctx - the read/write splitting contextdriverProtocol - the driver protocolhostSpec - the host being connected toprops - the connection propertiesisInitialConnection - whether this is the initial connectionconnectFunc - the downstream connect functionjava.sql.SQLException