2 * Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
\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
8 * http://www.apache.org/licenses/LICENSE-2.0
\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
16 package org.openo.msb.api;
\r
18 import io.swagger.annotations.ApiModelProperty;
\r
20 import java.io.Serializable;
\r
21 import java.util.Set;
\r
23 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
\r
25 @JsonIgnoreProperties(ignoreUnknown = true)
\r
26 public class Service<T> implements Serializable {
\r
27 private static final long serialVersionUID = 1L;
\r
29 @ApiModelProperty(required = true)
\r
30 private String serviceName;
\r
32 @ApiModelProperty(example = "v1")
\r
33 private String version="";
\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
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
46 @ApiModelProperty(value = "lb policy", allowableValues = "round-robin,hash,least_conn", example = "hash")
\r
47 private String lb_policy="";
\r
49 @ApiModelProperty(required = true)
\r
50 private Set<T> nodes;
\r
52 public Set<T> getNodes() {
\r
56 public void setNodes(Set<T> nodes) {
\r
60 public String getServiceName() {
\r
63 public void setServiceName(String serviceName) {
\r
64 this.serviceName = serviceName;
\r
66 public String getVersion() {
\r
69 public void setVersion(String version) {
\r
70 this.version = version;
\r
72 public String getUrl() {
\r
75 public void setUrl(String url) {
\r
78 public String getProtocol() {
\r
81 public void setProtocol(String protocol) {
\r
82 this.protocol = protocol;
\r
85 public String getVisualRange() {
\r
89 public void setVisualRange(String visualRange) {
\r
90 this.visualRange = visualRange;
\r
94 public String getLb_policy() {
\r
98 public void setLb_policy(String lb_policy) {
\r
99 this.lb_policy = lb_policy;
\r