cb6653caf4c26b70592022ddb7d2cb32a508f5db
[dmaap/messagerouter/msgrtr.git] / src / main / java / com / att / dmf / mr / constants / CambriaConstants.java
1 /*******************************************************************************
2  *  ============LICENSE_START=======================================================
3  *  org.onap.dmaap
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  *        http://www.apache.org/licenses/LICENSE-2.0
11 *  
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  *  ============LICENSE_END=========================================================
18  *  
19  *  ECOMP is a trademark and service mark of AT&T Intellectual Property.
20  *  
21  *******************************************************************************/
22 package com.att.dmf.mr.constants;
23
24 import com.att.dmf.mr.utils.Utils;
25
26 /**
27  * This is the constant files for all the property or parameters.
28  * @author nilanjana.maity
29  *
30  */
31 public interface CambriaConstants {
32
33         String CAMBRIA = "Cambria";
34         String DMAAP = "DMaaP";
35
36         String kDefault_ZkRoot = "/fe3c/cambria";
37
38         String kSetting_ZkConfigDbRoot = "config.zk.root";
39         String kDefault_ZkConfigDbRoot = kDefault_ZkRoot + "/config";
40 String msgRtr_prop="MsgRtrApi.properties";
41         String kBrokerType = "broker.type";
42         
43         /**
44          * value to use to signal kafka broker type.
45          */
46         String kBrokerType_Kafka = "kafka";
47         String kBrokerType_Memory = "memory";
48         String kSetting_AdminSecret = "authentication.adminSecret";
49
50         String kSetting_ApiNodeIdentifier = "cambria.api.node.identifier";
51
52         /**
53          * value to use to signal max empty poll per minute
54          */
55         String kSetting_MaxEmptyPollsPerMinute = "cambria.rateLimit.maxEmptyPollsPerMinute";
56         String kSetting_MaxPollsPerMinute = "cambria.rateLimit.maxEmptyPollsPerMinute";
57         double kDefault_MaxEmptyPollsPerMinute = 10.0;
58
59         String kSetting_SleepMsOnRateLimit = "cambria.rateLimit.delay.ms";
60         String kSetting_SleepMsRealOnRateLimit = "cambria.rateLimitActual.delay.ms";
61         long kDefault_SleepMsOnRateLimit = Utils.getSleepMsForRate ( kDefault_MaxEmptyPollsPerMinute );
62
63         String kSetting_RateLimitWindowLength = "cambria.rateLimit.window.minutes";
64         int kDefault_RateLimitWindowLength = 5;
65
66         String kConfig = "c";
67
68         String kSetting_Port = "cambria.service.port";
69         /**
70          * value to use to signal default port
71          */
72         int kDefault_Port = 3904;
73
74         String kSetting_MaxThreads = "tomcat.maxthreads";
75         int kDefault_MaxThreads = -1;
76         
77         
78         
79         //String kDefault_TomcatProtocolClass = Http11NioProtocol.class.getName ();
80
81         String kSetting_ZkConfigDbServers = "config.zk.servers";
82         
83         /**
84          * value to indicate localhost port number
85          */
86         String kDefault_ZkConfigDbServers = "localhost:2181";
87
88         /**
89          * value to use to signal Session time out
90          */
91         String kSetting_ZkSessionTimeoutMs = "cambria.consumer.cache.zkSessionTimeout";
92         int kDefault_ZkSessionTimeoutMs = 20 * 1000;
93
94         /**
95          * value to use to signal connection time out 
96          */
97         String kSetting_ZkConnectionTimeoutMs = "cambria.consumer.cache.zkConnectionTimeout";
98         int kDefault_ZkConnectionTimeoutMs = 5 * 1000;
99
100         String TRANSACTION_ID_SEPARATOR = "::";
101
102         /**
103          * value to use to signal there's no timeout on the consumer request.
104          */
105         public static final int kNoTimeout = 10000;
106
107         /**
108          * value to use to signal no limit in the number of messages returned.
109          */
110         public static final int kNoLimit = 0;
111
112         /**
113          * value to use to signal that the caller wants the next set of events
114          */
115         public static final int kNextOffset = -1;
116
117         /**
118          * value to use to signal there's no filter on the response stream.
119          */
120         public static final String kNoFilter = "";
121
122         //Added for Metric publish
123         public static final int kStdCambriaServicePort = 3904;
124         public static final String kBasePath = "/events/";
125
126 }