Class SVNSocketFactory
- java.lang.Object
-
- org.tmatesoft.svn.core.internal.util.SVNSocketFactory
-
public class SVNSocketFactory extends java.lang.ObjectSVNSocketFactoryis 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 Summary
Fields Modifier and Type Field Description private static javax.net.ssl.KeyManager[]EMPTY_KEY_MANAGERSprivate static javax.net.ssl.X509TrustManagerEMPTY_TRUST_MANAGERprivate static booleanourIsSocketStaleCheckprivate static intourSocketReceiveBufferSizeprivate static java.lang.StringourSSLProtocolsprivate static ISVNThreadPoolourThreadPool
-
Constructor Summary
Constructors Constructor Description SVNSocketFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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)static java.net.SocketconfigureSSLSocket(java.net.Socket socket)static voidconnect(java.net.Socket socket, java.net.InetSocketAddress address, int timeout, ISVNCanceller cancel)private static java.net.InetAddresscreateAddres(java.lang.String hostName)static java.net.SocketcreatePlainSocket(java.lang.String host, int port, int connectTimeout, int readTimeout, ISVNCanceller cancel)static javax.net.ssl.SSLContextcreateSSLContext(javax.net.ssl.KeyManager[] keyManagers, javax.net.ssl.TrustManager trustManager)private static javax.net.ssl.SSLContextcreateSSLContext(javax.net.ssl.KeyManager[] keyManagers, javax.net.ssl.TrustManager[] trustManagers, java.util.List<java.lang.String> sslProtocols)static java.net.SocketcreateSSLSocket(javax.net.ssl.KeyManager[] keyManagers, javax.net.ssl.TrustManager trustManager, java.lang.String host, int port, int connectTimeout, int readTimeout, ISVNCanceller cancel)static java.net.SocketcreateSSLSocket(javax.net.ssl.KeyManager[] keyManagers, javax.net.ssl.TrustManager trustManager, java.lang.String host, int port, java.net.Socket socket, int readTimeout)private static java.util.List<java.lang.String>getEnabledSSLProtocols(boolean includeUserDefined)static intgetSocketReceiveBufferSize()static java.lang.StringgetSSLProtocols()static ISVNThreadPoolgetThreadPool()static booleanisSocketStale(java.net.Socket socket)static booleanisSocketStaleCheckEnabled()static voidsetSocketReceiveBufferSize(int size)static voidsetSocketStaleCheckEnabled(boolean enabled)static voidsetSSLProtocols(java.lang.String sslProtocols)private static java.net.SocketsetSSLSocketHost(java.net.Socket sslSocket, java.lang.String host)
-
-
-
Field Detail
-
ourIsSocketStaleCheck
private static boolean ourIsSocketStaleCheck
-
ourSocketReceiveBufferSize
private static int ourSocketReceiveBufferSize
-
ourThreadPool
private static ISVNThreadPool ourThreadPool
-
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
-
-
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.IOExceptionSVNException
-
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.IOExceptionSVNException
-
_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.IOExceptionSVNException
-
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)
-
getThreadPool
public static ISVNThreadPool getThreadPool()
-
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.IOExceptionSVNException
-
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.IOExceptionjava.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)
-
-