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 java.util.Date;
25 import javax.xml.bind.annotation.XmlRootElement;
27 import org.onap.dmaap.dbcapi.util.DmaapTimestamp;
32 public class MR_Cluster extends DmaapObject {
34 private String dcaeLocationName;
36 private String[] hosts;
37 private DmaapTimestamp lastMod;
38 private String topicProtocol;
39 private String topicPort;
42 // TODO: make this a system property
43 private static String defaultTopicProtocol = "https";
44 private static String defaultTopicPort = "3905";
50 this.topicProtocol = defaultTopicProtocol;
51 this.topicPort = defaultTopicPort;
52 this.hosts = new String[3];
53 this.lastMod = new DmaapTimestamp();
56 debugLogger.debug( "MR_Cluster constructor " + this.lastMod );
60 public MR_Cluster( String dLN,
64 this.dcaeLocationName = dLN;
66 logger.info( "templog:MR_Cluster at 10" );
67 this.hosts = new String[3];
69 logger.info( "templog:MR_Cluster at 20" );
71 logger.info( "templog:MR_Cluster at 30" );
73 logger.info( "templog:MR_Cluster at 40" );
74 this.topicProtocol = defaultTopicProtocol;
75 logger.info( "templog:MR_Cluster at 50" );
76 this.topicPort = defaultTopicPort;
77 this.lastMod = new DmaapTimestamp();
80 debugLogger.debug( "MR_Cluster constructor w initialization complete" + this.lastMod.getVal() );
81 logger.info( "templog:MR_Cluster at 60" );
84 public String getDcaeLocationName() {
85 return dcaeLocationName;
88 public void setDcaeLocationName(String dcaeLocationName) {
89 this.dcaeLocationName = dcaeLocationName;
92 public String getFqdn() {
96 public void setFqdn(String fqdn) {
100 public String[] getHosts() {
104 public void setHosts(String[] hosts) {
108 public String getTopicProtocol() {
109 return topicProtocol;
112 public void setTopicProtocol(String topicProtocol) {
113 this.topicProtocol = topicProtocol;
116 public String getTopicPort() {
120 public void setTopicPort(String topicPort) {
121 this.topicPort = topicPort;
126 public String genTopicURL(String overideFqdn, String topic) {
128 StringBuilder str = new StringBuilder( topicProtocol );
130 .append( overideFqdn != null ? overideFqdn : fqdn)
136 return str.toString();