use of org.mobicents.tools.heartbeat.api.NodeStopRequestPacket in project load-balancer by RestComm.
the class Client method sendPacket.
@Override
public synchronized void sendPacket(String command) {
if (clientBootstrap != null && !executor.isShutdown()) {
future = clientBootstrap.connect(isa);
switch(command) {
case Protocol.START:
if (packet == null || !(packet instanceof StartRequestPacket)) {
node.getProperties().put(Protocol.SESSION_ID, "" + System.currentTimeMillis());
packet = new StartRequestPacket(node);
}
break;
case Protocol.HEARTBEAT:
if (packet != null && !(packet instanceof HeartbeatRequestPacket))
packet = new HeartbeatRequestPacket(node);
break;
case Protocol.SHUTDOWN:
packet = new NodeShutdownRequestPacket(node);
break;
case Protocol.STOP:
packet = new NodeStopRequestPacket(node);
break;
}
future.awaitUninterruptibly();
future.getChannel().write(createRequest(command, null));
}
}
Aggregations