Divide the MSB source codes into two repos
[msb/apigateway.git] / apiroute / apiroute-service / src / main / java / org / onap / msb / apiroute / api / RouteInfo.java
1 package org.onap.msb.apiroute.api;
2
3 import io.swagger.annotations.ApiModelProperty;
4
5 import java.io.Serializable;
6 import java.util.Arrays;
7 import java.util.Objects;
8
9 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
10
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; 
16   
17   @ApiModelProperty(value = "Target Service URL,start with /",example = "/test", required = true)
18   private String  url;      
19   
20   @ApiModelProperty(value = "[control Range] 0:default   1:readonly  2:hidden ", allowableValues = "0,1,2", example = "0")
21   private String  control="0";    
22   
23   @ApiModelProperty(value = "[status] 1:abled    0:disabled ", allowableValues = "0,1", example = "1")
24   private String  status="1"; 
25   
26   @ApiModelProperty(value = "[visual Range]interSystem:0,inSystem:1", allowableValues = "0,1", example = "1")
27   private String visualRange = "1"; 
28  
29   @ApiModelProperty(value = "[LB Policy]non_ip_hash:0,ip_hash:1", allowableValues = "0,1", example = "0")
30   private String useOwnUpstream="0"; //lb policy   
31
32   @ApiModelProperty(required = true)
33   private RouteServer servers[]; 
34   
35   private String host="";
36   
37   private String namespace="";
38   
39   private String publish_port="";
40   
41   private boolean enable_ssl=false; //true:https:开启SSL加密,  false:http
42   
43   private String consulServiceName=""; 
44   
45   private String publishProtocol="http"; 
46   
47   
48   
49   public String getPublish_port() {
50     return publish_port;
51   }
52   public void setPublish_port(String publish_port) {
53     this.publish_port = publish_port;
54   }
55
56   
57
58   public String getHost() {
59     return host;
60   }
61
62   public void setHost(String host) {
63     this.host = host;
64   }
65
66
67 public String getServiceName() {
68       return serviceName;
69   }
70
71   public void setServiceName(String serviceName) {
72       this.serviceName = serviceName;
73   }
74
75   public String getUrl() {
76       return url;
77   }
78
79   public void setUrl(String url) {
80       this.url = url;
81   }
82
83   public RouteServer[] getServers() {
84       return servers.clone();
85   }
86
87   public void setServers(RouteServer[] servers) {
88       this.servers = servers.clone();
89   }
90
91   public String getControl() {
92       return control;
93   }
94
95   public void setControl(String control) {
96       this.control = control;
97   }
98
99   public String getStatus() {
100       return status;
101   }
102
103   public void setStatus(String status) {
104       this.status = status;
105   }
106
107   public String getVisualRange() {
108       return visualRange;
109   }
110
111   public void setVisualRange(String visualRange) {
112       this.visualRange = visualRange;
113   }
114
115   public String getUseOwnUpstream() {
116       return useOwnUpstream;
117   }
118
119   public void setUseOwnUpstream(String useOwnUpstream) {
120       this.useOwnUpstream = useOwnUpstream;
121   }
122
123   public String getNamespace() {
124     return namespace;
125   }
126
127   public void setNamespace(String namespace) {
128     this.namespace = namespace;
129   }
130   public String getConsulServiceName() {
131     return consulServiceName;
132   }
133   public void setConsulServiceName(String consulServiceName) {
134     this.consulServiceName = consulServiceName;
135   }
136   
137   @Override  
138   public Object clone() throws CloneNotSupportedException  
139   {  
140       return super.clone();  
141   }
142   public String getPublishProtocol() {
143     return publishProtocol;
144   }
145   public void setPublishProtocol(String publishProtocol) {
146     this.publishProtocol = publishProtocol;
147   }
148   public boolean isEnable_ssl() {
149     return enable_ssl;
150   }
151   public void setEnable_ssl(boolean enable_ssl) {
152     this.enable_ssl = enable_ssl;
153   }
154
155   @Override
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);
173   }
174
175   @Override
176   public int hashCode() {
177       return Objects.hash(serviceName, url, control, status, visualRange, useOwnUpstream, servers, host, namespace, publish_port, enable_ssl, consulServiceName, publishProtocol);
178   }
179 }