1 /*******************************************************************************
2 * Copyright 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
13 ******************************************************************************/
14 package org.onap.msb.sdk.discovery.entity;
16 import java.io.Serializable;
17 import java.util.List;
20 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
22 @JsonIgnoreProperties(ignoreUnknown = true)
23 public class Service<T> implements Serializable {
24 private static final long serialVersionUID = 1L;
26 private String serviceName;
28 private String version = "";
29 // 服务url (格式:url地址以/开头,不能以/结尾)
30 private String url = "";
31 // 服务对应协议,比如REST、UI、HTTP、MQ、FTP、SNMP、TCP、UDP
32 private String protocol = "";
33 // 服务的可见范围 0:系统间 1:系统内
34 private String visualRange = "1";
37 private String lb_policy = "";
40 private String host = "";
42 private String path = "";
47 private List<KeyVaulePair> metadata;
49 public String getHost() {
53 public void setHost(String host) {
57 public String getPath() {
61 public void setPath(String path) {
65 public String getLb_policy() {
71 * @Description TODO(针对协议为TCP或UDP的服务选择负载均衡策略)
72 * @param lb_policy (可选策略:round-robin,ip_hash)
75 public void setLb_policy(String lb_policy) {
76 this.lb_policy = lb_policy;
79 public List<KeyVaulePair> getMetadata() {
85 * @Description TODO(配置服务特有的附加属性键值对)
89 public void setMetadata(List<KeyVaulePair> metadata) {
90 this.metadata = metadata;
93 public Set<T> getNodes() {
99 * @Description TODO(配置服务的服务器实例列表)
103 public void setNodes(Set<T> nodes) {
107 public String getServiceName() {
113 * @Title setServiceName
114 * @Description TODO(服务名[必填])
118 public void setServiceName(String serviceName) {
119 this.serviceName = serviceName;
122 public String getVersion() {
129 * @Description TODO(版本号 ( 格式:v(小写)+数字))
133 public void setVersion(String version) {
134 this.version = version;
137 public String getUrl() {
143 * @Description TODO(目标服务URL地址 (格式:url地址以/开头,不能以/结尾))
147 public void setUrl(String url) {
151 public String getProtocol() {
157 * @Description TODO(服务对应协议,比如REST、MQ、FTP、SNMP[必填])
161 public void setProtocol(String protocol) {
162 this.protocol = protocol;
166 public String getVisualRange() {
171 * @Title setVisualRange
172 * @Description TODO(服务的可见范围 系统间:0 系统内:1 ,多个可见范围用 "|"分隔,如"0|1" )
176 public void setVisualRange(String visualRange) {
177 this.visualRange = visualRange;