2 * Copyright 2016-2017 ZTE, Inc. and others.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.onap.msb.sdclient.core;
18 import java.util.Date;
20 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
21 import com.google.common.base.Objects;
23 public class NodeInfo extends Node {
25 private static final long serialVersionUID = 8955786461351557306L;
27 private String nodeId; //node唯一标识
29 private String status; //实例健康检查状态
32 @JsonSerialize(using = CustomDateSerializer.class)
33 private Date expiration;
35 @JsonSerialize(using = CustomDateSerializer.class)
36 private Date created_at;
38 @JsonSerialize(using = CustomDateSerializer.class)
39 private Date updated_at;
43 public Date getExpiration() {
47 public void setExpiration(Date expiration) {
48 this.expiration = expiration;
51 public Date getCreated_at() {
55 public void setCreated_at(Date created_at) {
56 this.created_at = created_at;
59 public Date getUpdated_at() {
63 public void setUpdated_at(Date updated_at) {
64 this.updated_at = updated_at;
67 public String getNodeId() {
71 public void setNodeId(String nodeId) {
75 public String getStatus() {
79 public void setStatus(String status) {
84 public int hashCode() {
85 return Objects.hashCode(getIp(),getPort(),getHa_role(),status );
89 public boolean equals(Object other)
93 if(other instanceof NodeInfo)
95 NodeInfo that = (NodeInfo)other;
96 return Objects.equal(getIp(), that.getIp())
97 && Objects.equal(getPort(), that.getPort());