Package org.apache.storm.security.auth.sasl

## Class SaslTransportPlugin

- java.lang.Object
- - org.apache.storm.security.auth.sasl.SaslTransportPlugin

- All Implemented Interfaces:
    `Closeable`, `AutoCloseable`, `ITransportPlugin`
  Direct Known Subclasses:
    `DigestSaslTransportPlugin`, `KerberosSaslTransportPlugin`, `PlainSaslTransportPlugin`

      public abstract class SaslTransportPlugin
      extends Object
      implements ITransportPlugin, Closeable

  Base class for SASL authentication plugin.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `SaslTransportPlugin.User` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected Map<String,​Object>` | `conf` |
    `protected ThriftConnectionType` | `type` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SaslTransportPlugin()` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `close()` |
    `int` | `getPort()` | Get port.
    `org.apache.storm.thrift.server.TServer` | `getServer​(org.apache.storm.thrift.TProcessor processor)` | Create a server associated with a given port, service handler, and purpose.
    `protected abstract org.apache.storm.thrift.transport.TTransportFactory` | `getServerTransportFactory​(boolean impersonationAllowed)` | Create the transport factory needed for serving.
    `void` | `prepare​(ThriftConnectionType type, Map<String,​Object> conf)` | Invoked once immediately after construction.

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

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

    - ### Methods inherited from interface org.apache.storm.security.auth.ITransportPlugin

      `areWorkerTokensSupported, connect`

- - ### Field Detail

    - #### type

          protected ThriftConnectionType type

    - #### conf

          protected Map<String,​Object> conf

  - ### Constructor Detail

    - #### SaslTransportPlugin

          public SaslTransportPlugin()

  - ### Method Detail

    - #### prepare

          public void prepare​(ThriftConnectionType type,
                              Map<String,​Object> conf)

      Description copied from interface: `ITransportPlugin`
      Invoked once immediately after construction.
      Specified by:
        `prepare` in interface `ITransportPlugin`
      Parameters:
        `type` - the type of connection this will process.
        `conf` - Storm configuration

    - #### getServer

          public org.apache.storm.thrift.server.TServer getServer​(org.apache.storm.thrift.TProcessor processor)
                                                           throws IOException,
                                                                  org.apache.storm.thrift.transport.TTransportException

      Description copied from interface: `ITransportPlugin`
      Create a server associated with a given port, service handler, and purpose.
      Specified by:
        `getServer` in interface `ITransportPlugin`
      Parameters:
        `processor` - service handler
      Returns:
        server
      Throws:
        `IOException`
        `org.apache.storm.thrift.transport.TTransportException`

    - #### close

          public void close()

      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `Closeable`

    - #### getServerTransportFactory

          protected abstract org.apache.storm.thrift.transport.TTransportFactory getServerTransportFactory​(boolean impersonationAllowed)
                                                                                                    throws IOException

      Create the transport factory needed for serving. All subclass must implement this method.
      Parameters:
        `impersonationAllowed` - true if SASL impersonation should be allowed, else false.
      Returns:
        server transport factory
      Throws:
        `IOException` - on any error.

    - #### getPort

          public int getPort()

      Description copied from interface: `ITransportPlugin`
      Get port.
      Specified by:
        `getPort` in interface `ITransportPlugin`
      Returns:
        The port this transport is using. This is not known until `ITransportPlugin.getServer(org.apache.storm.thrift.TProcessor)` has been called