update link to upper-constraints.txt
[msb/apigateway.git] / apiroute / apiroute-service / src / main / java / org / onap / msb / apiroute / api / Node.java
1 /*******************************************************************************
2  * Copyright 2016-2018 ZTE, Inc. and others.
3  * 
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
6  * 
7  * http://www.apache.org/licenses/LICENSE-2.0
8  * 
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
12  * the License.
13  ******************************************************************************/
14 package org.onap.msb.apiroute.api;
15
16 import java.io.Serializable;
17 import java.util.Objects;
18
19 import io.swagger.annotations.ApiModelProperty;
20
21 public class Node implements Serializable {
22     private static final long serialVersionUID = 1L;
23
24     @ApiModelProperty(required = true)
25     private String ip;
26
27     @ApiModelProperty(required = true)
28     private String port;
29
30     private String status = "passing"; 
31
32     private int ttl = -1;
33
34     // health check type, allowableValues = "HTTP,TCP", example = "HTTP")
35     private String checkType = "";
36     // health check url, example for http "http://192.168.0.2:80/heallth", example for tcp
37     // "192.168.1.100:80"
38     private String checkUrl = "";
39
40     // TCP or HTTP health check Interval,Unit: second", example = "10s"
41     private String checkInterval;
42
43     // TCP or HTTP health check TimeOut,Unit: second", example = "10s"
44     private String checkTimeOut;
45
46     private Boolean tls_skip_verify = true;
47     /**
48      * @return the checkType
49      */
50     public String getCheckType() {
51         return checkType;
52     }
53
54     /**
55      * @param checkType the checkType to set
56      */
57     public void setCheckType(String checkType) {
58         this.checkType = checkType;
59     }
60
61     /**
62      * @return the checkUrl
63      */
64     public String getCheckUrl() {
65         return checkUrl;
66     }
67
68     /**
69      * @param checkUrl the checkUrl to set
70      */
71     public void setCheckUrl(String checkUrl) {
72         this.checkUrl = checkUrl;
73     }
74
75     /**
76      * @return the checkInterval
77      */
78     public String getCheckInterval() {
79         return checkInterval;
80     }
81
82     /**
83      * @param checkInterval the checkInterval to set
84      */
85     public void setCheckInterval(String checkInterval) {
86         this.checkInterval = checkInterval;
87     }
88
89     /**
90      * @return the checkTimeOut
91      */
92     public String getCheckTimeOut() {
93         return checkTimeOut;
94     }
95
96     /**
97      * @param checkTimeOut the checkTimeOut to set
98      */
99     public void setCheckTimeOut(String checkTimeOut) {
100         this.checkTimeOut = checkTimeOut;
101     }
102
103     public String getStatus() {
104         return status;
105     }
106
107     public void setStatus(String status) {
108         this.status = status;
109     }
110
111     public String getIp() {
112         return ip;
113     }
114
115     public void setIp(String ip) {
116         this.ip = ip;
117     }
118
119     public String getPort() {
120         return port;
121     }
122
123     public void setPort(String port) {
124         this.port = port;
125     }
126
127     public int getTtl() {
128         return ttl;
129     }
130
131     public void setTtl(int ttl) {
132         this.ttl = ttl;
133     }
134
135     public Node() {
136
137     }
138
139     public Node(String ip, String port, int ttl) {
140         this.ip = ip;
141         this.port = port;
142         this.ttl = ttl;
143     }
144
145     public Node(String ip, String port) {
146         this.ip = ip;
147         this.port = port;
148     }
149
150     @Override
151     public boolean equals(Object o) {
152         if (this == o)
153             return true;
154         if (o == null || getClass() != o.getClass())
155             return false;
156         Node node = (Node) o;
157         return Objects.equals(ttl, node.ttl) && Objects.equals(ip, node.ip) && Objects.equals(port, node.port)
158                         && Objects.equals(status, node.status);
159     }
160
161     @Override
162     public int hashCode() {
163         return Objects.hash(ip, port, status, ttl);
164     }
165 }