Enhancements for the aai-common library
[aai/aai-common.git] / aai-els-onap-logging / src / main / java / org / onap / logging / filter / base / ONAPComponents.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - Logging
4  * ================================================================================
5  * Copyright (C) 2019 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.logging.filter.base;
22
23 import java.util.EnumSet;
24 import java.util.Set;
25
26 public enum ONAPComponents implements ONAPComponentsList {
27     OPENSTACK_ADAPTER,
28     BPMN,
29     GRM,
30     AAI,
31     DMAAP,
32     POLICY,
33     CATALOG_DB,
34     REQUEST_DB,
35     SNIRO,
36     SDC,
37     EXTERNAL,
38     VNF_ADAPTER,
39     SDNC_ADAPTER,
40     MULTICLOUD,
41     CLAMP,
42     PORTAL,
43     VID,
44     APPC,
45     DCAE,
46     HOLMES,
47     SDNC,
48     SO,
49     VFC,
50     ESR,
51     DBC,
52     DR,
53     MR,
54     OPTF;
55
56
57     public static Set<ONAPComponents> getSOInternalComponents() {
58         return EnumSet.of(OPENSTACK_ADAPTER, BPMN, CATALOG_DB, REQUEST_DB, VNF_ADAPTER, SDNC_ADAPTER);
59     }
60
61     public static Set<ONAPComponents> getDMAAPInternalComponents() {
62         return EnumSet.of(DBC, DR, MR);
63     }
64
65     public static Set<ONAPComponents> getAAIInternalComponents() {
66         return EnumSet.of(ESR);
67     }
68
69     @Override
70     public String toString() {
71         if (getSOInternalComponents().contains(this))
72             return SO + "." + this.name();
73         else if (getDMAAPInternalComponents().contains(this))
74             return DMAAP + "." + this.name();
75         else if (getAAIInternalComponents().contains(this))
76             return AAI + "." + this.name();
77         else
78             return this.name();
79     }
80 }