public static class SimplePacketReaderTest.MockSocketConnection extends java.lang.Object implements SocketConnection
| Modifier and Type | Field and Description |
|---|---|
boolean |
forceClosed |
| Constructor and Description |
|---|
MockSocketConnection() |
| Modifier and Type | Method and Description |
|---|---|
void |
connect(java.lang.String host,
int port,
PropertySet propertySet,
ExceptionInterceptor exceptionInterceptor,
Log log,
int loginTimeout)
Connect to the MySQL server and setup a stream connection.
|
void |
forceClose() |
ExceptionInterceptor |
getExceptionInterceptor() |
java.lang.String |
getHost()
Returns the host this IO is connected to
|
FullReadInputStream |
getMysqlInput() |
java.io.BufferedOutputStream |
getMysqlOutput() |
java.net.Socket |
getMysqlSocket() |
NetworkResources |
getNetworkResources() |
int |
getPort() |
PropertySet |
getPropertySet() |
SocketFactory |
getSocketFactory() |
boolean |
isSSLEstablished() |
void |
performTlsHandshake(ServerSession serverSession) |
int |
readFully(byte[] b,
int off,
int len)
Mock method to override getMysqlInput().readFully().
|
void |
setMysqlInput(FullReadInputStream mysqlInput) |
void |
setSocketFactory(SocketFactory socketFactory) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitperformTlsHandshakepublic void connect(java.lang.String host,
int port,
PropertySet propertySet,
ExceptionInterceptor exceptionInterceptor,
Log log,
int loginTimeout)
SocketConnectionconnect in interface SocketConnectionhost - the hostname to connect toport - the port number that the server is listening onpropertySet - the PropertySet with required connection optionsexceptionInterceptor - exception interceptorlog - loggerloginTimeout - the driver login time limit in millisecondspublic void performTlsHandshake(ServerSession serverSession) throws SSLParamsException, FeatureNotAvailableException, java.io.IOException
performTlsHandshake in interface SocketConnectionSSLParamsExceptionFeatureNotAvailableExceptionjava.io.IOExceptionpublic void forceClose()
forceClose in interface SocketConnectionpublic NetworkResources getNetworkResources()
getNetworkResources in interface SocketConnectionpublic java.lang.String getHost()
SocketConnectiongetHost in interface SocketConnectionpublic int getPort()
getPort in interface SocketConnectionpublic java.net.Socket getMysqlSocket()
getMysqlSocket in interface SocketConnectionpublic FullReadInputStream getMysqlInput()
getMysqlInput in interface SocketConnectionpublic int readFully(byte[] b,
int off,
int len)
throws java.io.IOException
b - off - len - java.io.IOExceptionpublic void setMysqlInput(FullReadInputStream mysqlInput)
setMysqlInput in interface SocketConnectionpublic java.io.BufferedOutputStream getMysqlOutput()
getMysqlOutput in interface SocketConnectionpublic boolean isSSLEstablished()
isSSLEstablished in interface SocketConnectionpublic SocketFactory getSocketFactory()
getSocketFactory in interface SocketConnectionpublic void setSocketFactory(SocketFactory socketFactory)
setSocketFactory in interface SocketConnectionpublic ExceptionInterceptor getExceptionInterceptor()
getExceptionInterceptor in interface SocketConnectionpublic PropertySet getPropertySet()
getPropertySet in interface SocketConnection