Class Netty4TcpChannel

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

public class Netty4TcpChannel
extends java.lang.Object
implements org.elasticsearch.transport.TcpChannel
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.transport.TcpChannel

    org.elasticsearch.transport.TcpChannel.ChannelStats
  • Method Summary

    Modifier and Type Method Description
    void addCloseListener​(org.elasticsearch.action.ActionListener<java.lang.Void> listener)  
    void addConnectListener​(org.elasticsearch.action.ActionListener<java.lang.Void> listener)  
    static void addListener​(io.netty.channel.ChannelFuture channelFuture, org.elasticsearch.common.concurrent.CompletableContext<java.lang.Void> context)
    Adds a listener that completes the given CompletableContext to the given ChannelFuture.
    static io.netty.channel.ChannelPromise addPromise​(org.elasticsearch.action.ActionListener<java.lang.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.
    void close()  
    org.elasticsearch.transport.TcpChannel.ChannelStats getChannelStats()  
    java.net.InetSocketAddress getLocalAddress()  
    io.netty.channel.Channel getNettyChannel()  
    java.lang.String getProfile()  
    java.net.InetSocketAddress getRemoteAddress()  
    boolean isOpen()  
    boolean isServerChannel()  
    void sendMessage​(org.elasticsearch.common.bytes.BytesReference reference, org.elasticsearch.action.ActionListener<java.lang.Void> listener)  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • addListener

      public static void addListener​(io.netty.channel.ChannelFuture channelFuture, org.elasticsearch.common.concurrent.CompletableContext<java.lang.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<java.lang.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 java.lang.AutoCloseable
      Specified by:
      close in interface java.io.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 java.lang.String getProfile()
      Specified by:
      getProfile in interface org.elasticsearch.transport.TcpChannel
    • addCloseListener

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

      public void addConnectListener​(org.elasticsearch.action.ActionListener<java.lang.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 java.net.InetSocketAddress getLocalAddress()
      Specified by:
      getLocalAddress in interface org.elasticsearch.transport.TcpChannel
    • getRemoteAddress

      public java.net.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<java.lang.Void> listener)
      Specified by:
      sendMessage in interface org.elasticsearch.transport.TcpChannel
    • getNettyChannel

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

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object