Initial code import
[msb/apigateway.git] / apiroute / apiroute-service / src / main / java / org / openo / msb / api / Service.java
1 /**\r
2 * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)\r
3 *\r
4 * Licensed under the Apache License, Version 2.0 (the "License");\r
5 * you may not use this file except in compliance with the License.\r
6 * You may obtain a copy of the License at\r
7 *\r
8 * http://www.apache.org/licenses/LICENSE-2.0\r
9 *\r
10 * Unless required by applicable law or agreed to in writing, software\r
11 * distributed under the License is distributed on an "AS IS" BASIS,\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13 * See the License for the specific language governing permissions and\r
14 * limitations under the License.\r
15 */\r
16 package org.openo.msb.api;\r
17 \r
18 import io.swagger.annotations.ApiModelProperty;\r
19 \r
20 import java.io.Serializable;\r
21 import java.util.Set;\r
22 \r
23 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;\r
24 \r
25 @JsonIgnoreProperties(ignoreUnknown = true)\r
26 public class Service<T> implements Serializable {\r
27     private static final long serialVersionUID = 1L;\r
28     // 服务名\r
29     @ApiModelProperty(required = true)\r
30     private String serviceName;\r
31     // 版本号\r
32     @ApiModelProperty(example = "v1")\r
33     private String version="";\r
34     // 服务url\r
35     @ApiModelProperty(value = "Target Service URL,start with /",example = "/api/serviceName/v1", required = true)\r
36     private String url="";\r
37     // 服务对应协议,比如REST、UI、MQ、FTP、SNMP、TCP、UDP\r
38     @ApiModelProperty(value = "Service Protocol", allowableValues = "REST,UI, MQ, FTP,SNMP,TCP,UDP", example = "REST",required = true)\r
39     private String protocol = "";\r
40     \r
41     //服务的可见范围   系统间:0   系统内:1 \r
42     @ApiModelProperty(value = "[visual Range]interSystem:0,inSystem:1", allowableValues = "0,1", example = "1")\r
43     private String visualRange = "1";\r
44    \r
45     //负载均衡策略类型\r
46     @ApiModelProperty(value = "lb policy", allowableValues = "round-robin,hash,least_conn", example = "hash")\r
47     private String lb_policy="";\r
48    \r
49     @ApiModelProperty(required = true)\r
50     private Set<T> nodes;\r
51 \r
52     public Set<T> getNodes() {\r
53         return nodes;\r
54     }\r
55 \r
56     public void setNodes(Set<T> nodes) {\r
57         this.nodes = nodes;\r
58     }\r
59     \r
60     public String getServiceName() {\r
61         return serviceName;\r
62     }\r
63     public void setServiceName(String serviceName) {\r
64         this.serviceName = serviceName;\r
65     }\r
66     public String getVersion() {\r
67         return version;\r
68     }\r
69     public void setVersion(String version) {\r
70         this.version = version;\r
71     }\r
72     public String getUrl() {\r
73         return url;\r
74     }\r
75     public void setUrl(String url) {\r
76         this.url = url;\r
77     }\r
78     public String getProtocol() {\r
79         return protocol;\r
80     }\r
81     public void setProtocol(String protocol) {\r
82         this.protocol = protocol;\r
83     }\r
84     \r
85     public String getVisualRange() {\r
86         return visualRange;\r
87     }\r
88 \r
89     public void setVisualRange(String visualRange) {\r
90         this.visualRange = visualRange;\r
91     }\r
92     \r
93 \r
94     public String getLb_policy() {\r
95         return lb_policy;\r
96     }\r
97 \r
98     public void setLb_policy(String lb_policy) {\r
99         this.lb_policy = lb_policy;\r
100     }\r
101 \r
102     \r
103     \r
104 }\r