增加关闭采集指令处理
This commit is contained in:
@@ -40,21 +40,21 @@ public enum MsgEnum {
|
||||
|
||||
交换机上报("SWITCHBOARD"),
|
||||
|
||||
开启系统采集("SYSTEM_COLLECT_START"),
|
||||
开启或更新系统采集("SYSTEM_COLLECT_START"),
|
||||
|
||||
开启系统采集应答("SYSTEM_COLLECT_START_RSP"),
|
||||
开启或更新系统采集应答("SYSTEM_COLLECT_START_RSP"),
|
||||
|
||||
关闭系统采集("SYSTEM_COLLECT_STOP"),
|
||||
关闭所有系统采集("SYSTEM_COLLECT_STOP"),
|
||||
|
||||
关闭系统采集应答("SYSTEM_COLLECT_STOP_RSP"),
|
||||
关闭所有系统采集应答("SYSTEM_COLLECT_STOP_RSP"),
|
||||
|
||||
开启交换机采集("SWITCH_COLLECT_START"),
|
||||
开启或更新交换机采集("SWITCH_COLLECT_START"),
|
||||
|
||||
开启交换机采集应答("SWITCH_COLLECT_START_RSP"),
|
||||
开启或更新交换机采集应答("SWITCH_COLLECT_START_RSP"),
|
||||
|
||||
关闭交换机采集("SWITCH_COLLECT_STOP"),
|
||||
关闭所有交换机采集("SWITCH_COLLECT_STOP"),
|
||||
|
||||
关闭交换机采集应答("SWITCH_COLLECT_STOP_RSP"),
|
||||
关闭所有交换机采集应答("SWITCH_COLLECT_STOP_RSP"),
|
||||
|
||||
告警设置("ALARM_SET"),
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ public class AgentEndpoint {
|
||||
}
|
||||
}
|
||||
|
||||
@AgentDispatcher(msgId = MsgEnum.开启系统采集)
|
||||
@AgentDispatcher(msgId = MsgEnum.开启或更新系统采集)
|
||||
public class SystemCollectStartHandler implements AgentHandler {
|
||||
@Override
|
||||
public String downHandle(String data, String clientId) {
|
||||
@@ -207,13 +207,13 @@ public class AgentEndpoint {
|
||||
}
|
||||
}
|
||||
|
||||
@AgentDispatcher(msgId = MsgEnum.开启系统采集应答)
|
||||
@AgentDispatcher(msgId = MsgEnum.开启或更新系统采集应答)
|
||||
public class SystemCollectStartRspHandler implements AgentHandler {
|
||||
@Override
|
||||
public UpMsgResponse upHandle(String data, String clientId) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("clientId", clientId);
|
||||
jsonObject.put("dataType", MsgEnum.开启系统采集应答.getValue());
|
||||
jsonObject.put("dataType", MsgEnum.开启或更新系统采集应答.getValue());
|
||||
jsonObject.put("data", data);
|
||||
MqMsg mqMsg = MqMsg.builder().topic(agentMqConfig.getAgentTopic()).content(jsonObject.toString()).build();
|
||||
agentProducer.asyncSend(mqMsg);
|
||||
@@ -221,7 +221,15 @@ public class AgentEndpoint {
|
||||
}
|
||||
}
|
||||
|
||||
@AgentDispatcher(msgId = MsgEnum.开启交换机采集)
|
||||
@AgentDispatcher(msgId = MsgEnum.关闭所有系统采集)
|
||||
public class SystemCollectClosetHandler implements AgentHandler {
|
||||
@Override
|
||||
public String downHandle(String data, String clientId) {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@AgentDispatcher(msgId = MsgEnum.开启或更新交换机采集)
|
||||
public class SwitchCollectStartHandler implements AgentHandler {
|
||||
@Override
|
||||
public String downHandle(String data, String clientId) {
|
||||
@@ -229,13 +237,13 @@ public class AgentEndpoint {
|
||||
}
|
||||
}
|
||||
|
||||
@AgentDispatcher(msgId = MsgEnum.开启交换机采集应答)
|
||||
@AgentDispatcher(msgId = MsgEnum.开启或更新交换机采集应答)
|
||||
public class SwitchCollectStartRspHandler implements AgentHandler {
|
||||
@Override
|
||||
public UpMsgResponse upHandle(String data, String clientId) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("clientId", clientId);
|
||||
jsonObject.put("dataType", MsgEnum.开启交换机采集应答.getValue());
|
||||
jsonObject.put("dataType", MsgEnum.开启或更新交换机采集应答.getValue());
|
||||
jsonObject.put("data", data);
|
||||
MqMsg mqMsg = MqMsg.builder().topic(agentMqConfig.getAgentTopic()).content(jsonObject.toString()).build();
|
||||
agentProducer.asyncSend(mqMsg);
|
||||
@@ -243,6 +251,14 @@ public class AgentEndpoint {
|
||||
}
|
||||
}
|
||||
|
||||
@AgentDispatcher(msgId = MsgEnum.关闭所有交换机采集)
|
||||
public class SwitchCollectClosetHandler implements AgentHandler {
|
||||
@Override
|
||||
public String downHandle(String data, String clientId) {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@AgentDispatcher(msgId = MsgEnum.告警设置)
|
||||
public class AlarmSetHandler implements AgentHandler {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user