Package org.apache.storm.security.auth

# Class ThriftClient

java.lang.Object
org.apache.storm.security.auth.ThriftClient

All Implemented Interfaces:
  `AutoCloseable`

Direct Known Subclasses:
  `DRPCClient`, `DRPCInvocationsClient`, `NimbusClient`, `SupervisorClient`

public class ThriftClient extends Object implements AutoCloseable

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected org.apache.storm.thrift.protocol.TProtocol`
  `protocol`
  `protected boolean`
  `retryForever`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ThriftClient(Map<String,Object> topoConf, ThriftConnectionType type, String host)`
  `ThriftClient(Map<String,Object> topoConf, ThriftConnectionType type, String host, Integer port, Integer timeout)`
  `ThriftClient(Map<String,Object> topoConf, ThriftConnectionType type, String host, Integer port, Integer timeout, String asUser)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `protected File`
  `getKeyStoreFile(String keyStorePass)`
  Function to create a keystore and return the keystore file.
  `protected PrivateKey`
  `getPrivateKey()`
  Get the private key using BouncyCastle library from a PKCS#1 format file.
  `void`
  `reconnect()`
  `org.apache.storm.thrift.transport.TTransport`
  `transport()`

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

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

- ## Field Details

  - ### protocol

    protected org.apache.storm.thrift.protocol.TProtocol protocol

  - ### retryForever

    protected boolean retryForever

- ## Constructor Details

  - ### ThriftClient

    public ThriftClient(Map<String,Object> topoConf, ThriftConnectionType type, String host)

  - ### ThriftClient

    public ThriftClient(Map<String,Object> topoConf, ThriftConnectionType type, String host, Integer port, Integer timeout)

  - ### ThriftClient

    public ThriftClient(Map<String,Object> topoConf, ThriftConnectionType type, String host, Integer port, Integer timeout, String asUser)

- ## Method Details

  - ### transport

    public org.apache.storm.thrift.transport.TTransport transport()

  - ### getPrivateKey

    protected PrivateKey getPrivateKey() throws IOException
    Get the private key using BouncyCastle library from a PKCS#1 format file.
    Returns:
      The Private Key
    Throws:
      `IOException` - The IOException

  - ### getKeyStoreFile

    protected File getKeyStoreFile(String keyStorePass) throws CertificateException, KeyStoreException, IOException, NoSuchAlgorithmException
    Function to create a keystore and return the keystore file.
    Parameters:
      `keyStorePass` - The keystore password.
    Returns:
      The keystore file
    Throws:
      `CertificateException` - CertificateException
      `KeyStoreException` - KeyStoreException
      `IOException` - IOException
      `NoSuchAlgorithmException` - NoSuchAlgorithmException

  - ### reconnect

    public void reconnect()

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`