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
NameDescription
instanceNameString

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
NameDescription
infoProperties

Methods

createSocket()

public Socket createSocket()
Returns
TypeDescription
Socket
Overrides
Exceptions
TypeDescription
IOException

createSocket(String host, int port)

public Socket createSocket(String host, int port)
Parameters
NameDescription
hostString
portint
Returns
TypeDescription
Socket
Overrides

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

public Socket createSocket(String host, int port, InetAddress localHost, int localPort)
Parameters
NameDescription
hostString
portint
localHostInetAddress
localPortint
Returns
TypeDescription
Socket
Overrides

createSocket(InetAddress host, int port)

public Socket createSocket(InetAddress host, int port)
Parameters
NameDescription
hostInetAddress
portint
Returns
TypeDescription
Socket
Overrides

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

public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)
Parameters
NameDescription
addressInetAddress
portint
localAddressInetAddress
localPortint
Returns
TypeDescription
Socket
Overrides