TCA: Support for VES/A&AI enrichment
[dcaegen2/analytics/tca.git] / dcae-analytics-cdap-plugins / src / main / java / org / openecomp / dcae / apod / analytics / cdap / plugins / domain / config / dmaap / BaseDMaaPMRPluginConfig.java
1 /*\r
2  * ===============================LICENSE_START======================================\r
3  *  dcae-analytics\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
10  *\r
11  *          http://www.apache.org/licenses/LICENSE-2.0\r
12  *\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
19  */\r
20 \r
21 package org.openecomp.dcae.apod.analytics.cdap.plugins.domain.config.dmaap;\r
22 \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
27 \r
28 import javax.annotation.Nullable;\r
29 \r
30 /**\r
31  * Base class for all DMaaP MR Configs\r
32  * <p>\r
33  * @author Rajiv Singla . Creation Date: 1/17/2017.\r
34  */\r
35 public abstract class BaseDMaaPMRPluginConfig extends CDAPBasePluginConfig {\r
36 \r
37     @Description("DMaaP Message Router HostName")\r
38     @Macro\r
39     protected String hostName;\r
40 \r
41     @Description("DMaaP Message Router Host Port number. Defaults to Port 80")\r
42     @Nullable\r
43     @Macro\r
44     protected Integer portNumber;\r
45 \r
46     @Description("DMaaP Message Router Topic Name")\r
47     @Macro\r
48     protected String topicName;\r
49 \r
50     @Description("DMaaP Message Router HTTP Protocol e.g. HTTP or HTTPS. Defaults to HTTPS")\r
51     @Nullable\r
52     @Macro\r
53     protected String protocol;\r
54 \r
55     @Description("DMaaP Message Router User Name used for AAF Authentication. Defaults to no authentication")\r
56     @Nullable\r
57     @Macro\r
58     protected String userName;\r
59 \r
60     @Description("DMaaP Message Router User Password used for AAF Authentication. Defaults to no authentication")\r
61     @Nullable\r
62     @Macro\r
63     protected String userPassword;\r
64 \r
65     @Description("DMaaP Message Router Content Type. Defaults to 'application/json'")\r
66     @Nullable\r
67     @Macro\r
68     protected String contentType;\r
69 \r
70 \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
75     }\r
76 \r
77     /**\r
78      * Host Name for DMaaP MR Publisher or Subscriber\r
79      *\r
80      * @return host name\r
81      */\r
82     public String getHostName() {\r
83         return hostName;\r
84     }\r
85 \r
86     /**\r
87      * Port Number for DMaaP MR Publisher or Subscriber\r
88      *\r
89      * @return port number\r
90      */\r
91     @Nullable\r
92     public Integer getPortNumber() {\r
93         return portNumber;\r
94     }\r
95 \r
96     /**\r
97      * DMaaP MR Topic Name for Subscriber or Publisher\r
98      *\r
99      * @return topic name\r
100      */\r
101     public String getTopicName() {\r
102         return topicName;\r
103     }\r
104 \r
105 \r
106     /**\r
107      * DMaaP MR HTTP or HTTPS protocol\r
108      *\r
109      * @return http or https protocol\r
110      */\r
111     @Nullable\r
112     public String getProtocol() {\r
113         return protocol;\r
114     }\r
115 \r
116     /**\r
117      * User name used for DMaaP MR AAF Authentication\r
118      *\r
119      * @return User name for DMaaP MR AAF Authentication\r
120      */\r
121     @Nullable\r
122     public String getUserName() {\r
123         return userName;\r
124     }\r
125 \r
126     /**\r
127      * User password used for DMaaP MR AAF Authentication\r
128      *\r
129      * @return User password used for DMaaP MR AAF Authentication\r
130      */\r
131     @Nullable\r
132     public String getUserPassword() {\r
133         return userPassword;\r
134     }\r
135 \r
136     /**\r
137      * Content type used for DMaaP MR Topic e.g. 'application/json'\r
138      *\r
139      * @return content type for DMaaP MR Topic\r
140      */\r
141     @Nullable\r
142     public String getContentType() {\r
143         return contentType;\r
144     }\r
145 \r
146     @Override\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
157                 .toString();\r
158     }\r
159 }\r