Class Netty4TcpChannel
java.lang.Object
org.elasticsearch.transport.netty4.Netty4TcpChannel
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,CloseableChannel,TcpChannel
public class Netty4TcpChannel extends java.lang.Object implements TcpChannel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.transport.TcpChannel
TcpChannel.ChannelStats -
Method Summary
Modifier and Type Method Description voidaddCloseListener(ActionListener<java.lang.Void> listener)voidaddConnectListener(ActionListener<java.lang.Void> listener)static voidaddListener(io.netty.channel.ChannelFuture channelFuture, org.elasticsearch.common.concurrent.CompletableContext<java.lang.Void> context)Adds a listener that completes the givenCompletableContextto the givenChannelFuture.static io.netty.channel.ChannelPromiseaddPromise(ActionListener<java.lang.Void> listener, io.netty.channel.Channel channel)Creates aChannelPromisefor the givenChanneland adds a listener that invokes the givenActionListeneron its completion.voidclose()TcpChannel.ChannelStatsgetChannelStats()java.net.InetSocketAddressgetLocalAddress()io.netty.channel.ChannelgetNettyChannel()java.lang.StringgetProfile()java.net.InetSocketAddressgetRemoteAddress()booleanisOpen()booleanisServerChannel()voidsendMessage(BytesReference reference, ActionListener<java.lang.Void> listener)java.lang.StringtoString()
-
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 givenCompletableContextto the givenChannelFuture.- Parameters:
channelFuture- Channel futurecontext- Context to complete
-
addPromise
public static io.netty.channel.ChannelPromise addPromise(ActionListener<java.lang.Void> listener, io.netty.channel.Channel channel)Creates aChannelPromisefor the givenChanneland adds a listener that invokes the givenActionListeneron its completion.- Parameters:
listener- lister to invokechannel- channel- Returns:
- write promise
-
close
public void close()- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceCloseableChannel
-
isServerChannel
public boolean isServerChannel()- Specified by:
isServerChannelin interfaceTcpChannel
-
getProfile
public java.lang.String getProfile()- Specified by:
getProfilein interfaceTcpChannel
-
addCloseListener
- Specified by:
addCloseListenerin interfaceCloseableChannel
-
addConnectListener
- Specified by:
addConnectListenerin interfaceTcpChannel
-
getChannelStats
- Specified by:
getChannelStatsin interfaceTcpChannel
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceCloseableChannel
-
getLocalAddress
public java.net.InetSocketAddress getLocalAddress()- Specified by:
getLocalAddressin interfaceTcpChannel
-
getRemoteAddress
public java.net.InetSocketAddress getRemoteAddress()- Specified by:
getRemoteAddressin interfaceTcpChannel
-
sendMessage
- Specified by:
sendMessagein interfaceTcpChannel
-
getNettyChannel
public io.netty.channel.Channel getNettyChannel() -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-