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