2 * Copyright 2016-2017 ZTE, Inc. and others.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 * in compliance with the License. You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software distributed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 * or implied. See the License for the specific language governing permissions and limitations under
14 package org.onap.msb.sdclient.core;
16 import java.io.Serializable;
17 import java.util.List;
20 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
22 import io.swagger.annotations.ApiModelProperty;
25 @JsonIgnoreProperties(ignoreUnknown = true)
26 public class Service<T> implements Serializable {
27 private static final long serialVersionUID = 1L;
29 @ApiModelProperty(example = "test", required = true)
30 private String serviceName = "";
32 @ApiModelProperty(example = "v1", required = true)
33 private String version = "";
35 @ApiModelProperty(value = "Target Service URL,start with /", example = "/api/serviceName/v1", required = true)
36 private String url = "";
38 // 服务对应协议,比如REST、UI、MQ、FTP、SNMP、TCP、UDP
39 @ApiModelProperty(value = "Service Protocol", allowableValues = "REST,UI, HTTP, TCP,UDP", example = "HTTP",
41 private String protocol = "";
43 // 服务的可见范围 0:系统间 1:系统内 ,可配置多个,以 |分隔
44 @ApiModelProperty(value = "[visual Range]interSystem:0,inSystem:1", allowableValues = "0,1", example = "1")
45 private String visualRange = "1";
48 @ApiModelProperty(value = "lb policy", allowableValues = "round-robin,ip_hash", example = "ip_hash")
49 private String lb_policy;
52 @ApiModelProperty(hidden = true)
53 private String publish_port;
56 private String namespace = "";
59 @ApiModelProperty(hidden = true)
60 private String network_plane_type;
62 @ApiModelProperty(hidden = true)
63 private String host = "";
65 @ApiModelProperty(hidden = true)
66 private String path = "";
68 @ApiModelProperty(value = "enable ssl", allowableValues = "true,false", example = "false")
69 private boolean enable_ssl = false; // true:https:开启SSL加密, false:http
72 @ApiModelProperty(required = true)
76 private List<KeyVaulePair> metadata;
79 @ApiModelProperty(value = "custom labels", example = "key1:value1")
80 private List<String> labels;
84 public String getHost() {
88 public void setHost(String host) {
92 public String getPath() {
96 public void setPath(String path) {
100 public List<String> getLabels() {
104 public void setLabels(List<String> labels) {
105 this.labels = labels;
108 public Set<T> getNodes() {
112 public void setNodes(Set<T> nodes) {
116 public String getServiceName() {
120 public void setServiceName(String serviceName) {
121 this.serviceName = serviceName;
124 public String getVersion() {
128 public void setVersion(String version) {
129 this.version = version;
132 public String getUrl() {
136 public void setUrl(String url) {
140 public String getProtocol() {
144 public void setProtocol(String protocol) {
145 this.protocol = protocol;
150 public List<KeyVaulePair> getMetadata() {
154 public void setMetadata(List<KeyVaulePair> metadata) {
155 this.metadata = metadata;
159 public String getVisualRange() {
163 public void setVisualRange(String visualRange) {
164 this.visualRange = visualRange;
167 public String getLb_policy() {
171 public void setLb_policy(String lb_policy) {
172 this.lb_policy = lb_policy;
175 public String getPublish_port() {
179 public void setPublish_port(String publish_port) {
180 this.publish_port = publish_port;
183 public String getNamespace() {
187 public void setNamespace(String namespace) {
188 this.namespace = namespace;
191 public String getNetwork_plane_type() {
192 return network_plane_type;
195 public void setNetwork_plane_type(String network_plane_type) {
196 this.network_plane_type = network_plane_type;
199 public boolean isEnable_ssl() {
203 public void setEnable_ssl(boolean enable_ssl) {
204 this.enable_ssl = enable_ssl;