2 * Copyright 2016 ZTE, Inc. and others.
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.onap.msb.sdclient.core;
18 import java.io.Serializable;
19 import java.util.List;
22 import javax.xml.bind.annotation.XmlElement;
23 import javax.xml.bind.annotation.XmlElementWrapper;
25 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
27 import io.swagger.annotations.ApiModelProperty;
30 @JsonIgnoreProperties(ignoreUnknown = true)
31 public class Service<T> implements Serializable {
32 private static final long serialVersionUID = 1L;
34 @ApiModelProperty(example = "test",required = true)
35 private String serviceName;
37 @ApiModelProperty(example = "v1", required = true)
38 private String version="";
40 @ApiModelProperty(value = "Target Service URL,start with /",example = "/api/serviceName/v1", required = true)
41 private String url="";
43 // 服务对应协议,比如REST、UI、MQ、FTP、SNMP、TCP、UDP
44 @ApiModelProperty(value = "Service Protocol", allowableValues = "REST,UI, HTTP, TCP,UDP", example = "HTTP",required = true)
45 private String protocol = "";
47 //服务的可见范围 0:系统间 1:系统内 ,可配置多个,以 |分隔
48 @ApiModelProperty(value = "[visual Range]interSystem:0,inSystem:1", allowableValues = "0,1", example = "1")
49 private String visualRange = "1";
52 @ApiModelProperty(value = "lb policy", allowableValues = "round-robin,ip_hash", example = "ip_hash")
53 private String lb_policy;
56 @ApiModelProperty(hidden = true)
57 private String publish_port;
60 private String namespace="";
63 @ApiModelProperty(hidden = true)
64 private String network_plane_type;
66 @ApiModelProperty(hidden = true)
67 private String host="";
69 @ApiModelProperty(hidden = true)
70 private String path="";
75 @ApiModelProperty(required = true)
79 private List<KeyVaulePair> metadata;
82 @ApiModelProperty(value = "custom labels", example = "key1:value1")
83 private List<String> labels;
87 public String getHost() {
91 public void setHost(String host) {
95 public String getPath() {
99 public void setPath(String path) {
103 public List<String> getLabels() {
107 public void setLabels(List<String> labels) {
108 this.labels = labels;
111 public Set<T> getNodes() {
115 public void setNodes(Set<T> nodes) {
119 public String getServiceName() {
122 public void setServiceName(String serviceName) {
123 this.serviceName = serviceName;
125 public String getVersion() {
128 public void setVersion(String version) {
129 this.version = version;
131 public String getUrl() {
134 public void setUrl(String url) {
137 public String getProtocol() {
140 public void setProtocol(String protocol) {
141 this.protocol = protocol;
146 public List<KeyVaulePair> getMetadata() {
150 public void setMetadata(List<KeyVaulePair> metadata) {
151 this.metadata = metadata;
155 public String getVisualRange() {
159 public void setVisualRange(String visualRange) {
160 this.visualRange = visualRange;
163 public String getLb_policy() {
167 public void setLb_policy(String lb_policy) {
168 this.lb_policy = lb_policy;
171 public String getPublish_port() {
175 public void setPublish_port(String publish_port) {
176 this.publish_port = publish_port;
179 public String getNamespace() {
183 public void setNamespace(String namespace) {
184 this.namespace = namespace;
187 public String getNetwork_plane_type() {
188 return network_plane_type;
191 public void setNetwork_plane_type(String network_plane_type) {
192 this.network_plane_type = network_plane_type;