2 * Copyright 2016-2017 ZTE, Inc. and others.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 * in compliance with the License. You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software distributed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 * or implied. See the License for the specific language governing permissions and limitations under
14 package org.onap.msb.sdclient.core;
16 import java.util.Date;
18 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
19 import com.google.common.base.Objects;
21 public class NodeInfo extends Node {
23 private static final long serialVersionUID = 8955786461351557306L;
25 private String nodeId; // node唯一标识
27 private String status; // 实例健康检查状态
30 @JsonSerialize(using = CustomDateSerializer.class)
31 private Date expiration;
33 @JsonSerialize(using = CustomDateSerializer.class)
34 private Date created_at;
36 @JsonSerialize(using = CustomDateSerializer.class)
37 private Date updated_at;
41 public Date getExpiration() {
45 public void setExpiration(Date expiration) {
46 this.expiration = expiration;
49 public Date getCreated_at() {
53 public void setCreated_at(Date created_at) {
54 this.created_at = created_at;
57 public Date getUpdated_at() {
61 public void setUpdated_at(Date updated_at) {
62 this.updated_at = updated_at;
65 public String getNodeId() {
69 public void setNodeId(String nodeId) {
73 public String getStatus() {
77 public void setStatus(String status) {
82 public int hashCode() {
83 return Objects.hashCode(getIp(), getPort(), getHa_role(), status);
87 public boolean equals(Object other) {
90 if (other instanceof NodeInfo) {
91 NodeInfo that = (NodeInfo) other;
92 return Objects.equal(getIp(), that.getIp()) && Objects.equal(getPort(), that.getPort());