Top Description Fields Constructors Methods
com.mysql.jdbc

public Class SocketFactoryWrapper

extends StandardSocketFactory
implements SocketFactory
Class Inheritance
All Implemented Interfaces
com.mysql.cj.protocol.SocketFactory, com.mysql.cj.protocol.SocketMetadata
Imports
java.io.Closeable, .IOException, com.mysql.cj.conf.PropertySet, com.mysql.cj.log.Log, com.mysql.cj.protocol.ServerSession, .SocketConnection, .SocketFactory, .StandardSocketFactory

Wraps the legacy com.mysql.jdbc.SocketFactory implementations so they can be used as SocketFactory

Field Summary

Modifier and TypeField and Description
pack-priv SocketFactory
socketFactory

References Deprecated SocketFactory is deprecated or references (maybe indirectly) at least one deprecated element.
Inherited from com.mysql.cj.protocol.StandardSocketFactory:
hostloginTimeoutCheckTimestamploginTimeoutCountdownportrawSocketsocketTimeoutBackupsslSocket

Constructor Summary

AccessConstructor and Description
public
SocketFactoryWrapper(SocketFactory legacyFactory)
References Deprecated SocketFactory is deprecated or references (maybe indirectly) at least one deprecated element.

Method Summary

Modifier and TypeMethod and Description
public void
afterHandshake()

Overrides com.mysql.cj.protocol.StandardSocketFactory.afterHandshake.

Overrides default com.mysql.cj.protocol.SocketFactory.afterHandshake.

Called by the driver after completing the MySQL protocol handshake and reading the results of the authentication.

public void
beforeHandshake()

Overrides com.mysql.cj.protocol.StandardSocketFactory.beforeHandshake.

Overrides default com.mysql.cj.protocol.SocketFactory.beforeHandshake.

Called by the driver before issuing the MySQL protocol handshake.

public <T extends Closeable> T
connect(String
the hostname passed in the URL. It will be a single hostname, as the driver parses multi-hosts (for failover) and calls this method for each host connection attempt.
hostname
,
int
the port number to connect to (if required).
portNumber
,
PropertySet
properties passed to the driver via the URL and/or properties instance.
pset
,
int
login timeout in milliseconds
loginTimeout
)

Overrides com.mysql.cj.protocol.StandardSocketFactory.connect.

Implements com.mysql.cj.protocol.SocketFactory.connect.

Creates a new socket or channel using the given properties.

public <T extends Closeable> T
performTlsHandshake(SocketConnection
current SocketConnection
socketConnection
,
ServerSession
current ServerSession
serverSession
,
Log
logger
log
)

Overrides com.mysql.cj.protocol.StandardSocketFactory.performTlsHandshake.

Overrides default com.mysql.cj.protocol.SocketFactory.performTlsHandshake.

If required, called by the driver during MySQL protocol handshake to transform original socket to SSL socket and perform TLS handshake.

Inherited from com.mysql.cj.protocol.StandardSocketFactory:
configureSocketcreateSocketgetRealTimeoutperformTlsHandshakeresetLoginTimeCountdown

Field Detail

socketFactoryback to summary
pack-priv SocketFactory socketFactory

References Deprecated

SocketFactory is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Annotations
@SuppressWarnings:deprecation

Constructor Detail

SocketFactoryWrapperback to summary
public SocketFactoryWrapper(SocketFactory legacyFactory)

References Deprecated

SocketFactory is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Annotations
@SuppressWarnings:deprecation

Method Detail

afterHandshakeback to summary
public void afterHandshake() throws IOException

Overrides com.mysql.cj.protocol.StandardSocketFactory.afterHandshake.

Overrides default com.mysql.cj.protocol.SocketFactory.afterHandshake.

Doc from com.mysql.cj.protocol.SocketFactory.afterHandshake.

Called by the driver after completing the MySQL protocol handshake and reading the results of the authentication.

Annotations
@SuppressWarnings:deprecation
@Override
Exceptions
IOException:
if an I/O error occurs
beforeHandshakeback to summary
public void beforeHandshake() throws IOException

Overrides com.mysql.cj.protocol.StandardSocketFactory.beforeHandshake.

Overrides default com.mysql.cj.protocol.SocketFactory.beforeHandshake.

Doc from com.mysql.cj.protocol.SocketFactory.beforeHandshake.

Called by the driver before issuing the MySQL protocol handshake.

Annotations
@SuppressWarnings:deprecation
@Override
Exceptions
IOException:
if an I/O error occurs
connectback to summary
public <T extends Closeable> T connect(String hostname, int portNumber, PropertySet pset, int loginTimeout) throws IOException

Overrides com.mysql.cj.protocol.StandardSocketFactory.connect.

Implements com.mysql.cj.protocol.SocketFactory.connect.

Doc from com.mysql.cj.protocol.SocketFactory.connect.

Creates a new socket or channel using the given properties. Properties are parsed by the driver from the URL. All properties other than sensitive ones (user and password) are passed to this method. The driver will instantiate the socket factory with the class name given in the property "socketFactory", where the standard is com.mysql.cj.protocol.StandardSocketFactory Implementing classes are responsible for handling synchronization of this method (if needed).

Parameters
<T>
result type
hostname:String

the hostname passed in the URL. It will be a single hostname, as the driver parses multi-hosts (for failover) and calls this method for each host connection attempt.

portNumber:int

the port number to connect to (if required).

pset:PropertySet

properties passed to the driver via the URL and/or properties instance.

loginTimeout:int

login timeout in milliseconds

Returns:T

a socket connected to the given host

Annotations
@SuppressWarnings:deprecation, unchecked
@Override
Exceptions
IOException:
if an I/O error occurs
performTlsHandshakeback to summary
public <T extends Closeable> T performTlsHandshake(SocketConnection socketConnection, ServerSession serverSession, Log log) throws IOException

Overrides com.mysql.cj.protocol.StandardSocketFactory.performTlsHandshake.

Overrides default com.mysql.cj.protocol.SocketFactory.performTlsHandshake.

Doc from com.mysql.cj.protocol.SocketFactory.performTlsHandshake.

If required, called by the driver during MySQL protocol handshake to transform original socket to SSL socket and perform TLS handshake.

Parameters
<T>
result type
socketConnection:SocketConnection

current SocketConnection

serverSession:ServerSession

current ServerSession

log:Log

logger

Returns:T

SSL socket

Annotations
@SuppressWarnings:unchecked
@Override
Exceptions
IOException:
if an I/O error occurs