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=81850834f98e9ad7a61485cd744bb5c5c050fafe;hb=1c6b5fa580c9b82e17b710dbc4cf9bbce57eb5bc;hpb=ac03a4b32eae987019cec2cd39d6d252fb320c2f 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 8185083..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,7 @@ public class MR_Cluster extends DmaapObject { } - // Deprecate this constructor - public MR_Cluster( String dLN, - String f, - String a, - String[] h ) { - 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; - this.lastMod = new DmaapTimestamp(); - this.lastMod.mark(); - debugLogger.debug( "depracated MR_Cluster constructor w initialization complete" + this.lastMod.getVal() ); - } // new style constructor public MR_Cluster( String dLN, @@ -81,12 +62,19 @@ public class MR_Cluster extends DmaapObject { String port ) { this.dcaeLocationName = dLN; this.fqdn = f; - this.hosts = new String[3]; - this.hosts[0] = fqdn; - this.hosts[1] = fqdn; - this.hosts[2] = fqdn; - this.topicProtocol = prot; - this.topicPort = port; + + 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(); @@ -108,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;