Package org.elasticsearch.transport
Class FakeTcpChannel
java.lang.Object
org.elasticsearch.transport.FakeTcpChannel
- All Implemented Interfaces:
Closeable
,AutoCloseable
,CloseableChannel
,TcpChannel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.transport.TcpChannel
TcpChannel.ChannelStats
-
Constructor Summary
ConstructorDescriptionFakeTcpChannel
(boolean isServer) FakeTcpChannel
(boolean isServer, String profile, AtomicReference<BytesReference> messageCaptor) FakeTcpChannel
(boolean isServer, InetSocketAddress localAddress, InetSocketAddress remoteAddress) FakeTcpChannel
(boolean isServer, InetSocketAddress localAddress, InetSocketAddress remoteAddress, String profile, AtomicReference<BytesReference> messageCaptor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCloseListener
(ActionListener<Void> listener) void
addConnectListener
(ActionListener<Void> listener) void
close()
boolean
isOpen()
boolean
void
sendMessage
(BytesReference reference, ActionListener<Void> listener)
-
Constructor Details
-
FakeTcpChannel
public FakeTcpChannel() -
FakeTcpChannel
public FakeTcpChannel(boolean isServer) -
FakeTcpChannel
public FakeTcpChannel(boolean isServer, InetSocketAddress localAddress, InetSocketAddress remoteAddress) -
FakeTcpChannel
public FakeTcpChannel(boolean isServer, String profile, AtomicReference<BytesReference> messageCaptor) -
FakeTcpChannel
public FakeTcpChannel(boolean isServer, InetSocketAddress localAddress, InetSocketAddress remoteAddress, String profile, AtomicReference<BytesReference> messageCaptor)
-
-
Method Details
-
isServerChannel
public boolean isServerChannel()- Specified by:
isServerChannel
in interfaceTcpChannel
-
getProfile
- Specified by:
getProfile
in interfaceTcpChannel
-
getLocalAddress
- Specified by:
getLocalAddress
in interfaceTcpChannel
-
getRemoteAddress
- Specified by:
getRemoteAddress
in interfaceTcpChannel
-
sendMessage
- Specified by:
sendMessage
in interfaceTcpChannel
-
addConnectListener
- Specified by:
addConnectListener
in interfaceTcpChannel
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceCloseableChannel
-
addCloseListener
- Specified by:
addCloseListener
in interfaceCloseableChannel
-
isOpen
public boolean isOpen()- Specified by:
isOpen
in interfaceCloseableChannel
-
getChannelStats
- Specified by:
getChannelStats
in interfaceTcpChannel
-
getMessageCaptor
-
getListenerCaptor
-