d3e966b643784e7dad7684b1d218550eda012757
[dcaegen2/analytics/tca.git] /
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 \r
27 import javax.annotation.Nullable;\r
28 \r
29 /**\r
30  * DMaaP MR Subscriber Config\r
31  * <p>\r
32  * @author Rajiv Singla . Creation Date: 1/17/2017.\r
33  */\r
34 public class DMaaPMRSourcePluginConfig extends BaseDMaaPMRPluginConfig {\r
35 \r
36     private static final long serialVersionUID = 1L;\r
37 \r
38     @Description("DMaaP MR Polling Interval in MS")\r
39     @Macro\r
40     protected Integer pollingInterval;\r
41 \r
42     @Description("DMaaP Message Router Subscriber Consumer ID. Defaults to some randomly created userID")\r
43     @Nullable\r
44     @Macro\r
45     protected String consumerId;\r
46 \r
47     @Description("DMaaP Message Router Subscriber Consumer Group. Defaults to some randomly created user Group")\r
48     @Nullable\r
49     @Macro\r
50     protected String consumerGroup;\r
51 \r
52     @Description("DMaaP Message Router Subscriber Timeout in MS. Defaults to no timeout")\r
53     @Nullable\r
54     @Macro\r
55     protected Integer timeoutMS;\r
56 \r
57     @Description("DMaaP Message Router Subscriber Message Limit. Defaults to no message limit")\r
58     @Nullable\r
59     @Macro\r
60     protected Integer messageLimit;\r
61 \r
62     // Required No Arg constructor\r
63     public DMaaPMRSourcePluginConfig() {\r
64         this(null, null, null, 0);\r
65     }\r
66 \r
67     public DMaaPMRSourcePluginConfig(String referenceName, String hostName, String topicName, Integer pollingInterval) {\r
68         super(referenceName, hostName, topicName);\r
69         this.pollingInterval = pollingInterval;\r
70     }\r
71 \r
72     /**\r
73      * DMaaP MR Subscriber Polling interval\r
74      *\r
75      * @return DMaaP MR Subscriber Polling interval\r
76      */\r
77     public Integer getPollingInterval() {\r
78         return pollingInterval;\r
79     }\r
80 \r
81     /**\r
82      * DMaaP MR Subscriber Consumer ID\r
83      *\r
84      * @return DMaaP MR Subscriber Consumer ID\r
85      */\r
86     @Nullable\r
87     public String getConsumerId() {\r
88         return consumerId;\r
89     }\r
90 \r
91     /**\r
92      * DMaaP MR Subscriber Consumer Group\r
93      *\r
94      * @return DMaaP MR Subscriber Consumer Group\r
95      */\r
96     @Nullable\r
97     public String getConsumerGroup() {\r
98         return consumerGroup;\r
99     }\r
100 \r
101     /**\r
102      * DMaaP MR Subscriber Timeout in MS\r
103      *\r
104      * @return DMaaP MR Subscriber Timeout in MS\r
105      */\r
106     @Nullable\r
107     public Integer getTimeoutMS() {\r
108         return timeoutMS;\r
109     }\r
110 \r
111     /**\r
112      * DMaaP MR Subscriber message limit\r
113      *\r
114      * @return DMaaP MR Subscriber Message limit\r
115      */\r
116     @Nullable\r
117     public Integer getMessageLimit() {\r
118         return messageLimit;\r
119     }\r
120 \r
121 \r
122     @Override\r
123     public String toString() {\r
124         return Objects.toStringHelper(this)\r
125                 .add("super", super.toString())\r
126                 .add("pollingInterval", pollingInterval)\r
127                 .add("consumerId", consumerId)\r
128                 .add("consumerGroup", consumerGroup)\r
129                 .add("timeoutMS", timeoutMS)\r
130                 .add("messageLimit", messageLimit)\r
131                 .toString();\r
132     }\r
133 \r
134 }\r