package org.onap.dmaap.dbcapi.model;
-import java.util.Date;
-
import javax.xml.bind.annotation.XmlRootElement;
+import org.onap.dmaap.dbcapi.util.DmaapTimestamp;
+
@XmlRootElement
private String dcaeLocationName;
private String fqdn;
- private String[] hosts;
- //private DmaapTimestamp lastMod;
+ private DmaapTimestamp lastMod;
private String topicProtocol;
private String topicPort;
public MR_Cluster() {
this.topicProtocol = defaultTopicProtocol;
this.topicPort = defaultTopicPort;
- this.lastMod = new Date();
+ this.lastMod = new DmaapTimestamp();
+ this.lastMod.mark();
debugLogger.debug( "MR_Cluster constructor " + this.lastMod );
}
+
+
+ // 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[0] = h[0];
- this.hosts[1] = h[1];
- this.hosts[2] = h[2];
- this.topicProtocol = defaultTopicProtocol;
- this.topicPort = defaultTopicPort;
-
- debugLogger.debug( "MR_Cluster constructor w initialization complete" + this.lastMod );
- }
+ 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;
}
this.fqdn = fqdn;
}
- public String[] getHosts() {
- return hosts;
- }
-
- public void setHosts(String[] hosts) {
- this.hosts = hosts;
- }
public String getTopicProtocol() {
return topicProtocol;