2 * Copyright 2023 ZTE Corporation.
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.
17 package org.onap.holmes.common.msb.entity;
19 import java.io.Serializable;
20 import java.util.Iterator;
22 public class MicroServiceInfo extends Service<Node> implements Serializable {
23 private static final long serialVersionUID = 1L;
25 public MicroServiceInfo() {
28 public String toString() {
29 StringBuilder buf = new StringBuilder();
30 buf.append("MicroService List:").append("\r\n");
31 buf.append("serviceName:").append(this.getServiceName()).append("\r\n");
32 buf.append("version:").append(this.getVersion()).append("\r\n");
33 buf.append("url:").append(this.getUrl()).append("\r\n");
34 buf.append("protocol:").append(this.getProtocol()).append("\r\n");
35 buf.append("visualRange:").append(this.getVisualRange()).append("\r\n");
36 buf.append("enable_ssl:").append(this.isEnable_ssl()).append("\r\n");
37 buf.append("nodes:").append("\r\n");
38 Iterator nodes = this.getNodes().iterator();
40 while (nodes.hasNext()) {
41 Node nodeInstace = (Node) nodes.next();
42 buf.append(" ip-").append(nodeInstace.getIp()).append("\r\n");
43 buf.append(" port-").append(nodeInstace.getPort()).append("\r\n");
44 buf.append(" ttl-").append(nodeInstace.getTtl()).append("\r\n");
47 return buf.toString();