[660][adas][data-center] 添加节点检测功能,节点状态接口,移除节点超时接口

This commit is contained in:
xinfengkun
2024-08-22 16:27:53 +08:00
parent 7b5adcf470
commit 36584260b3
21 changed files with 362 additions and 306 deletions

View File

@@ -0,0 +1,65 @@
package com.zhjt.mogo.adas.data.bean;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.zhjt.mogo.adas.data.AdasConstants;
import java.util.Objects;
public class NodeStateInfo {
private final AdasConstants.NodeName nodeName; //节点名称
@NonNull
private AdasConstants.NodeState nodeState;//节点主状态 包含:未知;存在;不存在;
@Nullable
private AdasConstants.NodeExistState existState;//节点存在时的状态 null表示未知
public NodeStateInfo(AdasConstants.NodeName nodeName, @NonNull AdasConstants.NodeState nodeState) {
this.nodeName = nodeName;
this.nodeState = nodeState;
}
public AdasConstants.NodeName getNodeName() {
return nodeName;
}
@NonNull
public AdasConstants.NodeState getNodeState() {
return nodeState;
}
public void setNodeState(@NonNull AdasConstants.NodeState nodeState) {
this.nodeState = nodeState;
}
@Nullable
public AdasConstants.NodeExistState getExistState() {
return existState;
}
public void setExistState(@Nullable AdasConstants.NodeExistState existState) {
this.existState = existState;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NodeStateInfo that = (NodeStateInfo) o;
return nodeName == that.nodeName && nodeState == that.nodeState && existState == that.existState;
}
@Override
public int hashCode() {
return Objects.hash(nodeName, nodeState, existState);
}
@Override
public String toString() {
return "NodeStateInfo{" +
"nodeName=" + nodeName +
", nodeState=" + nodeState +
", existState=" + existState +
'}';
}
}

View File

@@ -3,7 +3,6 @@ package mogo.telematics.pad;
option java_package = "com.zhjt.mogo.adas.data";
import "message_pad.proto";
import "personal/adas_constants.proto";
//发送的数据ID持久化只保留最后一条的消息id每天重新累计
message LastMessage{
@@ -16,10 +15,3 @@ message LastMessage{
message MessageIdInfo{
map<uint64, LastMessage> lastMessages = 1;// keydata日期 value数据
}
//节点状态信息
message NodeStateInfo{
com.zhjt.mogo.adas.data.NodeName nodeName = 1;//节点名称
com.zhjt.mogo.adas.data.NodeState nodeState = 2;//节点主状态 包含:未知;存在;不存在;
com.zhjt.mogo.adas.data.NodeExistState existState = 3;//节点存在时的状态
}

View File

@@ -110,9 +110,8 @@ enum SubscribeType {
* 节点名称
*/
enum NodeName{
DEFAULT_NAME = 0;//无用
SSM = 1;//SSM默认存在
FSM2024 = 2;//FSM 2024版本的Topic名称
SSM = 0;//SSM默认存在
FSM2024 = 1;//FSM 2024版本的Topic名称
}
/**