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 MicroServiceFullInfo extends Service<NodeInfo> implements Serializable {
23 private static final long serialVersionUID = 1L;
24 private String status = "1";
26 public MicroServiceFullInfo() {
29 public String getStatus() {
33 public void setStatus(String status) {
37 public String toString() {
38 StringBuffer buf = new StringBuffer();
39 buf.append("MicroService List:").append("\r\n");
40 buf.append("serviceName:").append(this.getServiceName()).append("\r\n");
41 buf.append("version:").append(this.getVersion()).append("\r\n");
42 buf.append("url:").append(this.getUrl()).append("\r\n");
43 buf.append("protocol:").append(this.getProtocol()).append("\r\n");
44 buf.append("visualRange:").append(this.getVisualRange()).append("\r\n");
45 buf.append("nodes:").append("\r\n");
46 Iterator nodes = this.getNodes().iterator();
48 while (nodes.hasNext()) {
49 NodeInfo nodeInstace = (NodeInfo) nodes.next();
50 buf.append(" nodeId-").append(nodeInstace.getNodeId()).append("\r\n");
51 buf.append(" ip-").append(nodeInstace.getIp()).append("\r\n");
52 buf.append(" port-").append(nodeInstace.getPort()).append("\r\n");
53 buf.append(" ttl-").append(nodeInstace.getTtl()).append("\r\n");
54 buf.append(" Created_at-").append(nodeInstace.getCreated_at()).append("\r\n");
55 buf.append(" Updated_at-").append(nodeInstace.getUpdated_at()).append("\r\n");
56 buf.append(" Expiration-").append(nodeInstace.getExpiration()).append("\r\n");
59 buf.append("metadata:").append("\r\n");
60 if (this.getMetadata() != null && this.getMetadata().size() > 0) {
61 nodes = this.getMetadata().iterator();
62 while (nodes.hasNext()) {
63 KeyValuePair keyValuePair = (KeyValuePair) nodes.next();
64 buf.append(" key-").append(keyValuePair.getKey()).append("\r\n");
65 buf.append(" value-").append(keyValuePair.getValue()).append("\r\n");
69 return buf.toString();