aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java81
-rw-r--r--src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceInfo.java42
2 files changed, 51 insertions, 72 deletions
diff --git a/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java b/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java
index e874962..58d9c81 100644
--- a/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java
+++ b/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceFullInfo.java
@@ -20,59 +20,48 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class MicroServiceFullInfo extends Service<NodeInfo> implements Serializable {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- private Set<NodeInfo> nodes;
+ // Reserved
+ private String status = "1";
- //Reserved
- private String status = "1";
-
- public Set<NodeInfo> getNodes() {
- return nodes;
- }
-
- public void setNodes(Set<NodeInfo> nodes) {
- this.nodes = nodes;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
+ public String getStatus() {
+ return status;
+ }
+ public void setStatus(String status) {
+ this.status = status;
+ }
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append("MicroService List:").append("\r\n");;
- buf.append("serviceName:").append(getServiceName()).append("\r\n");
- buf.append("version:").append(getVersion()).append("\r\n");
- buf.append("url:").append(getUrl()).append("\r\n");
- buf.append("protocol:").append(getProtocol()).append("\r\n");
- buf.append("visualRange:").append(getVisualRange()).append("\r\n");
- buf.append("nodes:").append("\r\n");
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("MicroService List:").append("\r\n");;
+ buf.append("serviceName:").append(getServiceName()).append("\r\n");
+ buf.append("version:").append(getVersion()).append("\r\n");
+ buf.append("url:").append(getUrl()).append("\r\n");
+ buf.append("protocol:").append(getProtocol()).append("\r\n");
+ buf.append("visualRange:").append(getVisualRange()).append("\r\n");
+ buf.append("nodes:").append("\r\n");
- for (NodeInfo nodeInstace : this.nodes) {
- buf.append(" nodeId-").append(nodeInstace.getNodeId()).append("\r\n");
- buf.append(" ip-").append(nodeInstace.getIp()).append("\r\n");
- buf.append(" port-").append(nodeInstace.getPort()).append("\r\n");
- buf.append(" ttl-").append(nodeInstace.getTtl()).append("\r\n");
- buf.append(" Created_at-").append(nodeInstace.getCreated_at()).append("\r\n");
- buf.append(" Updated_at-").append(nodeInstace.getUpdated_at()).append("\r\n");
- buf.append(" Expiration-").append(nodeInstace.getExpiration()).append("\r\n");
- }
- buf.append("metadata:").append("\r\n");
+ for (NodeInfo nodeInstace : this.getNodes()) {
+ buf.append(" nodeId-").append(nodeInstace.getNodeId()).append("\r\n");
+ buf.append(" ip-").append(nodeInstace.getIp()).append("\r\n");
+ buf.append(" port-").append(nodeInstace.getPort()).append("\r\n");
+ buf.append(" ttl-").append(nodeInstace.getTtl()).append("\r\n");
+ buf.append(" Created_at-").append(nodeInstace.getCreated_at()).append("\r\n");
+ buf.append(" Updated_at-").append(nodeInstace.getUpdated_at()).append("\r\n");
+ buf.append(" Expiration-").append(nodeInstace.getExpiration()).append("\r\n");
+ }
+ buf.append("metadata:").append("\r\n");
- if (this.getMetadata() != null && this.getMetadata().size() > 0) {
- for (KeyVaulePair keyVaulePair : this.getMetadata()) {
- buf.append(" key-").append(keyVaulePair.getKey()).append("\r");
- buf.append(" value-").append(keyVaulePair.getValue()).append("\r\n");
+ if (this.getMetadata() != null && this.getMetadata().size() > 0) {
+ for (KeyVaulePair keyVaulePair : this.getMetadata()) {
+ buf.append(" key-").append(keyVaulePair.getKey()).append("\r");
+ buf.append(" value-").append(keyVaulePair.getValue()).append("\r\n");
- }
+ }
+ }
+ return buf.toString();
}
- return buf.toString();
- }
}
diff --git a/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceInfo.java b/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceInfo.java
index 00ffe81..5b44369 100644
--- a/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceInfo.java
+++ b/src/main/java/org/onap/msb/sdk/discovery/entity/MicroServiceInfo.java
@@ -23,33 +23,23 @@ import java.util.Set;
* @date 2016-1-19
*/
public class MicroServiceInfo extends Service<Node> implements Serializable {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- private Set<Node> nodes;
+ public String toString() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("MicroService List:").append("\r\n");;
+ buf.append("serviceName:").append(getServiceName()).append("\r\n");
+ buf.append("version:").append(getVersion()).append("\r\n");
+ buf.append("url:").append(getUrl()).append("\r\n");
+ buf.append("protocol:").append(getProtocol()).append("\r\n");
+ buf.append("visualRange:").append(getVisualRange()).append("\r\n");
+ buf.append("nodes:").append("\r\n");
- public Set<Node> getNodes() {
- return nodes;
- }
-
- public void setNodes(Set<Node> nodes) {
- this.nodes = nodes;
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append("MicroService List:").append("\r\n");;
- buf.append("serviceName:").append(getServiceName()).append("\r\n");
- buf.append("version:").append(getVersion()).append("\r\n");
- buf.append("url:").append(getUrl()).append("\r\n");
- buf.append("protocol:").append(getProtocol()).append("\r\n");
- buf.append("visualRange:").append(getVisualRange()).append("\r\n");
- buf.append("nodes:").append("\r\n");
-
- for (Node nodeInstace : this.nodes) {
- buf.append(" ip-").append(nodeInstace.getIp()).append("\r\n");
- buf.append(" port-").append(nodeInstace.getPort()).append("\r\n");
- buf.append(" ttl-").append(nodeInstace.getTtl()).append("\r\n");
+ for (Node nodeInstace : this.getNodes()) {
+ buf.append(" ip-").append(nodeInstace.getIp()).append("\r\n");
+ buf.append(" port-").append(nodeInstace.getPort()).append("\r\n");
+ buf.append(" ttl-").append(nodeInstace.getTtl()).append("\r\n");
+ }
+ return buf.toString();
}
- return buf.toString();
- }
}