Initial TCA commit into DCAEGEN2
[dcaegen2/analytics/tca.git] / dcae-analytics-cdap-tca / src / main / java / org / openecomp / dcae / apod / analytics / cdap / tca / settings / TCAAppConfig.java
1 /*
2  * ===============================LICENSE_START======================================
3  *  dcae-analytics
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
10  *
11  *          http://www.apache.org/licenses/LICENSE-2.0
12  *
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===========================================
19  */
20
21 package org.openecomp.dcae.apod.analytics.cdap.tca.settings;
22
23 import com.google.common.base.Objects;
24 import org.openecomp.dcae.apod.analytics.cdap.common.CDAPComponentsConstants;
25 import org.openecomp.dcae.apod.analytics.cdap.common.settings.CDAPBaseAppConfig;
26 import org.openecomp.dcae.apod.analytics.common.AnalyticsConstants;
27
28
29 /**
30  * Contains CDAP App Config Settings for TCA Application
31  *
32  * @author Rajiv Singla . Creation Date: 11/2/2016.
33  */
34 public class TCAAppConfig extends CDAPBaseAppConfig {
35
36
37     private static final long serialVersionUID = 1L;
38
39     protected String tcaSubscriberOutputStreamName;
40     protected Integer thresholdCalculatorFlowletInstances;
41
42     protected String tcaVESMessageStatusTableName;
43     protected Integer tcaVESMessageStatusTableTTLSeconds;
44     protected String tcaVESAlertsTableName;
45     protected Integer tcaVESAlertsTableTTLSeconds;
46
47
48     public TCAAppConfig() {
49         appName = CDAPComponentsConstants.TCA_DEFAULT_NAME_APP;
50         appDescription = CDAPComponentsConstants.TCA_DEFAULT_DESCRIPTION_APP;
51         tcaSubscriberOutputStreamName = CDAPComponentsConstants.TCA_DEFAULT_SUBSCRIBER_OUTPUT_NAME_STREAM;
52         thresholdCalculatorFlowletInstances = AnalyticsConstants.TCA_DEFAULT_THRESHOLD_CALCULATOR_FLOWLET_INSTANCES;
53         tcaVESMessageStatusTableName = CDAPComponentsConstants.TCA_DEFAULT_VES_MESSAGE_STATUS_NAME_TABLE;
54         tcaVESMessageStatusTableTTLSeconds = AnalyticsConstants.TCA_DEFAULT_VES_MESSAGE_STATUS_TTL_TABLE;
55         tcaVESAlertsTableName = CDAPComponentsConstants.TCA_DEFAULT_VES_ALERTS_NAME_TABLE;
56         tcaVESAlertsTableTTLSeconds = AnalyticsConstants.TCA_DEFAULT_VES_ALERTS_TTL_TABLE;
57     }
58
59     public String getTcaSubscriberOutputStreamName() {
60         return tcaSubscriberOutputStreamName;
61     }
62
63     public String getTcaVESMessageStatusTableName() {
64         return tcaVESMessageStatusTableName;
65     }
66
67     public Integer getTcaVESMessageStatusTableTTLSeconds() {
68         return tcaVESMessageStatusTableTTLSeconds;
69     }
70
71     public String getTcaVESAlertsTableName() {
72         return tcaVESAlertsTableName;
73     }
74
75     public Integer getTcaVESAlertsTableTTLSeconds() {
76         return tcaVESAlertsTableTTLSeconds;
77     }
78
79     public Integer getThresholdCalculatorFlowletInstances() {
80         return thresholdCalculatorFlowletInstances;
81     }
82
83     @Override
84     public String toString() {
85         return Objects.toStringHelper(this)
86                 .add("appName", appName)
87                 .add("appDescription", appDescription)
88                 .add("tcaSubscriberOutputStreamName", tcaSubscriberOutputStreamName)
89                 .add("thresholdCalculatorFlowletInstances", thresholdCalculatorFlowletInstances)
90                 .add("tcaVESMessageStatusTableName", tcaVESMessageStatusTableName)
91                 .add("tcaVESMessageStatusTableTTLSeconds", tcaVESMessageStatusTableTTLSeconds)
92                 .add("tcaVESAlertsTableName", tcaVESAlertsTableName)
93                 .add("tcaVESAlertsTableTTLSeconds", tcaVESAlertsTableTTLSeconds)
94                 .toString();
95     }
96 }