Package com.google.cloud.sql.sqlserver
Class SocketFactory
- java.lang.Object
-
- javax.net.SocketFactory
-
- com.google.cloud.sql.sqlserver.SocketFactory
-
public class SocketFactory extends SocketFactory
A Microsoft SQL ServerSocketFactorythat establishes a secure connection to a Cloud SQL instance using ephemeral certificates.The heavy lifting is done by the singleton
CoreSocketFactoryclass.
-
-
Field Summary
Fields Modifier and Type Field Description protected Propertiesprops
-
Constructor Summary
Constructors Constructor Description SocketFactory(String socketFactoryConstructorArg)Implements theSocketFactoryconstructor, which can be used to create authenticated connections to a Cloud SQL instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SocketcreateSocket()SocketcreateSocket(String host, int port)SocketcreateSocket(String host, int port, InetAddress localHost, int localPort)SocketcreateSocket(InetAddress host, int port)SocketcreateSocket(InetAddress address, int port, InetAddress localAddress, int localPort)-
Methods inherited from class javax.net.SocketFactory
getDefault
-
-
-
-
Field Detail
-
props
protected Properties props
-
-
Constructor Detail
-
SocketFactory
public SocketFactory(String socketFactoryConstructorArg) throws UnsupportedEncodingException
Implements theSocketFactoryconstructor, which can be used to create authenticated connections to a Cloud SQL instance.- Throws:
UnsupportedEncodingException
-
-
Method Detail
-
createSocket
public Socket createSocket() throws IOException
- Overrides:
createSocketin classSocketFactory- Throws:
IOException
-
createSocket
public Socket createSocket(String host, int port) throws IOException
- Specified by:
createSocketin classSocketFactory- Throws:
IOException
-
createSocket
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException
- Specified by:
createSocketin classSocketFactory- Throws:
IOException
-
createSocket
public Socket createSocket(InetAddress host, int port) throws IOException
- Specified by:
createSocketin classSocketFactory- Throws:
IOException
-
createSocket
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException
- Specified by:
createSocketin classSocketFactory- Throws:
IOException
-
-