Class Netty4TcpChannel

java.lang.Object
org.elasticsearch.transport.netty4.Netty4TcpChannel
All Implemented Interfaces:
Closeable, AutoCloseable, org.elasticsearch.common.network.CloseableChannel, org.elasticsearch.transport.TcpChannel

public class Netty4TcpChannel extends Object implements org.elasticsearch.transport.TcpChannel
  • Method Details

    • addListener

      public static void addListener(io.netty.channel.ChannelFuture channelFuture, org.elasticsearch.core.CompletableContext<Void> context)
      Adds a listener that completes the given CompletableContext to the given ChannelFuture.
      Parameters:
      channelFuture - Channel future
      context - Context to complete
    • addPromise

      public static io.netty.channel.ChannelPromise addPromise(org.elasticsearch.action.ActionListener<Void> listener, io.netty.channel.Channel channel)
      Creates a ChannelPromise for the given Channel and adds a listener that invokes the given ActionListener on its completion.
      Parameters:
      listener - lister to invoke
      channel - channel
      Returns:
      write promise
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.elasticsearch.common.network.CloseableChannel
    • isServerChannel

      public boolean isServerChannel()
      Specified by:
      isServerChannel in interface org.elasticsearch.transport.TcpChannel
    • getProfile

      public String getProfile()
      Specified by:
      getProfile in interface org.elasticsearch.transport.TcpChannel
    • addCloseListener

      public void addCloseListener(org.elasticsearch.action.ActionListener<Void> listener)
      Specified by:
      addCloseListener in interface org.elasticsearch.common.network.CloseableChannel
    • addConnectListener

      public void addConnectListener(org.elasticsearch.action.ActionListener<Void> listener)
      Specified by:
      addConnectListener in interface org.elasticsearch.transport.TcpChannel
    • getChannelStats

      public org.elasticsearch.transport.TcpChannel.ChannelStats getChannelStats()
      Specified by:
      getChannelStats in interface org.elasticsearch.transport.TcpChannel
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface org.elasticsearch.common.network.CloseableChannel
    • getLocalAddress

      public InetSocketAddress getLocalAddress()
      Specified by:
      getLocalAddress in interface org.elasticsearch.transport.TcpChannel
    • getRemoteAddress

      public InetSocketAddress getRemoteAddress()
      Specified by:
      getRemoteAddress in interface org.elasticsearch.transport.TcpChannel
    • sendMessage

      public void sendMessage(org.elasticsearch.common.bytes.BytesReference reference, org.elasticsearch.action.ActionListener<Void> listener)
      Specified by:
      sendMessage in interface org.elasticsearch.transport.TcpChannel
    • getNettyChannel

      public io.netty.channel.Channel getNettyChannel()
    • toString

      public String toString()
      Overrides:
      toString in class Object