public class ReplicationMySQLConnection extends MultiHostMySQLConnection implements ReplicationConnection
thisAsProxy| Constructor and Description |
|---|
ReplicationMySQLConnection(MultiHostConnectionProxy proxy) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(java.util.concurrent.Executor executor) |
void |
abortInternal()
Clobbers the physical network connection and marks this connection as closed.
|
void |
addReplicaHost(java.lang.String host) |
void |
changeUser(java.lang.String userName,
java.lang.String newPassword)
Changes the user on this connection by performing a re-authentication.
|
void |
clearHasTriedMaster()
Deprecated.
|
JdbcConnection |
getActiveMySQLConnection() |
long |
getConnectionGroupId() |
JdbcConnection |
getCurrentConnection() |
java.util.Properties |
getProperties()
Returns the parsed and passed in properties for this connection.
|
JdbcConnection |
getReplicaConnection() |
JdbcConnection |
getSourceConnection() |
ReplicationConnectionProxy |
getThisAsProxy() |
boolean |
hasSameProperties(JdbcConnection c)
Does this connection have the same properties as another?
|
boolean |
isHostReplica(java.lang.String host) |
boolean |
isHostSource(java.lang.String host) |
boolean |
isReadOnly() |
boolean |
isWrapperFor(java.lang.Class<?> iface) |
void |
ping()
Detect if the connection is still good by sending a ping command
to the server.
|
void |
promoteReplicaToSource(java.lang.String host) |
void |
removeReplica(java.lang.String host) |
void |
removeReplica(java.lang.String host,
boolean closeGently) |
void |
removeSourceHost(java.lang.String host) |
void |
removeSourceHost(java.lang.String host,
boolean waitUntilNotInUse) |
void |
setProxy(JdbcConnection proxy) |
void |
setReadOnly(boolean readOnlyFlag) |
void |
setStatementComment(java.lang.String comment)
Sets the comment that will be prepended to all statements
sent to the server.
|
<T> T |
unwrap(java.lang.Class<T> iface) |
checkClosed, cleanup, clearWarnings, clientPrepareStatement, clientPrepareStatement, clientPrepareStatement, clientPrepareStatement, clientPrepareStatement, clientPrepareStatement, close, commit, createArrayOf, createBlob, createClob, createNClob, createNewIO, createSQLXML, createStatement, createStatement, createStatement, createStruct, decachePreparedStatement, getActiveStatementCount, getAutoCommit, getAutoIncrementIncrement, getCachedMetaData, getCatalog, getCharacterSetMetadata, getClientInfo, getClientInfo, getClientInfoProviderImpl, getConnectionMutex, getDatabase, getExceptionInterceptor, getHoldability, getHost, getHostPortPair, getId, getIdleFor, getMetaData, getMetadataSafeStatement, getMultiHostParentProxy, getMultiHostSafeProxy, getNetworkTimeout, getPropertySet, getQueryInterceptorsInstances, getSchema, getServerSessionStateController, getServerVersion, getSession, getSessionMaxRows, getStatementComment, getTransactionIsolation, getTypeMap, getURL, getUser, getWarnings, hasTriedMaster, initializeResultsMetadataFromCache, initializeSafeQueryInterceptors, isClosed, isInGlobalTx, isInPreparedTx, isProxySet, isReadOnly, isSameResource, isServerLocal, isSourceConnection, isValid, lowerCaseTableNames, nativeSQL, normalClose, pingInternal, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, realClose, recachePreparedStatement, registerStatement, releaseSavepoint, resetServerState, rollback, rollback, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setConnectionLifecycleInterceptor, setDatabase, setFailedOver, setHoldability, setInGlobalTx, setInPreparedTx, setNetworkTimeout, setReadOnlyInternal, setSavepoint, setSavepoint, setSchema, setSessionMaxRows, setTransactionIsolation, setTypeMap, shutdownServer, storesLowerCaseTableName, throwConnectionClosedException, transactionBegun, transactionCompleted, unregisterStatement, unSafeQueryInterceptorsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddSlaveHost, getMasterConnection, getSlavesConnection, isHostMaster, isHostSlave, promoteSlaveToMaster, removeMasterHost, removeMasterHost, removeSlave, removeSlaveclientPrepareStatement, clientPrepareStatement, clientPrepareStatement, clientPrepareStatement, clientPrepareStatement, clientPrepareStatement, decachePreparedStatement, getActiveStatementCount, getAutoIncrementIncrement, getCachedMetaData, getCharacterSetMetadata, getClientInfoProviderImpl, getDatabase, getHost, getHostPortPair, getIdleFor, getMetadataSafeStatement, getMultiHostParentProxy, getMultiHostSafeProxy, getPropertySet, getQueryInterceptorsInstances, getServerVersion, getSessionMaxRows, getStatementComment, hasTriedMaster, initializeResultsMetadataFromCache, initializeSafeQueryInterceptors, isInGlobalTx, isInPreparedTx, isMasterConnection, isProxySet, isReadOnly, isSameResource, isServerLocal, isSourceConnection, lowerCaseTableNames, pingInternal, realClose, recachePreparedStatement, registerStatement, resetServerState, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, setConnectionLifecycleInterceptor, setDatabase, setFailedOver, setInGlobalTx, setInPreparedTx, setReadOnlyInternal, setSessionMaxRows, shutdownServer, storesLowerCaseTableName, throwConnectionClosedException, unregisterStatement, unSafeQueryInterceptorsclearWarnings, close, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isValid, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setSavepoint, setSavepoint, setSchema, setTransactionIsolation, setTypeMapcheckClosed, cleanup, createNewIO, getConnectionMutex, getExceptionInterceptor, getId, getServerSessionStateController, getSession, getURL, getUser, normalClosetransactionBegun, transactionCompletedpublic ReplicationMySQLConnection(MultiHostConnectionProxy proxy)
public ReplicationConnectionProxy getThisAsProxy()
getThisAsProxy in class MultiHostMySQLConnectionpublic JdbcConnection getActiveMySQLConnection()
getActiveMySQLConnection in interface JdbcConnectiongetActiveMySQLConnection in class MultiHostMySQLConnectionpublic JdbcConnection getCurrentConnection()
getCurrentConnection in interface ReplicationConnectionpublic long getConnectionGroupId()
getConnectionGroupId in interface ReplicationConnectionpublic JdbcConnection getSourceConnection()
getSourceConnection in interface ReplicationConnectionpublic void promoteReplicaToSource(java.lang.String host)
throws java.sql.SQLException
promoteReplicaToSource in interface ReplicationConnectionjava.sql.SQLExceptionpublic void removeSourceHost(java.lang.String host)
throws java.sql.SQLException
removeSourceHost in interface ReplicationConnectionjava.sql.SQLExceptionpublic void removeSourceHost(java.lang.String host,
boolean waitUntilNotInUse)
throws java.sql.SQLException
removeSourceHost in interface ReplicationConnectionjava.sql.SQLExceptionpublic boolean isHostSource(java.lang.String host)
isHostSource in interface ReplicationConnectionpublic JdbcConnection getReplicaConnection()
getReplicaConnection in interface ReplicationConnectionpublic void addReplicaHost(java.lang.String host)
throws java.sql.SQLException
addReplicaHost in interface ReplicationConnectionjava.sql.SQLExceptionpublic void removeReplica(java.lang.String host)
throws java.sql.SQLException
removeReplica in interface ReplicationConnectionjava.sql.SQLExceptionpublic void removeReplica(java.lang.String host,
boolean closeGently)
throws java.sql.SQLException
removeReplica in interface ReplicationConnectionjava.sql.SQLExceptionpublic boolean isHostReplica(java.lang.String host)
isHostReplica in interface ReplicationConnectionpublic void setReadOnly(boolean readOnlyFlag)
throws java.sql.SQLException
setReadOnly in interface java.sql.ConnectionsetReadOnly in class MultiHostMySQLConnectionjava.sql.SQLExceptionpublic boolean isReadOnly()
throws java.sql.SQLException
isReadOnly in interface java.sql.ConnectionisReadOnly in class MultiHostMySQLConnectionjava.sql.SQLExceptionpublic void ping()
throws java.sql.SQLException
JdbcConnectionping in interface JdbcConnectionping in class MultiHostMySQLConnectionjava.sql.SQLException - if the ping failspublic void changeUser(java.lang.String userName,
java.lang.String newPassword)
throws java.sql.SQLException
JdbcConnectionchangeUser in interface JdbcConnectionchangeUser in class MultiHostMySQLConnectionuserName - the username to authenticate withnewPassword - the password to authenticate withjava.sql.SQLException - if authentication fails, or some other error occurs while
performing the command.public void setStatementComment(java.lang.String comment)
JdbcConnectionsetStatementComment in interface JdbcConnectionsetStatementComment in class MultiHostMySQLConnectioncomment - the comment that will be prepended to all statements
sent to the server.public boolean hasSameProperties(JdbcConnection c)
JdbcConnectionhasSameProperties in interface JdbcConnectionhasSameProperties in class MultiHostMySQLConnectionc - connectionpublic java.util.Properties getProperties()
MysqlConnectiongetProperties in interface MysqlConnectiongetProperties in class MultiHostMySQLConnectionPropertiespublic void abort(java.util.concurrent.Executor executor)
throws java.sql.SQLException
abort in interface java.sql.Connectionabort in class MultiHostMySQLConnectionjava.sql.SQLExceptionpublic void abortInternal()
throws java.sql.SQLException
JdbcConnectionabortInternal in interface JdbcConnectionabortInternal in class MultiHostMySQLConnectionjava.sql.SQLException - if an error occurspublic void setProxy(JdbcConnection proxy)
setProxy in interface JdbcConnectionsetProxy in class MultiHostMySQLConnectionpublic boolean isWrapperFor(java.lang.Class<?> iface)
throws java.sql.SQLException
isWrapperFor in interface java.sql.WrapperisWrapperFor in class MultiHostMySQLConnectionjava.sql.SQLExceptionpublic <T> T unwrap(java.lang.Class<T> iface)
throws java.sql.SQLException
unwrap in interface java.sql.Wrapperunwrap in class MultiHostMySQLConnectionjava.sql.SQLException@Deprecated public void clearHasTriedMaster()
clearHasTriedMaster in interface JdbcConnectionclearHasTriedMaster in class MultiHostMySQLConnection