Class DelegatingSSLSocketFactory


  • public abstract class DelegatingSSLSocketFactory
    extends javax.net.ssl.SSLSocketFactory
    An SSLSocketFactory that delegates to another factory and allows configuring the created socket via configure(SSLSocket) before it is returned.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.net.ssl.SSLSocketFactory delegate  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void configure​(javax.net.ssl.SSLSocket socket)
      Configure the newly created socket.
      javax.net.ssl.SSLSocket createSocket()  
      javax.net.ssl.SSLSocket createSocket​(java.lang.String host, int port)  
      javax.net.ssl.SSLSocket createSocket​(java.lang.String host, int port, java.net.InetAddress localAddress, int localPort)  
      javax.net.ssl.SSLSocket createSocket​(java.net.InetAddress host, int port)  
      javax.net.ssl.SSLSocket createSocket​(java.net.InetAddress host, int port, java.net.InetAddress localAddress, int localPort)  
      javax.net.ssl.SSLSocket createSocket​(java.net.Socket socket, java.lang.String host, int port, boolean autoClose)  
      java.lang.String[] getDefaultCipherSuites()  
      java.lang.String[] getSupportedCipherSuites()  
      private javax.net.ssl.SSLSocket prepare​(java.net.Socket socket)  
      • Methods inherited from class javax.net.ssl.SSLSocketFactory

        createSocket, getDefault
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • delegate

        private final javax.net.ssl.SSLSocketFactory delegate
    • Constructor Detail

      • DelegatingSSLSocketFactory

        public DelegatingSSLSocketFactory​(javax.net.ssl.SSLSocketFactory delegate)
        Creates a new DelegatingSSLSocketFactory based on the given delegate.
        Parameters:
        delegate - SSLSocketFactory to delegate to
    • Method Detail

      • createSocket

        public javax.net.ssl.SSLSocket createSocket()
                                             throws java.io.IOException
        Overrides:
        createSocket in class javax.net.SocketFactory
        Throws:
        java.io.IOException
      • createSocket

        public javax.net.ssl.SSLSocket createSocket​(java.lang.String host,
                                                    int port)
                                             throws java.io.IOException
        Specified by:
        createSocket in class javax.net.SocketFactory
        Throws:
        java.io.IOException
      • createSocket

        public javax.net.ssl.SSLSocket createSocket​(java.lang.String host,
                                                    int port,
                                                    java.net.InetAddress localAddress,
                                                    int localPort)
                                             throws java.io.IOException
        Specified by:
        createSocket in class javax.net.SocketFactory
        Throws:
        java.io.IOException
      • createSocket

        public javax.net.ssl.SSLSocket createSocket​(java.net.InetAddress host,
                                                    int port)
                                             throws java.io.IOException
        Specified by:
        createSocket in class javax.net.SocketFactory
        Throws:
        java.io.IOException
      • createSocket

        public javax.net.ssl.SSLSocket createSocket​(java.net.InetAddress host,
                                                    int port,
                                                    java.net.InetAddress localAddress,
                                                    int localPort)
                                             throws java.io.IOException
        Specified by:
        createSocket in class javax.net.SocketFactory
        Throws:
        java.io.IOException
      • createSocket

        public javax.net.ssl.SSLSocket createSocket​(java.net.Socket socket,
                                                    java.lang.String host,
                                                    int port,
                                                    boolean autoClose)
                                             throws java.io.IOException
        Specified by:
        createSocket in class javax.net.ssl.SSLSocketFactory
        Throws:
        java.io.IOException
      • getDefaultCipherSuites

        public java.lang.String[] getDefaultCipherSuites()
        Specified by:
        getDefaultCipherSuites in class javax.net.ssl.SSLSocketFactory
      • getSupportedCipherSuites

        public java.lang.String[] getSupportedCipherSuites()
        Specified by:
        getSupportedCipherSuites in class javax.net.ssl.SSLSocketFactory
      • prepare

        private javax.net.ssl.SSLSocket prepare​(java.net.Socket socket)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • configure

        protected abstract void configure​(javax.net.ssl.SSLSocket socket)
                                   throws java.io.IOException
        Configure the newly created socket.
        Parameters:
        socket - to configure
        Throws:
        java.io.IOException - if the socket cannot be configured