org.apache.tinkerpop.gremlin.driver

## Interface Channelizer

- All Superinterfaces:
    io.netty.channel.ChannelHandler
  All Known Implementing Classes:
    Channelizer.AbstractChannelizer, Channelizer.NioChannelizer, Channelizer.WebSocketChannelizer

      public interface Channelizer
      extends io.netty.channel.ChannelHandler

  Client-side channel initializer interface. It is responsible for constructing the Netty `ChannelPipeline` used by the client to connect and send message to Gremlin Server.
  Author:
    Stephen Mallette (http://stephen.genoprime.com)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `Channelizer.AbstractChannelizer` Base implementation of the client side `Channelizer`.
    `static class` | `Channelizer.NioChannelizer` Deprecated. As of release 3.3.10, not replaced, use `WebSocketClient`.
    `static class` | `Channelizer.WebSocketChannelizer` WebSocket `Channelizer` implementation.

    - ### Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

      `io.netty.channel.ChannelHandler.Sharable`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close(io.netty.channel.Channel channel)` Called on `Connection.close()` to perform an `Channelizer` specific functions.
    `default void` | `connected()` Called after the channel connects.
    `default Object` | `createKeepAliveMessage()` Create a message for the driver to use as a "keep-alive" for the connection.
    `void` | `init(org.apache.tinkerpop.gremlin.driver.Connection connection)` Initializes the `Channelizer`.
    `default boolean` | `supportsKeepAlive()` Determines if the channelizer supports a method for keeping the connection to the server alive.

    - ### Methods inherited from interface io.netty.channel.ChannelHandler

      `exceptionCaught, handlerAdded, handlerRemoved`

- - ### Method Detail

    - #### init

          void init(org.apache.tinkerpop.gremlin.driver.Connection connection)

      Initializes the `Channelizer`. Called just after construction.

    - #### close

          void close(io.netty.channel.Channel channel)

      Called on `Connection.close()` to perform an `Channelizer` specific functions. Note that the `Connection` already calls `Channel.close()` so there is no need to call that method here. An implementation will typically use this method to send a `Channelizer` specific message to the server to notify of shutdown coming from the client side (e.g. a "close" websocket frame).

    - #### createKeepAliveMessage

          default Object createKeepAliveMessage()

      Create a message for the driver to use as a "keep-alive" for the connection. This method will only be used if `supportsKeepAlive()` is `true`.

    - #### supportsKeepAlive

          default boolean supportsKeepAlive()

      Determines if the channelizer supports a method for keeping the connection to the server alive.

    - #### connected

          default void connected()

      Called after the channel connects. The `Channelizer` may need to perform some functions, such as a handshake.

Copyright © 2013–2020 Apache Software Foundation. All rights reserved.