2 * Copyright 2016 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.apiroute.api;
18 import io.swagger.annotations.ApiModelProperty;
20 import java.io.Serializable;
21 import java.util.Objects;
24 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
26 @JsonIgnoreProperties(ignoreUnknown = true)
27 public class MicroServiceFullInfo implements Serializable {
28 private static final long serialVersionUID = 1L;
31 @ApiModelProperty(required = true)
32 private String serviceName;
34 @ApiModelProperty(example = "v1")
35 private String version="";
37 @ApiModelProperty(value = "Target Service URL,start with /",example = "/api/serviceName/v1", required = true)
38 private String url="";
40 @ApiModelProperty(value = "Service Protocol", allowableValues = "REST,UI, MQ, FTP,SNMP,TCP,UDP", example = "REST",required = true)
41 private String protocol = "";
43 @ApiModelProperty(value = "[visual Range]interSystem:0,inSystem:1", allowableValues = "0,1", example = "1")
44 private String visualRange = "1";
46 @ApiModelProperty(value = "lb policy", allowableValues = "round-robin,hash,least_conn", example = "hash")
47 private String lb_policy="";
49 private String namespace="";
51 private String host="";
53 private String path="";
55 private String publish_port="";
57 @ApiModelProperty(value = "enable ssl", allowableValues = "true,false", example = "false")
58 private boolean enable_ssl=false; //true:https:开启SSL加密, false:http
60 private String custom; //PORTAL协议标志
62 private Set<Node> nodes;
64 @ApiModelProperty(value = "Service Status", allowableValues = "0,1", example = "1")
65 private String status = "1"; //0:disable 1:enable
70 public String getServiceName() {
73 public void setServiceName(String serviceName) {
74 this.serviceName = serviceName;
76 public String getVersion() {
79 public void setVersion(String version) {
80 this.version = version;
82 public String getUrl() {
85 public void setUrl(String url) {
88 public String getProtocol() {
91 public void setProtocol(String protocol) {
92 this.protocol = protocol;
95 public String getVisualRange() {
99 public void setVisualRange(String visualRange) {
100 this.visualRange = visualRange;
104 public String getLb_policy() {
108 public void setLb_policy(String lb_policy) {
109 this.lb_policy = lb_policy;
112 public String getNamespace() {
116 public void setNamespace(String namespace) {
117 this.namespace = namespace;
121 public String getHost() {
124 public void setHost(String host) {
127 public String getPath() {
130 public void setPath(String path) {
136 public Set<Node> getNodes() {
140 public void setNodes(Set<Node> nodes) {
144 public String getStatus() {
147 public void setStatus(String status) {
148 this.status = status;
150 public String getPublish_port() {
153 public void setPublish_port(String publish_port) {
154 this.publish_port = publish_port;
158 public boolean equals(Object o) {
159 if (this == o) return true;
160 if (o == null || getClass() != o.getClass()) return false;
161 MicroServiceFullInfo that = (MicroServiceFullInfo) o;
162 return Objects.equals(serviceName, that.serviceName) &&
163 Objects.equals(version, that.version) &&
164 Objects.equals(url, that.url) &&
165 Objects.equals(protocol, that.protocol) &&
166 Objects.equals(visualRange, that.visualRange) &&
167 Objects.equals(lb_policy, that.lb_policy) &&
168 Objects.equals(namespace, that.namespace) &&
169 Objects.equals(host, that.host) &&
170 Objects.equals(path, that.path) &&
171 Objects.equals(publish_port, that.publish_port) &&
172 Objects.equals(enable_ssl, that.enable_ssl) &&
173 Objects.equals(nodes, that.nodes) &&
174 Objects.equals(status, that.status);
178 public int hashCode() {
179 return Objects.hash(serviceName, version, url, protocol, visualRange, lb_policy, namespace, host, path, publish_port, enable_ssl, nodes, status);
181 public boolean isEnable_ssl() {
184 public void setEnable_ssl(boolean enable_ssl) {
185 this.enable_ssl = enable_ssl;
187 public String getCustom() {
190 public void setCustom(String custom) {
191 this.custom = custom;