2 * ===============================LICENSE_START======================================
\r
4 * ================================================================================
\r
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============================LICENSE_END===========================================
\r
21 package org.openecomp.dcae.apod.analytics.cdap.plugins.domain.config.dmaap;
\r
23 import co.cask.cdap.api.annotation.Description;
\r
24 import co.cask.cdap.api.annotation.Macro;
\r
25 import com.google.common.base.Objects;
\r
26 import org.openecomp.dcae.apod.analytics.cdap.common.settings.CDAPBasePluginConfig;
\r
28 import javax.annotation.Nullable;
\r
31 * Base class for all DMaaP MR Configs
\r
33 * @author Rajiv Singla . Creation Date: 1/17/2017.
\r
35 public abstract class BaseDMaaPMRPluginConfig extends CDAPBasePluginConfig {
\r
37 @Description("DMaaP Message Router HostName")
\r
39 protected String hostName;
\r
41 @Description("DMaaP Message Router Host Port number. Defaults to Port 80")
\r
44 protected Integer portNumber;
\r
46 @Description("DMaaP Message Router Topic Name")
\r
48 protected String topicName;
\r
50 @Description("DMaaP Message Router HTTP Protocol e.g. HTTP or HTTPS. Defaults to HTTPS")
\r
53 protected String protocol;
\r
55 @Description("DMaaP Message Router User Name used for AAF Authentication. Defaults to no authentication")
\r
58 protected String userName;
\r
60 @Description("DMaaP Message Router User Password used for AAF Authentication. Defaults to no authentication")
\r
63 protected String userPassword;
\r
65 @Description("DMaaP Message Router Content Type. Defaults to 'application/json'")
\r
68 protected String contentType;
\r
71 public BaseDMaaPMRPluginConfig(final String referenceName, final String hostName, final String topicName) {
\r
72 this.referenceName = referenceName;
\r
73 this.hostName = hostName;
\r
74 this.topicName = topicName;
\r
78 * Host Name for DMaaP MR Publisher or Subscriber
\r
82 public String getHostName() {
\r
87 * Port Number for DMaaP MR Publisher or Subscriber
\r
89 * @return port number
\r
92 public Integer getPortNumber() {
\r
97 * DMaaP MR Topic Name for Subscriber or Publisher
\r
99 * @return topic name
\r
101 public String getTopicName() {
\r
107 * DMaaP MR HTTP or HTTPS protocol
\r
109 * @return http or https protocol
\r
112 public String getProtocol() {
\r
117 * User name used for DMaaP MR AAF Authentication
\r
119 * @return User name for DMaaP MR AAF Authentication
\r
122 public String getUserName() {
\r
127 * User password used for DMaaP MR AAF Authentication
\r
129 * @return User password used for DMaaP MR AAF Authentication
\r
132 public String getUserPassword() {
\r
133 return userPassword;
\r
137 * Content type used for DMaaP MR Topic e.g. 'application/json'
\r
139 * @return content type for DMaaP MR Topic
\r
142 public String getContentType() {
\r
143 return contentType;
\r
147 public String toString() {
\r
148 return Objects.toStringHelper(this)
\r
149 .add("referenceName", referenceName)
\r
150 .add("hostName", hostName)
\r
151 .add("portNumber", portNumber)
\r
152 .add("topicName", topicName)
\r
153 .add("protocol", protocol)
\r
154 .add("userName", userName)
\r
155 .add("userPassword", "xxxx")
\r
156 .add("contentType", contentType)
\r