62a6fab559d22df67aa8ae6cee16dd796158be91
[dcaegen2/analytics/tca.git] / dcae-analytics-common / src / main / java / org / onap / dcae / apod / analytics / common / AnalyticsConstants.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.onap.dcae.apod.analytics.common;
22
23 /**
24  * Contains static variable for all DCAE Components.
25  *
26  * @author Rajiv Singla . Creation Date: 10/21/2016.
27  */
28 public abstract class AnalyticsConstants {
29
30     // ===============  Common Constants for all DCAE Analytics Modules ==================== //
31
32
33     // ===============  DMaaP Constants for all DCAE Analytics Modules ==================== //
34
35     // DMaaP Config Constants
36     public static final Integer DEFAULT_PORT_NUMBER = 80; // default port number
37     public static final String DEFAULT_USER_NAME = null; // default to no username
38     public static final String DEFAULT_USER_PASSWORD = null; // defaults to no userPassword
39     public static final String DEFAULT_PROTOCOL = "https"; // defaults to using https protocol
40     public static final String DEFAULT_CONTENT_TYPE = "application/json";  // defaults to json content type
41
42     public static final String DMAAP_URI_PATH_PREFIX = "/events/";
43     public static final String DMAAP_GROUP_PREFIX = "OpenDCAE-";
44
45     // ================== DMaaP MR Constants ============================== //
46     // Publisher Constants
47     public static final int DEFAULT_PUBLISHER_MAX_BATCH_SIZE = 1; // disable batching by default
48     public static final int DEFAULT_PUBLISHER_MAX_RECOVERY_QUEUE_SIZE = 100000; // default recovery messages size
49     public static final int PUBLISHER_MAX_FLUSH_RETRIES_ON_CLOSE = 5; // number of retries when flushing messages
50     public static final int PUBLISHER_DELAY_MS_ON_RETRIES_ON_CLOSE = 5000; // delay in retrying for flushing messages
51     // Subscriber Constants
52     public static final int DEFAULT_SUBSCRIBER_TIMEOUT_MS = -1;
53     public static final int DEFAULT_SUBSCRIBER_MESSAGE_LIMIT = -1;
54     public static final String DEFAULT_SUBSCRIBER_GROUP_PREFIX = DMAAP_GROUP_PREFIX + "DMaaPSub-";
55     public static final String SUBSCRIBER_TIMEOUT_QUERY_PARAM_NAME = "timeout";
56     public static final String SUBSCRIBER_MSG_LIMIT_QUERY_PARAM_NAME = "limit";
57
58
59     // ================== TCA Constants ============================== //
60
61     // Default subscriber polling interval
62     public static final Integer TCA_DEFAULT_SUBSCRIBER_POLLING_INTERVAL_MS = 30000;
63
64     // Default publisher polling interval
65     public static final Integer TCA_DEFAULT_PUBLISHER_POLLING_INTERVAL_MS = 30000;
66
67     // Default publisher max batch queue size determines the minimum number of messages that need to be published in
68     // batch mode
69     public static final Integer TCA_DEFAULT_PUBLISHER_MAX_BATCH_QUEUE_SIZE = 10;
70
71     // Default publisher max recovery queue size determines max number of messages can be cached in memory
72     // in case publisher is not responding
73     public static final Integer TCA_DEFAULT_PUBLISHER_MAX_RECOVERY_QUEUE_SIZE = 100000;
74
75     // Default interval during which TCA DMaaP Worker checks if scheduler is shut down
76     public static final Integer TCA_DEFAULT_WORKER_SHUTDOWN_CHECK_INTERVAL_MS = 5000;
77
78     // ***** TCA Quartz Scheduler Settings ******//
79
80     public static final String TCA_QUARTZ_SUBSCRIBER_PROPERTIES_FILE_NAME = "quartz-subscriber.properties";
81
82     public static final String TCA_QUARTZ_PUBLISHER_PROPERTIES_FILE_NAME = "quartz-publisher.properties";
83
84     // TCA Quartz Group Settings
85     public static final String TCA_QUARTZ_GROUP_NAME = "TCAQuartzGroup";
86     // TCA Quartz Trigger Settings
87     public static final String TCA_DMAAP_SUBSCRIBER_QUARTZ_TRIGGER_NAME = "TCADMaaPSubscriberTrigger";
88     public static final String TCA_DMAAP_PUBLISHER_QUARTZ_TRIGGER_NAME = "TCADMaaPPublisherTrigger";
89
90     // TCA Quartz DMaaP Subscriber Job Settings
91     public static final String TCA_DMAAP_SUBSCRIBER_QUARTZ_JOB_NAME = "TCADMaaPSubscriberJob";
92     public static final String TCA_DMAAP_PUBLISHER_QUARTZ_JOB_NAME = "TCADMaaPPublisherJob";
93
94     // TCA Quartz Publisher and Subscriber Job Parameters
95     // Common Job parameters for both Publisher and Subscriber
96     public static final String WORKER_CONTEXT_VARIABLE_NAME = "WORKER_CONTEXT";
97     public static final String DMAAP_METRICS_VARIABLE_NAME = "DMAAP_METRICS";
98     // TCA Quartz DMaaP Subscriber Job Parameter Settings
99     public static final String CDAP_STREAM_VARIABLE_NAME = "CDAP_STREAM_NAME";
100     public static final String DMAAP_SUBSCRIBER_VARIABLE_NAME = "DMAAP_SUBSCRIBER";
101     // TCA Quartz DMaaP Publisher Job Parameter Settings
102     public static final String CDAP_ALERTS_TABLE_VARIABLE_NAME = "CDAP_TCA_ALERTS_TABLE_NAME";
103     public static final String DMAAP_PUBLISHER_VARIABLE_NAME = "DMAAP_PUBLISHER";
104
105     // TCA VES Response Constants
106     // VNF Constants
107     public static final String TCA_VES_RESPONSE_VNF_TARGET_TYPE = "VNF";
108     public static final String AAI_VNF_KEY_PREFIX = "generic-vnf.";
109     public static final String TCA_VES_RESPONSE_VNF_TARGET = AAI_VNF_KEY_PREFIX + "vnf-name";
110     // VM Constants
111     public static final String TCA_VES_RESPONSE_VM_TARGET_TYPE = "VM";
112     public static final String AAI_VSERVER_KEY_PREFIX = "vserver.";
113     public static final String TCA_VES_RESPONSE_VM_TARGET =  AAI_VSERVER_KEY_PREFIX + "vserver-name";
114     // VNF & VM - Common Constants
115     public static final String TCA_VES_RESPONSE_FROM = "DCAE";
116
117     // TCA VES Message Router Partition Key
118     public static final String TCA_VES_MESSAGE_ROUTER_PARTITION_KEY = "VESMessageHash";
119
120     /**
121      * Default Number of instances for Threshold violation calculator flowlet
122      */
123     public static final Integer TCA_DEFAULT_THRESHOLD_CALCULATOR_FLOWLET_INSTANCES = 2;
124
125     /**
126      * Default TTL for TCA VES Message status table which contain status of all messages processed by TCA
127      */
128     public static final Integer TCA_DEFAULT_VES_MESSAGE_STATUS_TTL_TABLE = 60 * 60 * 24 * 10; // 10 Days
129
130     /**
131      * Default TTL for TCA VES Alerts table which contains alerts that can be send to downstream systems
132      */
133     public static final Integer TCA_DEFAULT_VES_ALERTS_TTL_TABLE = 60 * 60 * 24 * 30; // 30 Days
134
135
136     /**
137      * Default TTL for TCA Alerts abatement table which contains information to send out abated alerts
138      */
139     public static final Integer TCA_DEFAULT_ALERTS_ABATEMENT_TTL_TABLE = 60 * 60 * 24 * 30; // 30 Days
140
141
142     // TCA Policy Runtime Argument Paths
143     public static final String TCA_POLICY_DELIMITER = ".";
144     public static final String TCA_POLICY_DOMAIN_PATH = "domain";
145     public static final String TCA_POLICY_METRICS_PER_FUNCTIONAL_ROLE_PATH = "configuration.metricsPerEventName";
146     public static final String TCA_POLICY_THRESHOLDS_PATH_POSTFIX = "thresholds";
147
148     public static final String TCA_POLICY_JSON_KEY = "tca_policy";
149     public static final String TCA_POLICY_STRING_DELIMITER = "\"";
150
151     // TCA Alert output format by default is not CEF
152     public static final Boolean TCA_DEFAULT_ENABLE_CEF_FORMATTED_ALERT = false;
153
154     // TCA A&AI Enrichment is disabled by default
155     public static final Boolean TCA_DEFAULT_ENABLE_AAI_ENRICHMENT = false;
156     // TCA A&AI SSL Certificate errors by default are *NOT* ignored
157     public static final Boolean TCA_DEFAULT_AAI_ENRICHMENT_IGNORE_SSL_CERTIFICATE_ERRORS = false;
158     // TCA A&AI proxy is disabled by default
159     public static final String TCA_DEFAULT_AAI_ENRICHMENT_PROXY_URL = null;
160
161
162
163     private AnalyticsConstants() {
164
165     }
166
167 }