1 /*******************************************************************************
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
13 ******************************************************************************/
14 package org.onap.msb.apiroute.api;
16 import java.io.Serializable;
17 import java.util.Objects;
20 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
22 import io.swagger.annotations.ApiModelProperty;
24 @JsonIgnoreProperties(ignoreUnknown = true)
25 public class MicroServiceFullInfo implements Serializable {
26 private static final long serialVersionUID = 1L;
29 @ApiModelProperty(required = true)
30 private String serviceName = "";
32 @ApiModelProperty(example = "v1")
33 private String version = "";
35 @ApiModelProperty(value = "Target Service URL,start with /", example = "/api/serviceName/v1", required = true)
36 private String url = "";
38 @ApiModelProperty(value = "Service Protocol", allowableValues = "REST,UI, MQ, FTP,SNMP,TCP,UDP", example = "REST",
40 private String protocol = "";
42 @ApiModelProperty(value = "[visual Range]interSystem:0,inSystem:1", allowableValues = "0,1", example = "1")
43 private String visualRange = "1";
45 @ApiModelProperty(value = "lb policy", allowableValues = "round-robin,hash,least_conn", example = "hash")
46 private String lb_policy = "";
48 private String namespace = "";
50 private String host = "";
52 private String path = "";
54 private String publish_port = "";
56 @ApiModelProperty(value = "enable ssl", allowableValues = "true,false", example = "false")
57 private boolean enable_ssl = false; // true:https:开启SSL加密, false:http
59 private String custom; // PORTAL协议标志
61 private Set<Node> nodes;
63 @ApiModelProperty(value = "Service Status", allowableValues = "0,1", example = "1")
64 private String status = "1"; // 0:disable 1:enable
68 public String getServiceName() {
72 public void setServiceName(String serviceName) {
73 this.serviceName = serviceName;
76 public String getVersion() {
80 public void setVersion(String version) {
81 this.version = version;
84 public String getUrl() {
88 public void setUrl(String url) {
92 public String getProtocol() {
96 public void setProtocol(String protocol) {
97 this.protocol = protocol;
100 public String getVisualRange() {
104 public void setVisualRange(String visualRange) {
105 this.visualRange = visualRange;
109 public String getLb_policy() {
113 public void setLb_policy(String lb_policy) {
114 this.lb_policy = lb_policy;
117 public String getNamespace() {
121 public void setNamespace(String namespace) {
122 this.namespace = namespace;
126 public String getHost() {
130 public void setHost(String host) {
134 public String getPath() {
138 public void setPath(String path) {
144 public Set<Node> getNodes() {
148 public void setNodes(Set<Node> nodes) {
152 public String getStatus() {
156 public void setStatus(String status) {
157 this.status = status;
160 public String getPublish_port() {
164 public void setPublish_port(String publish_port) {
165 this.publish_port = publish_port;
169 public boolean equals(Object o) {
172 if (o == null || getClass() != o.getClass())
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);
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);
190 public boolean isEnable_ssl() {
194 public void setEnable_ssl(boolean enable_ssl) {
195 this.enable_ssl = enable_ssl;
198 public String getCustom() {
202 public void setCustom(String custom) {
203 this.custom = custom;