@Override public String returnServiceIdForConsoleAgentMsg(ConsoleProxyAgentMessage msg, String agentUuid) { return bus.makeServiceIdByManagementNodeId(ConsoleConstants.SERVICE_ID, Platform.getManagementServerId()); }
@Override public ReconnectConsoleProxyMsg call(String arg) { ReconnectConsoleProxyMsg rmsg = new ReconnectConsoleProxyMsg(); rmsg.setAgentUuid(arg); bus.makeServiceIdByManagementNodeId(rmsg, ConsoleConstants.SERVICE_ID, arg); return rmsg; } });
private void handle(APIUpdateConsoleProxyAgentMsg msg) { final APIUpdateConsoleProxyAgentEvent evt = new APIUpdateConsoleProxyAgentEvent(msg.getId()); UpdateConsoleProxyAgentMsg umsg = new UpdateConsoleProxyAgentMsg(); umsg.setUuid(msg.getUuid()); umsg.setConsoleProxyOverriddenIp(msg.getConsoleProxyOverriddenIp()); bus.makeServiceIdByManagementNodeId(umsg, ConsoleConstants.SERVICE_ID, msg.getUuid()); bus.send(umsg, new CloudBusCallBack(evt) { @Override public void run(MessageReply reply) { if (reply.isSuccess()) { bus.publish(evt); } else { UpdateConsoleProxyAgentReply rly = reply.castReply(); evt.setError(rly.getError()); bus.publish(evt); } } }); }
private void handle(final APIIsReadyToGoMsg msg) { final APIIsReadyToGoReply areply = new APIIsReadyToGoReply(); IsManagementNodeReadyMsg imsg = new IsManagementNodeReadyMsg(); String nodeId = msg.getManagementNodeId(); if (nodeId == null) { bus.makeLocalServiceId(imsg, ManagementNodeConstant.SERVICE_ID); nodeId = Platform.getManagementServerId(); } else { bus.makeServiceIdByManagementNodeId(imsg, ManagementNodeConstant.SERVICE_ID, msg.getManagementNodeId()); } final String fnodeId = nodeId; areply.setManagementNodeId(nodeId); bus.send(imsg, new CloudBusCallBack(msg) { @Override public void run(MessageReply reply) { if (!reply.isSuccess()) { areply.setError(reply.getError()); } else { IsManagementNodeReadyReply r = (IsManagementNodeReadyReply) reply; if (!r.isReady()) { areply.setError(err(SysErrors.NOT_READY_ERROR, "management node[uuid:%s] is not ready yet", fnodeId)); } } bus.reply(msg, areply); } }); }