1 package org.onap.msb.apiroute.api;
3 import io.swagger.annotations.ApiModelProperty;
5 import java.io.Serializable;
6 import java.util.Arrays;
7 import java.util.Objects;
9 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
11 @JsonIgnoreProperties(ignoreUnknown = true)
12 public class RouteInfo implements Serializable,Cloneable {
13 private static final long serialVersionUID = 1L;
14 @ApiModelProperty(required = true)
15 private String serviceName;
17 @ApiModelProperty(value = "Target Service URL,start with /",example = "/test", required = true)
20 @ApiModelProperty(value = "[control Range] 0:default 1:readonly 2:hidden ", allowableValues = "0,1,2", example = "0")
21 private String control="0";
23 @ApiModelProperty(value = "[status] 1:abled 0:disabled ", allowableValues = "0,1", example = "1")
24 private String status="1";
26 @ApiModelProperty(value = "[visual Range]interSystem:0,inSystem:1", allowableValues = "0,1", example = "1")
27 private String visualRange = "1";
29 @ApiModelProperty(value = "[LB Policy]non_ip_hash:0,ip_hash:1", allowableValues = "0,1", example = "0")
30 private String useOwnUpstream="0"; //lb policy
32 @ApiModelProperty(required = true)
33 private RouteServer servers[];
35 private String host="";
37 private String namespace="";
39 private String publish_port="";
41 private boolean enable_ssl=false; //true:https:开启SSL加密, false:http
43 private String consulServiceName="";
45 private String publishProtocol="http";
49 public String getPublish_port() {
52 public void setPublish_port(String publish_port) {
53 this.publish_port = publish_port;
58 public String getHost() {
62 public void setHost(String host) {
67 public String getServiceName() {
71 public void setServiceName(String serviceName) {
72 this.serviceName = serviceName;
75 public String getUrl() {
79 public void setUrl(String url) {
83 public RouteServer[] getServers() {
84 return servers.clone();
87 public void setServers(RouteServer[] servers) {
88 this.servers = servers.clone();
91 public String getControl() {
95 public void setControl(String control) {
96 this.control = control;
99 public String getStatus() {
103 public void setStatus(String status) {
104 this.status = status;
107 public String getVisualRange() {
111 public void setVisualRange(String visualRange) {
112 this.visualRange = visualRange;
115 public String getUseOwnUpstream() {
116 return useOwnUpstream;
119 public void setUseOwnUpstream(String useOwnUpstream) {
120 this.useOwnUpstream = useOwnUpstream;
123 public String getNamespace() {
127 public void setNamespace(String namespace) {
128 this.namespace = namespace;
130 public String getConsulServiceName() {
131 return consulServiceName;
133 public void setConsulServiceName(String consulServiceName) {
134 this.consulServiceName = consulServiceName;
138 public Object clone() throws CloneNotSupportedException
140 return super.clone();
142 public String getPublishProtocol() {
143 return publishProtocol;
145 public void setPublishProtocol(String publishProtocol) {
146 this.publishProtocol = publishProtocol;
148 public boolean isEnable_ssl() {
151 public void setEnable_ssl(boolean enable_ssl) {
152 this.enable_ssl = enable_ssl;
156 public boolean equals(Object o) {
157 if (this == o) return true;
158 if (o == null || getClass() != o.getClass()) return false;
159 RouteInfo that = (RouteInfo) o;
160 return Objects.equals(enable_ssl, that.enable_ssl) &&
161 Objects.equals(serviceName, that.serviceName) &&
162 Objects.equals(url, that.url) &&
163 Objects.equals(control, that.control) &&
164 Objects.equals(status, that.status) &&
165 Objects.equals(visualRange, that.visualRange) &&
166 Objects.equals(useOwnUpstream, that.useOwnUpstream) &&
167 Arrays.equals(servers, that.servers) &&
168 Objects.equals(host, that.host) &&
169 Objects.equals(namespace, that.namespace) &&
170 Objects.equals(publish_port, that.publish_port) &&
171 Objects.equals(consulServiceName, that.consulServiceName) &&
172 Objects.equals(publishProtocol, that.publishProtocol);
176 public int hashCode() {
177 return Objects.hash(serviceName, url, control, status, visualRange, useOwnUpstream, servers, host, namespace, publish_port, enable_ssl, consulServiceName, publishProtocol);