Package com.google.cloud.sql.postgres

# Class SocketFactory

java.lang.Object
javax.net.SocketFactory
com.google.cloud.sql.postgres.SocketFactory

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.

## Constructor Summary

Constructors
Constructor
Description
`SocketFactory(String instanceName)`
Deprecated.
`SocketFactory(Properties info)`
Implements the `SocketFactory` constructor, which can be used to create authenticated connections to a Cloud SQL instance.

## Method Summary

Modifier and Type
Method
Description
`Socket`
`createSocket()`
`Socket`
`createSocket(String host, int port)`
`Socket`
`createSocket(String host, int port, InetAddress localHost, int localPort)`
`Socket`
`createSocket(InetAddress host, int port)`
`Socket`
`createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)`

### Methods inherited from class javax.net.SocketFactory

`getDefault`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SocketFactory

public SocketFactory(Properties info)
Implements the `SocketFactory` constructor, which can be used to create authenticated connections to a Cloud SQL instance.

### SocketFactory

@Deprecated public SocketFactory(String instanceName)
Deprecated.
Instantiate a socket factory.

Parameters:
  `instanceName` - the instance name.

## Method Details

### createSocket

public Socket createSocket() throws IOException

Overrides:
  `createSocket` in class `SocketFactory`
Throws:
  `IOException`

### createSocket

public Socket createSocket(String host, int port)

Specified by:
  `createSocket` in class `SocketFactory`

### createSocket

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

Specified by:
  `createSocket` in class `SocketFactory`

### createSocket

public Socket createSocket(InetAddress host, int port)

Specified by:
  `createSocket` in class `SocketFactory`

### createSocket

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

Specified by:
  `createSocket` in class `SocketFactory`