Class NamedPipeSocketFactory

java.lang.Object
com.mysql.cj.protocol.NamedPipeSocketFactory
All Implemented Interfaces:
SocketFactory, SocketMetadata

public class NamedPipeSocketFactory
extends java.lang.Object
implements SocketFactory
A socket factory for named pipes (on Windows)
  • Constructor Summary

    Constructors 
    Constructor Description
    NamedPipeSocketFactory()
    Constructor for NamedPipeSocketFactory.
  • Method Summary

    Modifier and Type Method Description
    <T extends java.io.Closeable>
    T
    connect​(java.lang.String host, int portNumber, PropertySet props, int loginTimeout)
    Creates a new socket or channel using the given properties.
    boolean isLocallyConnected​(Session sess)  
    <T extends java.io.Closeable>
    T
    performTlsHandshake​(SocketConnection socketConnection, ServerSession serverSession)
    If required, called by the driver during MySQL protocol handshake to transform original socket to SSL socket and perform TLS handshake.

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface com.mysql.cj.protocol.SocketFactory

    afterHandshake, beforeHandshake

    Methods inherited from interface com.mysql.cj.protocol.SocketMetadata

    isLocallyConnected
  • Constructor Details

  • Method Details

    • performTlsHandshake

      public <T extends java.io.Closeable> T performTlsHandshake​(SocketConnection socketConnection, ServerSession serverSession) throws java.io.IOException
      Description copied from interface: SocketFactory
      If required, called by the driver during MySQL protocol handshake to transform original socket to SSL socket and perform TLS handshake.
      Specified by:
      performTlsHandshake in interface SocketFactory
      Type Parameters:
      T - result type
      Parameters:
      socketConnection - current SocketConnection
      serverSession - current ServerSession
      Returns:
      SSL socket
      Throws:
      java.io.IOException - if an I/O error occurs
    • connect

      public <T extends java.io.Closeable> T connect​(java.lang.String host, int portNumber, PropertySet props, int loginTimeout) throws java.io.IOException
      Description copied from interface: SocketFactory
      Creates a new socket or channel using the given properties. Properties are parsed by the driver from the URL. All properties other than sensitive ones (user and password) are passed to this method. The driver will instantiate the socket factory with the class name given in the property "socketFactory", where the standard is com.mysql.cj.protocol.StandardSocketFactory Implementing classes are responsible for handling synchronization of this method (if needed).
      Specified by:
      connect in interface SocketFactory
      Type Parameters:
      T - result type
      Parameters:
      host - the hostname passed in the URL. It will be a single hostname, as the driver parses multi-hosts (for failover) and calls this method for each host connection attempt.
      portNumber - the port number to connect to (if required).
      props - properties passed to the driver via the URL and/or properties instance.
      loginTimeout - login timeout in milliseconds
      Returns:
      a socket connected to the given host
      Throws:
      java.io.IOException - if an I/O error occurs
    • isLocallyConnected

      public boolean isLocallyConnected​(Session sess)
      Specified by:
      isLocallyConnected in interface SocketMetadata