Class SocketFactory (1.15.0)

public class SocketFactory implements SocketFactory

A MySQL SocketFactory that establishes a secure connection to a Cloud SQL instance using ephemeral certificates.

The heavy lifting is done by the singleton InternalConnectorRegistry class.

Inheritance

java.lang.Object > SocketFactory

Implements

com.mysql.cj.protocol.SocketFactory

Constructors

SocketFactory()

public SocketFactory()

Methods

<T>connect(String host, int portNumber, PropertySet props, int loginTimeout)

public T <T>connect(String host, int portNumber, PropertySet props, int loginTimeout)
Parameters
Name Description
host String
portNumber int
props com.mysql.cj.conf.PropertySet
loginTimeout int
Returns
Type Description
T
Exceptions
Type Description
IOException

<T>connect(String host, int portNumber, Properties props, int loginTimeout)

public T <T>connect(String host, int portNumber, Properties props, int loginTimeout)

Implements the interface for com.mysql.cj.protocol.SocketFactory for mysql-connector-java prior to version 8.0.13. This change is required for backwards compatibility.

Parameters
Name Description
host String
portNumber int
props Properties
loginTimeout int
Returns
Type Description
T
Exceptions
Type Description
IOException
InterruptedException

<T>performTlsHandshake(SocketConnection socketConnection, ServerSession serverSession)

public T <T>performTlsHandshake(SocketConnection socketConnection, ServerSession serverSession)
Parameters
Name Description
socketConnection com.mysql.cj.protocol.SocketConnection
serverSession com.mysql.cj.protocol.ServerSession
Returns
Type Description
T
Exceptions
Type Description
IOException

afterHandshake()

public void afterHandshake()

beforeHandshake()

public void beforeHandshake()