2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.dmaap.dbcapi.model;
23 import javax.xml.bind.annotation.XmlRootElement;
25 import org.onap.dmaap.dbcapi.util.DmaapTimestamp;
30 public class MR_Cluster extends DmaapObject {
32 private String dcaeLocationName;
34 private String[] hosts;
35 private DmaapTimestamp lastMod;
36 private String topicProtocol;
37 private String topicPort;
40 // TODO: make this a system property
41 private static String defaultTopicProtocol = "https";
42 private static String defaultTopicPort = "3905";
48 this.topicProtocol = defaultTopicProtocol;
49 this.topicPort = defaultTopicPort;
50 this.hosts = new String[3];
51 this.lastMod = new DmaapTimestamp();
54 debugLogger.debug( "MR_Cluster constructor " + this.lastMod );
58 // Deprecate this constructor
59 public MR_Cluster( String dLN,
63 this.dcaeLocationName = dLN;
65 this.hosts = new String[3];
69 this.topicProtocol = defaultTopicProtocol;
70 this.topicPort = defaultTopicPort;
71 this.lastMod = new DmaapTimestamp();
74 debugLogger.debug( "depracated MR_Cluster constructor w initialization complete" + this.lastMod.getVal() );
77 // new style constructor
78 public MR_Cluster( String dLN,
82 this.dcaeLocationName = dLN;
84 this.hosts = new String[3];
88 this.topicProtocol = prot;
89 this.topicPort = port;
90 this.lastMod = new DmaapTimestamp();
93 debugLogger.debug( "MR_Cluster constructor w initialization complete" + this.lastMod.getVal() );
95 public String getDcaeLocationName() {
96 return dcaeLocationName;
99 public void setDcaeLocationName(String dcaeLocationName) {
100 this.dcaeLocationName = dcaeLocationName;
103 public String getFqdn() {
107 public void setFqdn(String fqdn) {
111 public String[] getHosts() {
115 public void setHosts(String[] hosts) {
119 public String getTopicProtocol() {
120 return topicProtocol;
123 public void setTopicProtocol(String topicProtocol) {
124 this.topicProtocol = topicProtocol;
127 public String getTopicPort() {
131 public void setTopicPort(String topicPort) {
132 this.topicPort = topicPort;
137 public String genTopicURL(String overideFqdn, String topic) {
139 StringBuilder str = new StringBuilder( topicProtocol );
141 .append( overideFqdn != null ? overideFqdn : fqdn)
147 return str.toString();