public class ControlClient extends BasicClient<BitControl.RpcType,ControlConnection,BitControl.BitControlHandshake,BitControl.BitControlHandshake>
RpcBus.ChannelClosedHandler, RpcBus.InboundHandler
Constructor and Description |
---|
ControlClient(CoordinationProtos.DrillbitEndpoint remoteEndpoint,
CoordinationProtos.DrillbitEndpoint localEndpoint,
ControlMessageHandler handler,
BootStrapContext context,
ReconnectingConnection.CloseHandlerCreator closeHandlerFactory) |
Modifier and Type | Method and Description |
---|---|
void |
connect(RpcConnectionHandler<ControlConnection> connectionHandler) |
protected void |
finalizeConnection(BitControl.BitControlHandshake handshake,
ControlConnection connection) |
protected io.netty.util.concurrent.GenericFutureListener<io.netty.channel.ChannelFuture> |
getCloseHandler(io.netty.channel.socket.SocketChannel ch,
ControlConnection clientConnection) |
ControlConnection |
getConnection() |
ProtobufLengthDecoder |
getDecoder(BufferAllocator allocator) |
MessageLite |
getResponseDefaultInstance(int rpcType) |
protected Response |
handle(ControlConnection connection,
int rpcType,
io.netty.buffer.ByteBuf pBody,
io.netty.buffer.ByteBuf dBody) |
ControlConnection |
initRemoteConnection(io.netty.channel.socket.SocketChannel channel) |
protected void |
validateHandshake(BitControl.BitControlHandshake handshake) |
close, connectAsClient, isActive, isClient, send, send, setAutoRead
public ControlClient(CoordinationProtos.DrillbitEndpoint remoteEndpoint, CoordinationProtos.DrillbitEndpoint localEndpoint, ControlMessageHandler handler, BootStrapContext context, ReconnectingConnection.CloseHandlerCreator closeHandlerFactory)
public void connect(RpcConnectionHandler<ControlConnection> connectionHandler)
public ControlConnection initRemoteConnection(io.netty.channel.socket.SocketChannel channel)
protected io.netty.util.concurrent.GenericFutureListener<io.netty.channel.ChannelFuture> getCloseHandler(io.netty.channel.socket.SocketChannel ch, ControlConnection clientConnection)
getCloseHandler
in class RpcBus<BitControl.RpcType,ControlConnection>
public MessageLite getResponseDefaultInstance(int rpcType) throws RpcException
getResponseDefaultInstance
in class RpcBus<BitControl.RpcType,ControlConnection>
RpcException
protected Response handle(ControlConnection connection, int rpcType, io.netty.buffer.ByteBuf pBody, io.netty.buffer.ByteBuf dBody) throws RpcException
handle
in class RpcBus<BitControl.RpcType,ControlConnection>
RpcException
protected void validateHandshake(BitControl.BitControlHandshake handshake) throws RpcException
validateHandshake
in class BasicClient<BitControl.RpcType,ControlConnection,BitControl.BitControlHandshake,BitControl.BitControlHandshake>
RpcException
protected void finalizeConnection(BitControl.BitControlHandshake handshake, ControlConnection connection)
public ControlConnection getConnection()
public ProtobufLengthDecoder getDecoder(BufferAllocator allocator)
getDecoder
in class BasicClient<BitControl.RpcType,ControlConnection,BitControl.BitControlHandshake,BitControl.BitControlHandshake>
Copyright © 2015 The Apache Software Foundation. All rights reserved.