2 * Copyright 2016 ZTE Corporation.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.openo.msb.api;
18 import io.swagger.annotations.ApiModelProperty;
20 import java.io.Serializable;
23 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
25 @JsonIgnoreProperties(ignoreUnknown = true)
26 public class Service<T> implements Serializable {
27 private static final long serialVersionUID = 1L;
29 @ApiModelProperty(required = true)
30 private String serviceName;
32 @ApiModelProperty(example = "v1")
33 private String version="";
35 @ApiModelProperty(value = "Target Service URL,start with /",example = "/api/serviceName/v1", required = true)
36 private String url="";
38 @ApiModelProperty(value = "Service Protocol", allowableValues = "REST,UI, MQ, FTP,SNMP,TCP,UDP", example = "REST",required = true)
39 private String protocol = "";
42 @ApiModelProperty(value = "[visual Range]interSystem:0,inSystem:1", allowableValues = "0,1", example = "1")
43 private String visualRange = "1";
46 @ApiModelProperty(value = "lb policy", allowableValues = "round-robin,hash,least_conn", example = "hash")
47 private String lb_policy="";
49 @ApiModelProperty(required = true)
52 public Set<T> getNodes() {
56 public void setNodes(Set<T> nodes) {
60 public String getServiceName() {
63 public void setServiceName(String serviceName) {
64 this.serviceName = serviceName;
66 public String getVersion() {
69 public void setVersion(String version) {
70 this.version = version;
72 public String getUrl() {
75 public void setUrl(String url) {
78 public String getProtocol() {
81 public void setProtocol(String protocol) {
82 this.protocol = protocol;
85 public String getVisualRange() {
89 public void setVisualRange(String visualRange) {
90 this.visualRange = visualRange;
94 public String getLb_policy() {
98 public void setLb_policy(String lb_policy) {
99 this.lb_policy = lb_policy;