Class SocketFactory (1.15.0)

public class SocketFactory extends SocketFactory

A Postgres 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 > SocketFactory

Constructors

SocketFactory(String instanceName)

public SocketFactory(String instanceName)
Parameter
Name Description
instanceName String

SocketFactory(Properties info)

public SocketFactory(Properties info)

Implements the SocketFactory constructor, which can be used to create authenticated connections to a Cloud SQL instance.

Parameter
Name Description
info Properties

Methods

createSocket()

public Socket createSocket()
Returns
Type Description
Socket
Overrides
Exceptions
Type Description
IOException

createSocket(String host, int port)

public Socket createSocket(String host, int port)
Parameters
Name Description
host String
port int
Returns
Type Description
Socket
Overrides

createSocket(String host, int port, InetAddress localHost, int localPort)

public Socket createSocket(String host, int port, InetAddress localHost, int localPort)
Parameters
Name Description
host String
port int
localHost InetAddress
localPort int
Returns
Type Description
Socket
Overrides

createSocket(InetAddress host, int port)

public Socket createSocket(InetAddress host, int port)
Parameters
Name Description
host InetAddress
port int
Returns
Type Description
Socket
Overrides

createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)

public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)
Parameters
Name Description
address InetAddress
port int
localAddress InetAddress
localPort int
Returns
Type Description
Socket
Overrides