|
| 1 | +package org.tron.common.entity; |
| 2 | + |
| 3 | +import java.util.List; |
| 4 | + |
| 5 | +public class NodeInfo { |
| 6 | + |
| 7 | + /*block information*/ |
| 8 | + private long blockNum; |
| 9 | + private long solidityNum; |
| 10 | + private long beginSyncNum; |
| 11 | + private String blockHash; |
| 12 | + private String solidityHash; |
| 13 | + |
| 14 | + /*node information*/ |
| 15 | + private String codeVersion; |
| 16 | + private String p2pVersion; |
| 17 | + private int listenPort; |
| 18 | + private boolean discoverEnable; |
| 19 | + private int activeNodeSize; |
| 20 | + private int passiveNodeSize; |
| 21 | + private int sendNodeSize; |
| 22 | + private int maxConnectCount; |
| 23 | + private int sameIpMaxConnectCount; |
| 24 | + private int backupListenPort; |
| 25 | + private int backupMemberSize; |
| 26 | + private int backupPriority; |
| 27 | + |
| 28 | + /*connect information*/ |
| 29 | + private int currentConnectCount; |
| 30 | + private int activeConnectCount; |
| 31 | + private int passiveConnectCount; |
| 32 | + private long totalFlow; |
| 33 | + private List<PeerInfo> peerList; |
| 34 | + |
| 35 | + /*machine information*/ |
| 36 | + private int threadCount; |
| 37 | + private int cpuCount; |
| 38 | + private long totalMemory; |
| 39 | + private long freeMemory; |
| 40 | + private double cpuRate; |
| 41 | + private String javaVersion; |
| 42 | + private String osName; |
| 43 | + private long jvmTotalMemoery; |
| 44 | + private long jvmFreeMemory; |
| 45 | + private double processCpuRate; |
| 46 | + |
| 47 | + public long getBlockNum() { |
| 48 | + return blockNum; |
| 49 | + } |
| 50 | + |
| 51 | + public NodeInfo setBlockNum(long blockNum) { |
| 52 | + this.blockNum = blockNum; |
| 53 | + return this; |
| 54 | + } |
| 55 | + |
| 56 | + public long getSolidityNum() { |
| 57 | + return solidityNum; |
| 58 | + } |
| 59 | + |
| 60 | + public NodeInfo setSolidityNum(long solidityNum) { |
| 61 | + this.solidityNum = solidityNum; |
| 62 | + return this; |
| 63 | + } |
| 64 | + |
| 65 | + public long getBeginSyncNum() { |
| 66 | + return beginSyncNum; |
| 67 | + } |
| 68 | + |
| 69 | + public NodeInfo setBeginSyncNum(long beginSyncNum) { |
| 70 | + this.beginSyncNum = beginSyncNum; |
| 71 | + return this; |
| 72 | + } |
| 73 | + |
| 74 | + public String getSolidityHash() { |
| 75 | + return solidityHash; |
| 76 | + } |
| 77 | + |
| 78 | + public NodeInfo setSolidityHash(String solidityHash) { |
| 79 | + this.solidityHash = solidityHash; |
| 80 | + return this; |
| 81 | + } |
| 82 | + |
| 83 | + public String getBlockHash() { |
| 84 | + return blockHash; |
| 85 | + } |
| 86 | + |
| 87 | + public NodeInfo setBlockHash(String blockHash) { |
| 88 | + this.blockHash = blockHash; |
| 89 | + return this; |
| 90 | + } |
| 91 | + |
| 92 | + public String getCodeVersion() { |
| 93 | + return codeVersion; |
| 94 | + } |
| 95 | + |
| 96 | + public NodeInfo setCodeVersion(String codeVersion) { |
| 97 | + this.codeVersion = codeVersion; |
| 98 | + return this; |
| 99 | + } |
| 100 | + |
| 101 | + public String getP2pVersion() { |
| 102 | + return p2pVersion; |
| 103 | + } |
| 104 | + |
| 105 | + public NodeInfo setP2pVersion(String p2pVersion) { |
| 106 | + this.p2pVersion = p2pVersion; |
| 107 | + return this; |
| 108 | + } |
| 109 | + |
| 110 | + public int getListenPort() { |
| 111 | + return listenPort; |
| 112 | + } |
| 113 | + |
| 114 | + public NodeInfo setListenPort(int listenPort) { |
| 115 | + this.listenPort = listenPort; |
| 116 | + return this; |
| 117 | + } |
| 118 | + |
| 119 | + public boolean isDiscoverEnable() { |
| 120 | + return discoverEnable; |
| 121 | + } |
| 122 | + |
| 123 | + public NodeInfo setDiscoverEnable(boolean discoverEnable) { |
| 124 | + this.discoverEnable = discoverEnable; |
| 125 | + return this; |
| 126 | + } |
| 127 | + |
| 128 | + public int getActiveNodeSize() { |
| 129 | + return activeNodeSize; |
| 130 | + } |
| 131 | + |
| 132 | + public NodeInfo setActiveNodeSize(int activeNodeSize) { |
| 133 | + this.activeNodeSize = activeNodeSize; |
| 134 | + return this; |
| 135 | + } |
| 136 | + |
| 137 | + public int getPassiveNodeSize() { |
| 138 | + return passiveNodeSize; |
| 139 | + } |
| 140 | + |
| 141 | + public NodeInfo setPassiveNodeSize(int passiveNodeSize) { |
| 142 | + this.passiveNodeSize = passiveNodeSize; |
| 143 | + return this; |
| 144 | + } |
| 145 | + |
| 146 | + public int getSendNodeSize() { |
| 147 | + return sendNodeSize; |
| 148 | + } |
| 149 | + |
| 150 | + public NodeInfo setSendNodeSize(int sendNodeSize) { |
| 151 | + this.sendNodeSize = sendNodeSize; |
| 152 | + return this; |
| 153 | + } |
| 154 | + |
| 155 | + public int getMaxConnectCount() { |
| 156 | + return maxConnectCount; |
| 157 | + } |
| 158 | + |
| 159 | + public NodeInfo setMaxConnectCount(int maxConnectCount) { |
| 160 | + this.maxConnectCount = maxConnectCount; |
| 161 | + return this; |
| 162 | + } |
| 163 | + |
| 164 | + public int getSameIpMaxConnectCount() { |
| 165 | + return sameIpMaxConnectCount; |
| 166 | + } |
| 167 | + |
| 168 | + public NodeInfo setSameIpMaxConnectCount(int sameIpMaxConnectCount) { |
| 169 | + this.sameIpMaxConnectCount = sameIpMaxConnectCount; |
| 170 | + return this; |
| 171 | + } |
| 172 | + |
| 173 | + public int getBackupListenPort() { |
| 174 | + return backupListenPort; |
| 175 | + } |
| 176 | + |
| 177 | + public NodeInfo setBackupListenPort(int backupListenPort) { |
| 178 | + this.backupListenPort = backupListenPort; |
| 179 | + return this; |
| 180 | + } |
| 181 | + |
| 182 | + public int getBackupMemberSize() { |
| 183 | + return backupMemberSize; |
| 184 | + } |
| 185 | + |
| 186 | + public NodeInfo setBackupMemberSize(int backupMemberSize) { |
| 187 | + this.backupMemberSize = backupMemberSize; |
| 188 | + return this; |
| 189 | + } |
| 190 | + |
| 191 | + public int getBackupPriority() { |
| 192 | + return backupPriority; |
| 193 | + } |
| 194 | + |
| 195 | + public NodeInfo setBackupPriority(int backupPriority) { |
| 196 | + this.backupPriority = backupPriority; |
| 197 | + return this; |
| 198 | + } |
| 199 | + |
| 200 | + public int getCurrentConnectCount() { |
| 201 | + return currentConnectCount; |
| 202 | + } |
| 203 | + |
| 204 | + public NodeInfo setCurrentConnectCount(int currentConnectCount) { |
| 205 | + this.currentConnectCount = currentConnectCount; |
| 206 | + return this; |
| 207 | + } |
| 208 | + |
| 209 | + public int getActiveConnectCount() { |
| 210 | + return activeConnectCount; |
| 211 | + } |
| 212 | + |
| 213 | + public NodeInfo setActiveConnectCount(int activeConnectCount) { |
| 214 | + this.activeConnectCount = activeConnectCount; |
| 215 | + return this; |
| 216 | + } |
| 217 | + |
| 218 | + public int getPassiveConnectCount() { |
| 219 | + return passiveConnectCount; |
| 220 | + } |
| 221 | + |
| 222 | + public NodeInfo setPassiveConnectCount(int passiveConnectCount) { |
| 223 | + this.passiveConnectCount = passiveConnectCount; |
| 224 | + return this; |
| 225 | + } |
| 226 | + |
| 227 | + public long getTotalFlow() { |
| 228 | + return totalFlow; |
| 229 | + } |
| 230 | + |
| 231 | + public NodeInfo setTotalFlow(long totalFlow) { |
| 232 | + this.totalFlow = totalFlow; |
| 233 | + return this; |
| 234 | + } |
| 235 | + |
| 236 | + public List<PeerInfo> getPeerList() { |
| 237 | + return peerList; |
| 238 | + } |
| 239 | + |
| 240 | + public NodeInfo setPeerList(List<PeerInfo> peerList) { |
| 241 | + this.peerList = peerList; |
| 242 | + return this; |
| 243 | + } |
| 244 | + |
| 245 | + /*machine information*/ |
| 246 | + |
| 247 | + public int getThreadCount() { |
| 248 | + return threadCount; |
| 249 | + } |
| 250 | + |
| 251 | + public NodeInfo setThreadCount(int threadCount) { |
| 252 | + this.threadCount = threadCount; |
| 253 | + return this; |
| 254 | + } |
| 255 | + |
| 256 | + public int getCpuCount() { |
| 257 | + return cpuCount; |
| 258 | + } |
| 259 | + |
| 260 | + public NodeInfo setCpuCount(int cpuCount) { |
| 261 | + this.cpuCount = cpuCount; |
| 262 | + return this; |
| 263 | + } |
| 264 | + |
| 265 | + public long getTotalMemory() { |
| 266 | + return totalMemory; |
| 267 | + } |
| 268 | + |
| 269 | + public NodeInfo setTotalMemory(long totalMemory) { |
| 270 | + this.totalMemory = totalMemory; |
| 271 | + return this; |
| 272 | + } |
| 273 | + |
| 274 | + public long getFreeMemory() { |
| 275 | + return freeMemory; |
| 276 | + } |
| 277 | + |
| 278 | + public NodeInfo setFreeMemory(long freeMemory) { |
| 279 | + this.freeMemory = freeMemory; |
| 280 | + return this; |
| 281 | + } |
| 282 | + |
| 283 | + public double getCpuRate() { |
| 284 | + return cpuRate; |
| 285 | + } |
| 286 | + |
| 287 | + public NodeInfo setCpuRate(double cpuRate) { |
| 288 | + this.cpuRate = cpuRate; |
| 289 | + return this; |
| 290 | + } |
| 291 | + |
| 292 | + public String getJavaVersion() { |
| 293 | + return javaVersion; |
| 294 | + } |
| 295 | + |
| 296 | + public NodeInfo setJavaVersion(String javaVersion) { |
| 297 | + this.javaVersion = javaVersion; |
| 298 | + return this; |
| 299 | + } |
| 300 | + |
| 301 | + public String getOsName() { |
| 302 | + return osName; |
| 303 | + } |
| 304 | + |
| 305 | + public NodeInfo setOsName(String osName) { |
| 306 | + this.osName = osName; |
| 307 | + return this; |
| 308 | + } |
| 309 | + |
| 310 | + public long getJvmTotalMemoery() { |
| 311 | + return jvmTotalMemoery; |
| 312 | + } |
| 313 | + |
| 314 | + public NodeInfo setJvmTotalMemoery(long jvmTotalMemoery) { |
| 315 | + this.jvmTotalMemoery = jvmTotalMemoery; |
| 316 | + return this; |
| 317 | + } |
| 318 | + |
| 319 | + public long getJvmFreeMemory() { |
| 320 | + return jvmFreeMemory; |
| 321 | + } |
| 322 | + |
| 323 | + public NodeInfo setJvmFreeMemory(long jvmFreeMemory) { |
| 324 | + this.jvmFreeMemory = jvmFreeMemory; |
| 325 | + return this; |
| 326 | + } |
| 327 | + |
| 328 | + public double getProcessCpuRate() { |
| 329 | + return processCpuRate; |
| 330 | + } |
| 331 | + |
| 332 | + public NodeInfo setProcessCpuRate(double processCpuRate) { |
| 333 | + this.processCpuRate = processCpuRate; |
| 334 | + return this; |
| 335 | + } |
| 336 | +} |
0 commit comments