aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/msb/sdk/discovery/entity/Service.java
blob: a89ded90f764330407c650eb1aa9e2a182892c78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
/*******************************************************************************
 * Copyright 2017 ZTE, Inc. and others.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 ******************************************************************************/
package org.onap.msb.sdk.discovery.entity;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Service<T> implements Serializable {
  private static final long serialVersionUID = 1L;
  // 服务名[必填]
  private String serviceName;
  // 版本号 ( 格式:v(小写)+数字)
  private String version = "";
  // 服务url (格式:url地址以/开头,不能以/结尾)
  private String url = "";
  // 服务对应协议,比如REST、UI、HTTP、MQ、FTP、SNMP、TCP、UDP
  private String protocol = "";
  // 服务的可见范围 0:系统间 1:系统内
  private String visualRange = "1";

  // 负载均衡策略类型
  private String lb_policy = "";


  private String host = "";

  private String path = "";

  private Set<T> nodes;

  // 服务自身属性的键值对
  private List<KeyVaulePair> metadata;

  public String getHost() {
    return host;
  }

  public void setHost(String host) {
    this.host = host;
  }

  public String getPath() {
    return path;
  }

  public void setPath(String path) {
    this.path = path;
  }

  public String getLb_policy() {
    return lb_policy;
  }

  /**
   * @Title setLb_policy
   * @Description TODO(针对协议为TCP或UDP的服务选择负载均衡策略)
   * @param lb_policy (可选策略:round-robin,ip_hash)
   * @return void
   */
  public void setLb_policy(String lb_policy) {
    this.lb_policy = lb_policy;
  }

  public List<KeyVaulePair> getMetadata() {
    return metadata;
  }

  /**
   * @Title setMetadata
   * @Description TODO(配置服务特有的附加属性键值对)
   * @param metadata
   * @return void
   */
  public void setMetadata(List<KeyVaulePair> metadata) {
    this.metadata = metadata;
  }

  public Set<T> getNodes() {
    return nodes;
  }

  /**
   * @Title setNodes
   * @Description TODO(配置服务的服务器实例列表)
   * @param nodes
   * @return void
   */
  public void setNodes(Set<T> nodes) {
    this.nodes = nodes;
  }

  public String getServiceName() {
    return serviceName;
  }

  /**
   * 
   * @Title setServiceName
   * @Description TODO(服务名[必填])
   * @param serviceName
   * @return void
   */
  public void setServiceName(String serviceName) {
    this.serviceName = serviceName;
  }

  public String getVersion() {
    return version;
  }

  /**
   * 
   * @Title setVersion
   * @Description TODO(版本号 ( 格式:v(小写)+数字))
   * @param version
   * @return void
   */
  public void setVersion(String version) {
    this.version = version;
  }

  public String getUrl() {
    return url;
  }

  /**
   * @Title setUrl
   * @Description TODO(目标服务URL地址 (格式:url地址以/开头,不能以/结尾))
   * @param url
   * @return void
   */
  public void setUrl(String url) {
    this.url = url;
  }

  public String getProtocol() {
    return protocol;
  }

  /**
   * @Title setProtocol
   * @Description TODO(服务对应协议,比如REST、MQ、FTP、SNMP[必填])
   * @param protocol
   * @return void
   */
  public void setProtocol(String protocol) {
    this.protocol = protocol;
  }


  public String getVisualRange() {
    return visualRange;
  }

  /**
   * @Title setVisualRange
   * @Description TODO(服务的可见范围 系统间:0 系统内:1 ,多个可见范围用 "|"分隔,如"0|1" )
   * @param visualRange
   * @return void
   */
  public void setVisualRange(String visualRange) {
    this.visualRange = visualRange;
  }

}