Module org.hsqldb

Class HsqlSocketFactorySecure

  • All Implemented Interfaces:
    java.util.EventListener, javax.net.ssl.HandshakeCompletedListener

    public final class HsqlSocketFactorySecure
    extends HsqlSocketFactory
    implements javax.net.ssl.HandshakeCompletedListener
    The default secure socket factory implementation.
    Since:
    1.7.2
    Author:
    Campbell Burnet (campbell-burnet@users dot sourceforge.net), Blaine Simpson (blaine dot simpson at admc dot com)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void configureSocket​(java.net.Socket socket)  
      java.net.ServerSocket createServerSocket​(int port)
      Creates a secure server socket bound to the specified port.
      java.net.ServerSocket createServerSocket​(int port, java.lang.String address)
      Creates a secure server socket bound to the specified port.
      java.net.Socket createSocket​(java.lang.String host, int port)
      Creates a secure Socket and connects it to the specified remote host at the specified remote port.
      java.net.Socket createSocket​(java.net.Socket socket, java.lang.String host, int port)
      if socket argument is not null, creates a secure Socket as a wrapper for the normal, non-SSL socket.
      void handshakeCompleted​(javax.net.ssl.HandshakeCompletedEvent evt)  
      boolean isSecure()
      Retrieves whether this factory produces secure sockets.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createServerSocket

        public java.net.ServerSocket createServerSocket​(int port)
                                                 throws java.lang.Exception
        Creates a secure server socket bound to the specified port. The socket is configured with the socket options given to this factory.
        Overrides:
        createServerSocket in class HsqlSocketFactory
        Parameters:
        port - the port to which to bind the secure ServerSocket
        Returns:
        the secure ServerSocket
        Throws:
        java.lang.Exception - if a network or security provider error occurs
      • createServerSocket

        public java.net.ServerSocket createServerSocket​(int port,
                                                        java.lang.String address)
                                                 throws java.lang.Exception
        Creates a secure server socket bound to the specified port. The socket is configured with the socket options given to this factory.
        Overrides:
        createServerSocket in class HsqlSocketFactory
        Parameters:
        port - the port to which to bind the secure ServerSocket
        address - String
        Returns:
        the secure ServerSocket
        Throws:
        java.lang.Exception - if a network or security provider error occurs
      • createSocket

        public java.net.Socket createSocket​(java.net.Socket socket,
                                            java.lang.String host,
                                            int port)
                                     throws java.lang.Exception
        if socket argument is not null, creates a secure Socket as a wrapper for the normal, non-SSL socket. If the socket is null, create a new secure socket. The secure socket is configured using the socket options established for this factory.
        Overrides:
        createSocket in class HsqlSocketFactory
        Parameters:
        socket - the existing socket
        host - the server host
        port - the server port
        Returns:
        the socket
        Throws:
        java.lang.Exception - if a network or security provider error occurs
      • createSocket

        public java.net.Socket createSocket​(java.lang.String host,
                                            int port)
                                     throws java.lang.Exception
        Creates a secure Socket and connects it to the specified remote host at the specified remote port. This socket is configured using the socket options established for this factory.
        Overrides:
        createSocket in class HsqlSocketFactory
        Parameters:
        host - the server host
        port - the server port
        Returns:
        the socket
        Throws:
        java.lang.Exception - if a network or security provider error occurs
      • isSecure

        public boolean isSecure()
        Retrieves whether this factory produces secure sockets.
        Overrides:
        isSecure in class HsqlSocketFactory
        Returns:
        true iff this factory creates secure sockets
      • handshakeCompleted

        public void handshakeCompleted​(javax.net.ssl.HandshakeCompletedEvent evt)
        Specified by:
        handshakeCompleted in interface javax.net.ssl.HandshakeCompletedListener