Package org.apache.storm.messaging.netty

## Class SaslMessageToken

- java.lang.Object
- - org.apache.storm.messaging.netty.SaslMessageToken

- All Implemented Interfaces:
    `INettySerializable`

      public class SaslMessageToken
      extends Object
      implements INettySerializable

  Send and receive SASL tokens.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static short` | `IDENTIFIER` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SaslMessageToken()` | Constructor used for reflection only.
    `SaslMessageToken​(byte[] token)` | Constructor used to send request.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `encodeLength()` |
    `byte[]` | `getSaslToken()` | Read accessor for SASL token.
    `static SaslMessageToken` | `read​(byte[] serial)` |
    `void` | `setSaslToken​(byte[] token)` | Write accessor for SASL token.
    `void` | `write​(org.apache.storm.shade.io.netty.buffer.ByteBuf dest)` | encode the current SaslToken Message into a ByteBuf.

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

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

- - ### Field Detail

    - #### IDENTIFIER

          public static final short IDENTIFIER

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SaslMessageToken

          public SaslMessageToken()

      Constructor used for reflection only.

    - #### SaslMessageToken

          public SaslMessageToken​(byte[] token)

      Constructor used to send request.
      Parameters:
        `token` - the SASL token, generated by a SaslClient or SaslServer.

  - ### Method Detail

    - #### read

          public static SaslMessageToken read​(byte[] serial)

    - #### getSaslToken

          public byte[] getSaslToken()

      Read accessor for SASL token.
      Returns:
        saslToken SASL token

    - #### setSaslToken

          public void setSaslToken​(byte[] token)

      Write accessor for SASL token.
      Parameters:
        `token` - SASL token

    - #### encodeLength

          public int encodeLength()

      Specified by:
        `encodeLength` in interface `INettySerializable`

    - #### write

          public void write​(org.apache.storm.shade.io.netty.buffer.ByteBuf dest)

      encode the current SaslToken Message into a ByteBuf.

      SaslTokenMessageRequest is encoded as: identifier .... short(2) payload length .... int payload .... byte[]

      Specified by:
        `write` in interface `INettySerializable`
      Parameters:
        `dest` - The ByteBuf to serialize to