Redirect requests to Discovery service
[msb/apigateway.git] / apiroute / apiroute-service / src / main / java / org / onap / msb / apiroute / api / MicroServiceFullInfo.java
1 /*******************************************************************************
2  * Copyright 2016-2017 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 import java.util.Set;
19
20 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
21
22 import io.swagger.annotations.ApiModelProperty;
23
24 @JsonIgnoreProperties(ignoreUnknown = true)
25 public class MicroServiceFullInfo implements Serializable {
26     private static final long serialVersionUID = 1L;
27
28
29     @ApiModelProperty(required = true)
30     private String serviceName = "";
31
32     @ApiModelProperty(example = "v1")
33     private String version = "";
34
35     @ApiModelProperty(value = "Target Service URL,start with /", example = "/api/serviceName/v1", required = true)
36     private String url = "";
37
38     @ApiModelProperty(value = "Service Protocol", allowableValues = "REST,UI, MQ, FTP,SNMP,TCP,UDP", example = "REST",
39                     required = true)
40     private String protocol = "";
41
42     @ApiModelProperty(value = "[visual Range]interSystem:0,inSystem:1", allowableValues = "0,1", example = "1")
43     private String visualRange = "1";
44
45     @ApiModelProperty(value = "lb policy", allowableValues = "round-robin,hash,least_conn", example = "hash")
46     private String lb_policy = "";
47
48     private String namespace = "";
49
50     private String host = "";
51
52     private String path = "";
53
54     private String publish_port = "";
55
56     @ApiModelProperty(value = "enable ssl", allowableValues = "true,false", example = "false")
57     private boolean enable_ssl = false; // true:https:开启SSL加密, false:http
58
59     private String custom; // PORTAL协议标志
60
61     private Set<Node> nodes;
62
63     @ApiModelProperty(value = "Service Status", allowableValues = "0,1", example = "1")
64     private String status = "1"; // 0:disable 1:enable
65
66
67
68     public String getServiceName() {
69         return serviceName;
70     }
71
72     public void setServiceName(String serviceName) {
73         this.serviceName = serviceName;
74     }
75
76     public String getVersion() {
77         return version;
78     }
79
80     public void setVersion(String version) {
81         this.version = version;
82     }
83
84     public String getUrl() {
85         return url;
86     }
87
88     public void setUrl(String url) {
89         this.url = url;
90     }
91
92     public String getProtocol() {
93         return protocol;
94     }
95
96     public void setProtocol(String protocol) {
97         this.protocol = protocol;
98     }
99
100     public String getVisualRange() {
101         return visualRange;
102     }
103
104     public void setVisualRange(String visualRange) {
105         this.visualRange = visualRange;
106     }
107
108
109     public String getLb_policy() {
110         return lb_policy;
111     }
112
113     public void setLb_policy(String lb_policy) {
114         this.lb_policy = lb_policy;
115     }
116
117     public String getNamespace() {
118         return namespace;
119     }
120
121     public void setNamespace(String namespace) {
122         this.namespace = namespace;
123     }
124
125
126     public String getHost() {
127         return host;
128     }
129
130     public void setHost(String host) {
131         this.host = host;
132     }
133
134     public String getPath() {
135         return path;
136     }
137
138     public void setPath(String path) {
139         this.path = path;
140     }
141
142
143
144     public Set<Node> getNodes() {
145         return nodes;
146     }
147
148     public void setNodes(Set<Node> nodes) {
149         this.nodes = nodes;
150     }
151
152     public String getStatus() {
153         return status;
154     }
155
156     public void setStatus(String status) {
157         this.status = status;
158     }
159
160     public String getPublish_port() {
161         return publish_port;
162     }
163
164     public void setPublish_port(String publish_port) {
165         this.publish_port = publish_port;
166     }
167
168     @Override
169     public boolean equals(Object o) {
170         if (this == o)
171             return true;
172         if (o == null || getClass() != o.getClass())
173             return false;
174         MicroServiceFullInfo that = (MicroServiceFullInfo) o;
175         return Objects.equals(serviceName, that.serviceName) && Objects.equals(version, that.version)
176                         && Objects.equals(url, that.url) && Objects.equals(protocol, that.protocol)
177                         && Objects.equals(visualRange, that.visualRange) && Objects.equals(lb_policy, that.lb_policy)
178                         && Objects.equals(namespace, that.namespace) && Objects.equals(host, that.host)
179                         && Objects.equals(path, that.path) && Objects.equals(publish_port, that.publish_port)
180                         && Objects.equals(enable_ssl, that.enable_ssl) && Objects.equals(nodes, that.nodes)
181                         && Objects.equals(status, that.status);
182     }
183
184     @Override
185     public int hashCode() {
186         return Objects.hash(serviceName, version, url, protocol, visualRange, lb_policy, namespace, host, path,
187                         publish_port, enable_ssl, nodes, status);
188     }
189
190     public boolean isEnable_ssl() {
191         return enable_ssl;
192     }
193
194     public void setEnable_ssl(boolean enable_ssl) {
195         this.enable_ssl = enable_ssl;
196     }
197
198     public String getCustom() {
199         return custom;
200     }
201
202     public void setCustom(String custom) {
203         this.custom = custom;
204     }
205
206
207 }