1 /*******************************************************************************
2 * Copyright 2017-2018 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 = "";
30 private String url = "";
33 private String protocol = "";
34 // 0: External 1: Internal
35 private String visualRange = "1";
37 private String lb_policy = "";
39 private String path = "";
43 private List<KeyVaulePair> metadata;
45 private boolean enable_ssl = false;
48 * @return the enable_ssl
50 public boolean isEnable_ssl() {
55 * @param enable_ssl the enable_ssl to set
57 public void setEnable_ssl(boolean enable_ssl) {
58 this.enable_ssl = enable_ssl;
61 public String getPath() {
66 * The customized publish path of this service. If this parameter is specified when registering
67 * the service, the service will be published to api gateway under this path. Otherwise, the
68 * service will be published to api gateway using a fixed format: api/{serviceName} /{version}.
69 * Do not specific a path unless you know what you're doing.
73 public void setPath(String path) {
78 * Load balancing method used when MSB routes the service requests. Currently, Round robin and
79 * IP hash are supported.
83 public String getLb_policy() {
88 * Load balancing method used when MSB routes the service requests. Currently, Round robin and
89 * IP hash are supported.
91 * @param lb_policy (round-robin,ip_hash)
94 public void setLb_policy(String lb_policy) {
95 this.lb_policy = lb_policy;
98 public List<KeyVaulePair> getMetadata() {
102 public void setMetadata(List<KeyVaulePair> metadata) {
103 this.metadata = metadata;
107 * The service instance nodes
109 public Set<T> getNodes() {
114 * The service instance nodes
119 public void setNodes(Set<T> nodes) {
124 * An unique name of the service, it should be constant so the service consumer can access the
127 public String getServiceName() {
132 * An unique name of the service, it should be constant so the service consumer can access the
137 public void setServiceName(String serviceName) {
138 this.serviceName = serviceName;
142 * Service version. Only the major version of service is used in the URI.
146 public String getVersion() {
151 * Service version. Only the major version of service is used in the URI.
155 public void setVersion(String version) {
156 this.version = version;
160 * The actual URL of the service to be registered.
164 public String getUrl() {
169 * The actual URL of the service to be registered.
174 public void setUrl(String url) {
179 * supported protocols: 'REST', 'UI'
183 public String getProtocol() {
188 * supported protocols: 'REST', 'UI'
192 public void setProtocol(String protocol) {
193 this.protocol = protocol;
197 * Visibility of the service. External(can be accessed by external systems):0 Internal(can only
198 * be accessed by ONAP microservices):1
200 public String getVisualRange() {
205 * Visibility of the service. External(can be accessed by external systems):0 Internal(can only
206 * be accessed by ONAP microservices):1
210 public void setVisualRange(String visualRange) {
211 this.visualRange = visualRange;