com.hazelcast.nio.ascii

## Class TextDecoder

- java.lang.Object
- - com.hazelcast.internal.networking.ChannelHandler<com.hazelcast.internal.networking.InboundHandler,S,D>
  - - com.hazelcast.internal.networking.InboundHandler<ByteBuffer,Void>
    - - com.hazelcast.nio.ascii.TextDecoder

- Direct Known Subclasses:
    MemcacheTextDecoder, RestApiTextDecoder

      @PrivateApi
      public abstract class TextDecoder
      extends com.hazelcast.internal.networking.InboundHandler<ByteBuffer,Void>

- - ### Field Summary

    - ### Fields inherited from class com.hazelcast.internal.networking.ChannelHandler

      `channel, dst, src`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TextDecoder(TcpIpConnection connection, TextEncoder encoder, com.hazelcast.nio.ascii.TextProtocolFilter textProtocolFilter, TextParsers textParsers, boolean rootDecoder)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeConnection()`
    `TextEncoder` | `getEncoder()`
    `void` | `handlerAdded()` Gets called when this ChannelHandler is added to the pipeline.
    `com.hazelcast.internal.networking.HandlerStatus` | `onRead()` A callback to indicate that data is available in the src to be processed.
    `void` | `publishRequest(com.hazelcast.internal.ascii.TextCommand command)`
    `void` | `sendResponse(com.hazelcast.internal.ascii.TextCommand command)`

    - ### Methods inherited from class com.hazelcast.internal.networking.InboundHandler

      `initSrcBuffer, initSrcBuffer`

    - ### Methods inherited from class com.hazelcast.internal.networking.ChannelHandler

      `dst, dst, interceptError, setChannel, src, src`

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

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

- - ### Constructor Detail

    - #### TextDecoder

          public TextDecoder(TcpIpConnection connection,
                             TextEncoder encoder,
                             com.hazelcast.nio.ascii.TextProtocolFilter textProtocolFilter,
                             TextParsers textParsers,
                             boolean rootDecoder)

  - ### Method Detail

    - #### sendResponse

          public void sendResponse(com.hazelcast.internal.ascii.TextCommand command)

    - #### handlerAdded

          public void handlerAdded()

      Description copied from class: `com.hazelcast.internal.networking.ChannelHandler`
      Gets called when this ChannelHandler is added to the pipeline. This method should execute very quickly because it could be executed on an io thread. Will be called from a thread owning this handler.
      Overrides:
        `handlerAdded` in class `com.hazelcast.internal.networking.ChannelHandler<com.hazelcast.internal.networking.InboundHandler,ByteBuffer,Void>`

    - #### onRead

          public com.hazelcast.internal.networking.HandlerStatus onRead()
                                                                 throws Exception

      Description copied from class: `com.hazelcast.internal.networking.InboundHandler`
      A callback to indicate that data is available in the src to be processed. InboundHandlers should be able to deal with spurious onReads (so a read even though there is nothing to be processed).
      Specified by:
        `onRead` in class `com.hazelcast.internal.networking.InboundHandler<ByteBuffer,Void>`
      Returns:
        HandlerStatus the status of the handler after processing the src.
      Throws:
        `Exception` - if something fails while reading data from the src or processing the data (e.g. when a Packet fails to get processed). When an exception is thrown, the `ChannelErrorHandler` is called.

    - #### publishRequest

          public void publishRequest(com.hazelcast.internal.ascii.TextCommand command)

    - #### getEncoder

          public TextEncoder getEncoder()

    - #### closeConnection

          public void closeConnection()

Copyright © 2019. All rights reserved.