Issue-id: OCS-9
[msb/apigateway.git] / msb-core / apiroute / apiroute-service / src / main / java / org / openo / msb / api / Service.java
1 /**
2  * Copyright 2016 2015-2016 ZTE, Inc. and others. All rights reserved.
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.openo.msb.api;
17
18 import io.swagger.annotations.ApiModelProperty;
19
20 import java.io.Serializable;
21 import java.util.Set;
22
23 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
24
25 @JsonIgnoreProperties(ignoreUnknown = true)
26 public class Service<T> implements Serializable {
27     private static final long serialVersionUID = 1L;
28     // 服务名
29     @ApiModelProperty(required = true)
30     private String serviceName;
31     // 版本号
32     @ApiModelProperty(example = "v1")
33     private String version="";
34     // 服务url
35     @ApiModelProperty(value = "Target Service URL,start with /",example = "/api/serviceName/v1", required = true)
36     private String url="";
37     // 服务对应协议,比如REST、UI、MQ、FTP、SNMP、TCP、UDP
38     @ApiModelProperty(value = "Service Protocol", allowableValues = "REST,UI, MQ, FTP,SNMP,TCP,UDP", example = "REST",required = true)
39     private String protocol = "";
40     
41     //服务的可见范围   系统间:0   系统内:1 
42     @ApiModelProperty(value = "[visual Range]interSystem:0,inSystem:1", allowableValues = "0,1", example = "1")
43     private String visualRange = "1";
44    
45     //负载均衡策略类型
46     @ApiModelProperty(value = "lb policy", allowableValues = "round-robin,hash,least_conn", example = "hash")
47     private String lb_policy="";
48    
49     @ApiModelProperty(required = true)
50     private Set<T> nodes;
51
52     public Set<T> getNodes() {
53         return nodes;
54     }
55
56     public void setNodes(Set<T> nodes) {
57         this.nodes = nodes;
58     }
59     
60     public String getServiceName() {
61         return serviceName;
62     }
63     public void setServiceName(String serviceName) {
64         this.serviceName = serviceName;
65     }
66     public String getVersion() {
67         return version;
68     }
69     public void setVersion(String version) {
70         this.version = version;
71     }
72     public String getUrl() {
73         return url;
74     }
75     public void setUrl(String url) {
76         this.url = url;
77     }
78     public String getProtocol() {
79         return protocol;
80     }
81     public void setProtocol(String protocol) {
82         this.protocol = protocol;
83     }
84     
85     public String getVisualRange() {
86         return visualRange;
87     }
88
89     public void setVisualRange(String visualRange) {
90         this.visualRange = visualRange;
91     }
92     
93
94     public String getLb_policy() {
95         return lb_policy;
96     }
97
98     public void setLb_policy(String lb_policy) {
99         this.lb_policy = lb_policy;
100     }
101
102     
103     
104 }