it.eng.rdlab.soa3.connector.utils.security
Class InheritableTLSSLSocketFactory

java.lang.Object
  extended by javax.net.SocketFactory
      extended by javax.net.ssl.SSLSocketFactory
          extended by it.eng.rdlab.soa3.connector.utils.security.InheritableTLSSLSocketFactory

public class InheritableTLSSLSocketFactory
extends SSLSocketFactory

Inheritable thread local ssl socket factory, for using different socket factories in different threads

Author:
Ciro Formisano (ENG)

Method Summary
 Socket createSocket()
          
 Socket createSocket(InetAddress host, int port)
          
 Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)
          
 Socket createSocket(Socket s, String host, int port, boolean autoClose)
          
 Socket createSocket(String host, int port)
          
 Socket createSocket(String address, int port, InetAddress localAddress, int localPort)
          
 SSLSocketFactory getCurrentSSLSocketFactory()
           
 String[] getDefaultCipherSuites()
          
static InheritableTLSSLSocketFactory getInstance()
          Returns the singleton instance of InheritableTLSSLSocketFactory
 String[] getSupportedCipherSuites()
          
 void reset()
          Removes the ssl socket factory from the current thread
 void setSSLSocketFactory(SSLSocketFactory sslSocketFactory)
          sets the sslSocketFactory for the current thread
 
Methods inherited from class javax.net.ssl.SSLSocketFactory
getDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static InheritableTLSSLSocketFactory getInstance()
Returns the singleton instance of InheritableTLSSLSocketFactory

Returns:
the singleton instance

setSSLSocketFactory

public void setSSLSocketFactory(SSLSocketFactory sslSocketFactory)
sets the sslSocketFactory for the current thread

Parameters:
sslSocketFactory -

reset

public void reset()
Removes the ssl socket factory from the current thread


createSocket

public Socket createSocket(Socket s,
                           String host,
                           int port,
                           boolean autoClose)
                    throws IOException

Specified by:
createSocket in class SSLSocketFactory
Throws:
IOException

getDefaultCipherSuites

public String[] getDefaultCipherSuites()

Specified by:
getDefaultCipherSuites in class SSLSocketFactory

getSupportedCipherSuites

public String[] getSupportedCipherSuites()

Specified by:
getSupportedCipherSuites in class SSLSocketFactory

createSocket

public Socket createSocket(String host,
                           int port)
                    throws IOException,
                           UnknownHostException

Specified by:
createSocket in class SocketFactory
Throws:
IOException
UnknownHostException

createSocket

public Socket createSocket(InetAddress host,
                           int port)
                    throws IOException

Specified by:
createSocket in class SocketFactory
Throws:
IOException

createSocket

public Socket createSocket(String address,
                           int port,
                           InetAddress localAddress,
                           int localPort)
                    throws IOException,
                           UnknownHostException

Specified by:
createSocket in class SocketFactory
Throws:
IOException
UnknownHostException

createSocket

public Socket createSocket(InetAddress address,
                           int port,
                           InetAddress localAddress,
                           int localPort)
                    throws IOException

Specified by:
createSocket in class SocketFactory
Throws:
IOException

createSocket

public Socket createSocket()
                    throws IOException

Overrides:
createSocket in class SocketFactory
Throws:
IOException

getCurrentSSLSocketFactory

public SSLSocketFactory getCurrentSSLSocketFactory()
Returns:


Copyright © 2013. All Rights Reserved.