org.apache.thrift.transport

## Class TSSLTransportFactory

- java.lang.Object
- - org.apache.thrift.transport.TSSLTransportFactory

-     public class TSSLTransportFactory
      extends java.lang.Object

  A Factory for providing and setting up Client and Server SSL wrapped TSocket and TServerSocket

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TSSLTransportFactory.TSSLTransportParameters` A Class to hold all the SSL parameters

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TSSLTransportFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TSocket` | `getClientSocket(java.lang.String host, int port)` Get a default SSL wrapped TSocket connected to the specified host and port.
    `static TSocket` | `getClientSocket(java.lang.String host, int port, int timeout)` Get a default SSL wrapped TSocket connected to the specified host and port.
    `static TSocket` | `getClientSocket(java.lang.String host, int port, int timeout, TSSLTransportFactory.TSSLTransportParameters params)` Get a custom configured SSL wrapped TSocket.
    `static TServerSocket` | `getServerSocket(int port)` Get a SSL wrapped TServerSocket bound to the specified port.
    `static TServerSocket` | `getServerSocket(int port, int clientTimeout)` Get a default SSL wrapped TServerSocket bound to the specified port
    `static TServerSocket` | `getServerSocket(int port, int clientTimeout, boolean clientAuth, java.net.InetAddress ifAddress)` Get a default SSL wrapped TServerSocket bound to the specified port and interface
    `static TServerSocket` | `getServerSocket(int port, int clientTimeout, java.net.InetAddress ifAddress, TSSLTransportFactory.TSSLTransportParameters params)` Get a configured SSL wrapped TServerSocket bound to the specified port and interface.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TSSLTransportFactory

          public TSSLTransportFactory()

  - ### Method Detail

    - #### getServerSocket

          public static TServerSocket getServerSocket(int port)
                                               throws TTransportException

      Get a SSL wrapped TServerSocket bound to the specified port. In this configuration the default settings are used. Default settings are retrieved from System properties that are set. Example system properties: -Djavax.net.ssl.trustStore= -Djavax.net.ssl.trustStorePassword=password -Djavax.net.ssl.keyStore= -Djavax.net.ssl.keyStorePassword=password
      Parameters:
        `port` -
      Returns:
        A SSL wrapped TServerSocket
      Throws:
        `TTransportException`

    - #### getServerSocket

          public static TServerSocket getServerSocket(int port,
                                      int clientTimeout)
                                               throws TTransportException

      Get a default SSL wrapped TServerSocket bound to the specified port
      Parameters:
        `port` -
        `clientTimeout` -
      Returns:
        A SSL wrapped TServerSocket
      Throws:
        `TTransportException`

    - #### getServerSocket

          public static TServerSocket getServerSocket(int port,
                                      int clientTimeout,
                                      boolean clientAuth,
                                      java.net.InetAddress ifAddress)
                                               throws TTransportException

      Get a default SSL wrapped TServerSocket bound to the specified port and interface
      Parameters:
        `port` -
        `clientTimeout` -
        `ifAddress` -
      Returns:
        A SSL wrapped TServerSocket
      Throws:
        `TTransportException`

    - #### getServerSocket

          public static TServerSocket getServerSocket(int port,
                                      int clientTimeout,
                                      java.net.InetAddress ifAddress,
                                      TSSLTransportFactory.TSSLTransportParameters params)
                                               throws TTransportException

      Get a configured SSL wrapped TServerSocket bound to the specified port and interface. Here the TSSLTransportParameters are used to set the values for the algorithms, keystore, truststore and other settings
      Parameters:
        `port` -
        `clientTimeout` -
        `ifAddress` -
        `params` -
      Returns:
        A SSL wrapped TServerSocket
      Throws:
        `TTransportException`

    - #### getClientSocket

          public static TSocket getClientSocket(java.lang.String host,
                                int port,
                                int timeout)
                                         throws TTransportException

      Get a default SSL wrapped TSocket connected to the specified host and port. All the client methods return a bound connection. So there is no need to call open() on the TTransport.
      Parameters:
        `host` -
        `port` -
        `timeout` -
      Returns:
        A SSL wrapped TSocket
      Throws:
        `TTransportException`

    - #### getClientSocket

          public static TSocket getClientSocket(java.lang.String host,
                                int port)
                                         throws TTransportException

      Get a default SSL wrapped TSocket connected to the specified host and port.
      Parameters:
        `host` -
        `port` -
      Returns:
        A SSL wrapped TSocket
      Throws:
        `TTransportException`

    - #### getClientSocket

          public static TSocket getClientSocket(java.lang.String host,
                                int port,
                                int timeout,
                                TSSLTransportFactory.TSSLTransportParameters params)
                                         throws TTransportException

      Get a custom configured SSL wrapped TSocket. The SSL settings are obtained from the passed in TSSLTransportParameters.
      Parameters:
        `host` -
        `port` -
        `timeout` -
        `params` -
      Returns:
        A SSL wrapped TSocket
      Throws:
        `TTransportException`