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 |
addSlaveHost(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() |
JdbcConnection |
getMasterConnection() |
java.util.Properties |
getProperties()
Returns the parsed and passed in properties for this connection.
|
JdbcConnection |
getSlavesConnection() |
ReplicationConnectionProxy |
getThisAsProxy() |
boolean |
hasSameProperties(JdbcConnection c)
Does this connection have the same properties as another?
|
boolean |
isHostMaster(java.lang.String host) |
boolean |
isHostSlave(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 |
promoteSlaveToMaster(java.lang.String host) |
void |
removeMasterHost(java.lang.String host) |
void |
removeMasterHost(java.lang.String host,
boolean waitUntilNotInUse) |
void |
removeSlave(java.lang.String host) |
void |
removeSlave(java.lang.String host,
boolean closeGently) |
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, getServerVersion, getSession, getSessionMaxRows, getStatementComment, getTransactionIsolation, getTypeMap, getURL, getUser, getWarnings, hasTriedMaster, initializeResultsMetadataFromCache, initializeSafeQueryInterceptors, isClosed, isInGlobalTx, isMasterConnection, isProxySet, isReadOnly, isSameResource, isServerLocal, 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, setDatabase, setFailedOver, setHoldability, setInGlobalTx, setNetworkTimeout, setReadOnlyInternal, setSavepoint, setSavepoint, setSchema, setSessionMaxRows, setTransactionIsolation, setTypeMap, shutdownServer, storesLowerCaseTableName, throwConnectionClosedException, transactionBegun, transactionCompleted, unregisterStatement, unSafeQueryInterceptorsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclientPrepareStatement, 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, isMasterConnection, isProxySet, isReadOnly, isSameResource, isServerLocal, lowerCaseTableNames, pingInternal, realClose, recachePreparedStatement, registerStatement, resetServerState, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, serverPrepareStatement, setDatabase, setFailedOver, setInGlobalTx, 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, 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 getMasterConnection()
getMasterConnection in interface ReplicationConnectionpublic void promoteSlaveToMaster(java.lang.String host)
throws java.sql.SQLException
promoteSlaveToMaster in interface ReplicationConnectionjava.sql.SQLExceptionpublic void removeMasterHost(java.lang.String host)
throws java.sql.SQLException
removeMasterHost in interface ReplicationConnectionjava.sql.SQLExceptionpublic void removeMasterHost(java.lang.String host,
boolean waitUntilNotInUse)
throws java.sql.SQLException
removeMasterHost in interface ReplicationConnectionjava.sql.SQLExceptionpublic boolean isHostMaster(java.lang.String host)
isHostMaster in interface ReplicationConnectionpublic JdbcConnection getSlavesConnection()
getSlavesConnection in interface ReplicationConnectionpublic void addSlaveHost(java.lang.String host)
throws java.sql.SQLException
addSlaveHost in interface ReplicationConnectionjava.sql.SQLExceptionpublic void removeSlave(java.lang.String host)
throws java.sql.SQLException
removeSlave in interface ReplicationConnectionjava.sql.SQLExceptionpublic void removeSlave(java.lang.String host,
boolean closeGently)
throws java.sql.SQLException
removeSlave in interface ReplicationConnectionjava.sql.SQLExceptionpublic boolean isHostSlave(java.lang.String host)
isHostSlave 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