Class SVNSocketFactory


  • public class SVNSocketFactory
    extends java.lang.Object
    SVNSocketFactory is a utility class that represents a custom socket factory which provides creating either a plain socket or a secure one to encrypt data transmitted over network.

    The created socket then used by the inner engine of SVNKit library to communicate with a Subversion repository.

    Version:
    1.3
    • Field Detail

      • ourIsSocketStaleCheck

        private static boolean ourIsSocketStaleCheck
      • ourSocketReceiveBufferSize

        private static int ourSocketReceiveBufferSize
      • ourSSLProtocols

        private static java.lang.String ourSSLProtocols
      • EMPTY_TRUST_MANAGER

        private static javax.net.ssl.X509TrustManager EMPTY_TRUST_MANAGER
      • EMPTY_KEY_MANAGERS

        private static javax.net.ssl.KeyManager[] EMPTY_KEY_MANAGERS
    • Constructor Detail

      • SVNSocketFactory

        public SVNSocketFactory()
    • Method Detail

      • createPlainSocket

        public static java.net.Socket createPlainSocket​(java.lang.String host,
                                                        int port,
                                                        int connectTimeout,
                                                        int readTimeout,
                                                        ISVNCanceller cancel)
                                                 throws java.io.IOException,
                                                        SVNException
        Throws:
        java.io.IOException
        SVNException
      • setSSLProtocols

        public static void setSSLProtocols​(java.lang.String sslProtocols)
      • getSSLProtocols

        public static java.lang.String getSSLProtocols()
      • createSSLSocket

        public static java.net.Socket createSSLSocket​(javax.net.ssl.KeyManager[] keyManagers,
                                                      javax.net.ssl.TrustManager trustManager,
                                                      java.lang.String host,
                                                      int port,
                                                      int connectTimeout,
                                                      int readTimeout,
                                                      ISVNCanceller cancel)
                                               throws java.io.IOException,
                                                      SVNException
        Throws:
        java.io.IOException
        SVNException
      • _createSSLSocket

        private static java.net.Socket _createSSLSocket​(javax.net.ssl.KeyManager[] keyManagers,
                                                        javax.net.ssl.TrustManager trustManager,
                                                        java.lang.String host,
                                                        int port,
                                                        int connectTimeout,
                                                        int readTimeout,
                                                        ISVNCanceller cancel,
                                                        boolean withSNIsupport)
                                                 throws java.io.IOException,
                                                        SVNException
        Throws:
        java.io.IOException
        SVNException
      • createSSLSocket

        public static java.net.Socket createSSLSocket​(javax.net.ssl.KeyManager[] keyManagers,
                                                      javax.net.ssl.TrustManager trustManager,
                                                      java.lang.String host,
                                                      int port,
                                                      java.net.Socket socket,
                                                      int readTimeout)
                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • setSSLSocketHost

        private static java.net.Socket setSSLSocketHost​(java.net.Socket sslSocket,
                                                        java.lang.String host)
      • connect

        public static void connect​(java.net.Socket socket,
                                   java.net.InetSocketAddress address,
                                   int timeout,
                                   ISVNCanceller cancel)
                            throws java.io.IOException,
                                   SVNException
        Throws:
        java.io.IOException
        SVNException
      • createAddres

        private static java.net.InetAddress createAddres​(java.lang.String hostName)
                                                  throws java.net.UnknownHostException
        Throws:
        java.net.UnknownHostException
      • setSocketReceiveBufferSize

        public static void setSocketReceiveBufferSize​(int size)
      • getSocketReceiveBufferSize

        public static int getSocketReceiveBufferSize()
      • setSocketStaleCheckEnabled

        public static void setSocketStaleCheckEnabled​(boolean enabled)
      • isSocketStaleCheckEnabled

        public static boolean isSocketStaleCheckEnabled()
      • isSocketStale

        public static boolean isSocketStale​(java.net.Socket socket)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • createSSLContext

        public static javax.net.ssl.SSLContext createSSLContext​(javax.net.ssl.KeyManager[] keyManagers,
                                                                javax.net.ssl.TrustManager trustManager)
                                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • createSSLContext

        private static javax.net.ssl.SSLContext createSSLContext​(javax.net.ssl.KeyManager[] keyManagers,
                                                                 javax.net.ssl.TrustManager[] trustManagers,
                                                                 java.util.List<java.lang.String> sslProtocols)
                                                          throws java.io.IOException,
                                                                 java.security.NoSuchAlgorithmException
        Throws:
        java.io.IOException
        java.security.NoSuchAlgorithmException
      • getEnabledSSLProtocols

        private static final java.util.List<java.lang.String> getEnabledSSLProtocols​(boolean includeUserDefined)
      • configureSSLSocket

        public static java.net.Socket configureSSLSocket​(java.net.Socket socket)