org.opends.admin.ads.util
Class TrustedSocketFactory

java.lang.Object
  extended by javax.net.SocketFactory
      extended by javax.net.ssl.SSLSocketFactory
          extended by org.opends.admin.ads.util.TrustedSocketFactory

public class TrustedSocketFactory
extends javax.net.ssl.SSLSocketFactory

An implementation of SSLSocketFactory.


Constructor Summary
TrustedSocketFactory(javax.net.ssl.TrustManager trustManager, javax.net.ssl.KeyManager keyManager)
          Constructor of the TrustedSocketFactory.
 
Method Summary
 java.net.Socket createSocket(java.net.InetAddress address, int port)
          
 java.net.Socket createSocket(java.net.InetAddress address, int port, java.net.InetAddress clientAddress, int clientPort)
          
 java.net.Socket createSocket(java.net.Socket s, java.lang.String host, int port, boolean autoClose)
          
 java.net.Socket createSocket(java.lang.String host, int port)
          
 java.net.Socket createSocket(java.lang.String host, int port, java.net.InetAddress clientHost, int clientPort)
          
static javax.net.SocketFactory getDefault()
          Returns the default SSL socket factory.
 java.lang.String[] getDefaultCipherSuites()
          
 java.lang.String[] getSupportedCipherSuites()
          
static void setCurrentThreadTrustManager(javax.net.ssl.TrustManager trustManager, javax.net.ssl.KeyManager keyManager)
          Sets the provided trust and key manager for the operations in the current thread.
static void setThreadKeyManager(javax.net.ssl.KeyManager keyManager, java.lang.Thread thread)
          Sets the provided key manager for the operations in the provided thread.
static void setThreadTrustManager(javax.net.ssl.TrustManager trustManager, java.lang.Thread thread)
          Sets the provided trust manager for the operations in the provided thread.
 
Methods inherited from class javax.net.SocketFactory
createSocket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrustedSocketFactory

public TrustedSocketFactory(javax.net.ssl.TrustManager trustManager,
                            javax.net.ssl.KeyManager keyManager)
Constructor of the TrustedSocketFactory.

Parameters:
trustManager - the trust manager to use.
keyManager - the key manager to use.
Method Detail

setCurrentThreadTrustManager

public static void setCurrentThreadTrustManager(javax.net.ssl.TrustManager trustManager,
                                                javax.net.ssl.KeyManager keyManager)
Sets the provided trust and key manager for the operations in the current thread.

Parameters:
trustManager - the trust manager to use.
keyManager - the key manager to use.

setThreadTrustManager

public static void setThreadTrustManager(javax.net.ssl.TrustManager trustManager,
                                         java.lang.Thread thread)
Sets the provided trust manager for the operations in the provided thread.

Parameters:
trustManager - the trust manager to use.
thread - the thread where we want to use the provided trust manager.

setThreadKeyManager

public static void setThreadKeyManager(javax.net.ssl.KeyManager keyManager,
                                       java.lang.Thread thread)
Sets the provided key manager for the operations in the provided thread.

Parameters:
keyManager - the key manager to use.
thread - the thread where we want to use the provided key manager.

getDefault

public static javax.net.SocketFactory getDefault()
Returns the default SSL socket factory. The default implementation can be changed by setting the value of the "ssl.SocketFactory.provider" security property (in the Java security properties file) to the desired class. If SSL has not been configured properly for this virtual machine, the factory will be inoperative (reporting instantiation exceptions).

Returns:
the default SocketFactory

createSocket

public java.net.Socket createSocket(java.net.InetAddress address,
                                    int port)
                             throws java.io.IOException

Specified by:
createSocket in class javax.net.SocketFactory
Throws:
java.io.IOException

createSocket

public java.net.Socket createSocket(java.net.InetAddress address,
                                    int port,
                                    java.net.InetAddress clientAddress,
                                    int clientPort)
                             throws java.io.IOException

Specified by:
createSocket in class javax.net.SocketFactory
Throws:
java.io.IOException

createSocket

public java.net.Socket 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 java.net.Socket createSocket(java.lang.String host,
                                    int port,
                                    java.net.InetAddress clientHost,
                                    int clientPort)
                             throws java.io.IOException

Specified by:
createSocket in class javax.net.SocketFactory
Throws:
java.io.IOException

createSocket

public java.net.Socket createSocket(java.net.Socket s,
                                    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