Fixed Concurrent Updates overriding the AAI object
[aai/aai-common.git] / aai-els-onap-logging / src / main / java / org / onap / aai / util / AAIConstants.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  *  Modifications Copyright © 2018 IBM.
8  * ================================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *    http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ============LICENSE_END=========================================================
21  */
22
23 package org.onap.aai.util;
24
25 public final class AAIConstants {
26     private static final String AJSC_HOME = "AJSC_HOME";
27     //
28     //
29     /** Default to unix file separator if system property file.separator is null */
30     public static final String AAI_FILESEP =
31             (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator");
32     //
33     /** Default to opt aai if system property aai.home is null, using file.separator */
34     public static final String AAI_HOME =
35             (System.getProperty(AJSC_HOME) == null) ? AAI_FILESEP + "opt" + AAI_FILESEP + "app" + AAI_FILESEP + "aai"
36                     : System.getProperty(AJSC_HOME);
37     public static final String AAI_BUNDLECONFIG_NAME =
38             (System.getProperty("BUNDLECONFIG_DIR") == null) ? "bundleconfig" : System.getProperty("BUNDLECONFIG_DIR");
39     public static final String AAI_HOME_BUNDLECONFIG = (System.getProperty(AJSC_HOME) == null)
40             ? AAI_FILESEP + "opt" + AAI_FILESEP + "app" + AAI_FILESEP + "aai" + AAI_FILESEP + AAI_BUNDLECONFIG_NAME
41             : System.getProperty(AJSC_HOME) + AAI_FILESEP + AAI_BUNDLECONFIG_NAME;
42
43     /** etc directory, relative to AAI_HOME */
44     public static final String AAI_HOME_ETC = AAI_HOME_BUNDLECONFIG + AAI_FILESEP + "etc" + AAI_FILESEP;
45     public static final String AAI_HOME_ETC_APP_PROPERTIES = AAI_HOME_ETC + "appprops" + AAI_FILESEP;
46     public static final String AAI_HOME_ETC_AUTH = AAI_HOME_ETC + "auth" + AAI_FILESEP;
47     public static final String AAI_CONFIG_FILENAME = AAI_HOME_ETC_APP_PROPERTIES + "aaiconfig.properties";
48     public static final String AAI_AUTH_CONFIG_FILENAME = AAI_HOME_ETC_AUTH + "aai_policy.json";
49     public static final String REALTIME_DB_CONFIG = AAI_HOME_ETC_APP_PROPERTIES + "janusgraph-realtime.properties";
50     public static final String CACHED_DB_CONFIG = AAI_HOME_ETC_APP_PROPERTIES + "janusgraph-cached.properties";
51     public static final String AAI_HOME_ETC_OXM = AAI_HOME_ETC + "oxm" + AAI_FILESEP;
52     public static final String AAI_EVENT_DMAAP_PROPS =
53             AAI_HOME_ETC_APP_PROPERTIES + "aaiEventDMaaPPublisher.properties";
54     public static final String DELTA_EVENT_DMAAP_PROPS =
55             AAI_HOME_ETC_APP_PROPERTIES + "delta-event-publisher.properties";
56     public static final String AAI_HOME_ETC_SCRIPT = AAI_HOME_ETC + AAI_FILESEP + "scriptdata" + AAI_FILESEP;
57
58     public static final String AAI_LOGBACK_PROPS = "logback.xml";
59     public static final String AAI_SCHEMA_MOD_LOGBACK_PROPS = "schemaMod-logback.xml";
60     public static final String AAI_FORCE_DELETE_LOGBACK_PROPS = "forceDelete-logback.xml";
61
62     public static final String AAI_TRUSTSTORE_FILENAME = "aai.truststore.filename";
63     public static final String AAI_TRUSTSTORE_PASSWD = "aai.truststore.passwd";
64     public static final String AAI_KEYSTORE_FILENAME = "aai.keystore.filename";
65     public static final String AAI_KEYSTORE_PASSWD = "aai.keystore.passwd";
66
67     public static final String AAI_SERVER_URL_BASE = "aai.server.url.base";
68     public static final String AAI_SERVER_URL = "aai.server.url";
69     public static final String AAI_OLDSERVER_URL = "aai.oldserver.url";
70     public static final String AAI_LOCAL_REST = "https://localhost:%d/aai/%s/";
71     public static final String AAI_LOCAL_OVERRIDE = "aai.server.localhost.override.url";
72     public static final String AAI_LOCAL_OVERRIDE_DEFAULT = "NA";
73     public static final String AAI_LOCAL_REST_OVERRIDE = "%s/aai/%s/";
74
75     public static final int AAI_RESOURCES_PORT = 8447;
76     public static final int AAI_QUERY_PORT = 8446;
77     public static final int AAI_LEGACY_PORT = 8443;
78
79     public static final String AAI_DEFAULT_API_VERSION = "v10";
80     public static final String AAI_DEFAULT_API_VERSION_PROP = "aai.default.api.version";
81     public static final String AAI_NOTIFICATION_CURRENT_VERSION = "aai.notification.current.version";
82
83     public static final String AAI_NODENAME = "aai.config.nodename";
84
85     /*
86      * Logs the objects being deleted when an client deletes objects via implied delete during PUT operation
87      */
88     public static final String AAI_IMPLIED_DELETE_LOG_ENABLED = "aai.implied.delete.log.enabled";
89     /*
90      * Specifies how many objects maximum to log
91      */
92     public static final String AAI_IMPLIED_DELETE_LOG_LIMIT = "aai.implied.delete.log.limit";
93
94     /**
95      * Specifies which clients should the implied delete be allowed
96      *
97      * If the aaiconfig properties has the below property:
98      *
99      * <code>
100      * aai.implied.delete.whitelist.sdnc=*
101      * aai.implied.delete.whitelist.sdc='pserver','vserver'
102      * </code>
103      *
104      * Then SDNC can do implied delete on any object and could potentially delete any children
105      * and SDC is allowed to do implicit delete on any child of pserver
106      *
107      * So the following request would return 200 and ends up deleting p-interfaces
108      * since the X-FromAppId is SDC and they are allowed to delete any child of pserver
109      *
110      * PUT /aai/v$/cloud-infrastructure/pservers/pserver
111      *
112      * Headers:
113      *
114      * X-FromAppId: SDC
115      * X-TransactionId: Some-Transaction-Id
116      * Content-Type: application/json
117      *
118      * <code>
119      * {
120      *  "hostname": "pserver",
121      *  "p-interfaces":{}
122      * }
123      * </code>
124      */
125     public static final String AAI_IMPLIED_DELETE_WHITELIST = "aai.implied.delete.whitelist.";
126
127     public static final String AAI_BULKCONSUMER_LIMIT = "aai.bulkconsumer.payloadlimit";
128     public static final String AAI_BULKCONSUMER_OVERRIDE_LIMIT = "aai.bulkconsumer.payloadoverride";
129
130     public static final String AAI_TRAVERSAL_TIMEOUT_LIMIT = "aai.traversal.timeoutlimit";
131     public static final String AAI_TRAVERSAL_TIMEOUT_ENABLED = "aai.traversal.timeoutenabled";
132     public static final String AAI_TRAVERSAL_TIMEOUT_APP = "aai.traversal.timeout.appspecific";
133
134     public static final String AAI_GRAPHADMIN_TIMEOUT_LIMIT = "aai.graphadmin.timeoutlimit";
135     public static final String AAI_GRAPHADMIN_TIMEOUT_ENABLED = "aai.graphadmin.timeoutenabled";
136     public static final String AAI_GRAPHADMIN_TIMEOUT_APP = "aai.graphadmin.timeout.appspecific";
137
138     public static final String AAI_CRUD_TIMEOUT_LIMIT = "aai.crud.timeoutlimit";
139     public static final String AAI_CRUD_TIMEOUT_ENABLED = "aai.crud.timeoutenabled";
140     public static final String AAI_CRUD_TIMEOUT_APP = "aai.crud.timeout.appspecific";
141
142     public static final String AAI_RESVERSION_ENABLEFLAG = "aai.resourceversion.enableflag";
143     public static final String AAI_RESVERSION_DISABLED_UUID = "aai.resourceversion.disabled.uuid";
144     public static final String AAI_RESVERSION_DISABLED_UUID_DEFAULT = "38cf3090-6a0c-4e9d-8142-4332a7352846";
145
146     public static final long HISTORY_MAX_HOURS = 192;
147
148     public static final String LOGGING_MAX_STACK_TRACE_ENTRIES = "aai.logging.maxStackTraceEntries";
149
150     /*** UEB ***/
151     public static final String UEB_PUB_PARTITION_AAI = "AAI";
152
153     /** Micro-service Names */
154     public static final String AAI_TRAVERSAL_MS = "aai-traversal";
155     public static final String AAI_RESOURCES_MS = "aai-resources";
156
157     /** Flag to control concurrency lock */
158     public static final String AAI_LOCK_URI_ENABLED = "aai.lock.uri.enabled";
159
160     public static final String AAI_LOCK_RV_ENABLED = "aai.lock.rv.enabled";
161
162     /**
163      * Instantiates a new AAI constants.
164      */
165     private AAIConstants() {
166         // prevent instantiation
167     }
168
169 }