2 * ===============================LICENSE_START======================================
4 * ================================================================================
5 * Copyright © 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.dcae.apod.analytics.cdap.plugins.domain.config.dmaap;
23 import co.cask.cdap.api.annotation.Description;
24 import co.cask.cdap.api.annotation.Macro;
25 import com.google.common.base.Objects;
26 import org.onap.dcae.apod.analytics.cdap.common.settings.CDAPBasePluginConfig;
28 import javax.annotation.Nullable;
31 * Base class for all DMaaP MR Configs
33 * @author Rajiv Singla . Creation Date: 1/17/2017.
35 public abstract class BaseDMaaPMRPluginConfig extends CDAPBasePluginConfig {
37 @Description("DMaaP Message Router HostName")
39 protected String hostName;
41 @Description("DMaaP Message Router Host Port number. Defaults to Port 80")
44 protected Integer portNumber;
46 @Description("DMaaP Message Router Topic Name")
48 protected String topicName;
50 @Description("DMaaP Message Router HTTP Protocol e.g. HTTP or HTTPS. Defaults to HTTPS")
53 protected String protocol;
55 @Description("DMaaP Message Router User Name used for AAF Authentication. Defaults to no authentication")
58 protected String userName;
60 @Description("DMaaP Message Router User Password used for AAF Authentication. Defaults to no authentication")
63 protected String userPassword;
65 @Description("DMaaP Message Router Content Type. Defaults to 'application/json'")
68 protected String contentType;
71 public BaseDMaaPMRPluginConfig(final String referenceName, final String hostName, final String topicName) {
72 this.referenceName = referenceName;
73 this.hostName = hostName;
74 this.topicName = topicName;
78 * Host Name for DMaaP MR Publisher or Subscriber
82 public String getHostName() {
87 * Port Number for DMaaP MR Publisher or Subscriber
92 public Integer getPortNumber() {
97 * DMaaP MR Topic Name for Subscriber or Publisher
101 public String getTopicName() {
107 * DMaaP MR HTTP or HTTPS protocol
109 * @return http or https protocol
112 public String getProtocol() {
117 * User name used for DMaaP MR AAF Authentication
119 * @return User name for DMaaP MR AAF Authentication
122 public String getUserName() {
127 * User password used for DMaaP MR AAF Authentication
129 * @return User password used for DMaaP MR AAF Authentication
132 public String getUserPassword() {
137 * Content type used for DMaaP MR Topic e.g. 'application/json'
139 * @return content type for DMaaP MR Topic
142 public String getContentType() {
147 public String toString() {
148 return Objects.toStringHelper(this)
149 .add("referenceName", referenceName)
150 .add("hostName", hostName)
151 .add("portNumber", portNumber)
152 .add("topicName", topicName)
153 .add("protocol", protocol)
154 .add("userName", userName)
155 .add("userPassword", "xxxx")
156 .add("contentType", contentType)