X-Git-Url: https://gerrit.onap.org/r/gitweb?p=dmaap%2Fdbcapi.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdbcapi%2Fmodel%2FMR_Cluster.java;h=a6827a9e6f7f49896f4a8a5492275bdcbea49126;hp=79de9ba22b2ff12a3d033e23763fd8d98bfdffee;hb=1c6b5fa580c9b82e17b710dbc4cf9bbce57eb5bc;hpb=d5d37c0477744cbaa6a9d9fc690c0dafbb2d1868 diff --git a/src/main/java/org/onap/dmaap/dbcapi/model/MR_Cluster.java b/src/main/java/org/onap/dmaap/dbcapi/model/MR_Cluster.java index 79de9ba..a6827a9 100644 --- a/src/main/java/org/onap/dmaap/dbcapi/model/MR_Cluster.java +++ b/src/main/java/org/onap/dmaap/dbcapi/model/MR_Cluster.java @@ -31,7 +31,6 @@ public class MR_Cluster extends DmaapObject { private String dcaeLocationName; private String fqdn; - private String[] hosts; private DmaapTimestamp lastMod; private String topicProtocol; private String topicPort; @@ -47,7 +46,6 @@ public class MR_Cluster extends DmaapObject { public MR_Cluster() { this.topicProtocol = defaultTopicProtocol; this.topicPort = defaultTopicPort; - this.hosts = new String[3]; this.lastMod = new DmaapTimestamp(); this.lastMod.mark(); @@ -55,24 +53,33 @@ public class MR_Cluster extends DmaapObject { } + + + // new style constructor public MR_Cluster( String dLN, - String f, - String a, - String[] h ) { + String f, + String prot, + String port ) { this.dcaeLocationName = dLN; this.fqdn = f; - this.hosts = new String[3]; - this.hosts[0] = h[0]; - this.hosts[1] = h[1]; - this.hosts[2] = h[2]; - this.topicProtocol = defaultTopicProtocol; - this.topicPort = defaultTopicPort; + + if ( prot == null || prot.isEmpty() ) { + this.topicProtocol = defaultTopicProtocol; + } else { + this.topicProtocol = prot; + } + if ( port == null || port.isEmpty() ) { + this.topicPort = defaultTopicPort; + } else { + this.topicPort = port; + } + + this.lastMod = new DmaapTimestamp(); this.lastMod.mark(); - + debugLogger.debug( "MR_Cluster constructor w initialization complete" + this.lastMod.getVal() ); - } - +} public String getDcaeLocationName() { return dcaeLocationName; } @@ -89,13 +96,6 @@ public class MR_Cluster extends DmaapObject { this.fqdn = fqdn; } - public String[] getHosts() { - return hosts; - } - - public void setHosts(String[] hosts) { - this.hosts = hosts; - } public String getTopicProtocol() { return topicProtocol;