Removed unused fields from AbstractModelElement
[clamp.git] / src / main / java / org / onap / clamp / clds / model / properties / AbstractModelElement.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP CLAMP
4  * ================================================================================
5  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
6  *                             reserved.
7  * ================================================================================
8  * Modifications Copyright (c) 2019 Samsung
9  * ================================================================================
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  * ============LICENSE_END============================================
22  * ===================================================================
23  *
24  */
25
26 package org.onap.clamp.clds.model.properties;
27
28 import com.att.eelf.configuration.EELFLogger;
29 import com.att.eelf.configuration.EELFManager;
30 import com.google.gson.JsonElement;
31 import com.google.gson.JsonObject;
32
33 /**
34  * Provide base ModelElement functionality. Perform base parsing of properties for a ModelElement (such as,
35  * VesCollector, Policy, Tca, Holmes, ...)
36  */
37 public abstract class AbstractModelElement {
38
39     protected static final EELFLogger logger = EELFManager.getInstance().getLogger(AbstractModelElement.class);
40     protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
41     private final String id;
42     protected String topicPublishes;
43     protected final JsonElement modelElementJsonNode;
44     private final boolean isFound;
45
46     /**
47      * Perform base parsing of properties for a ModelElement (such as, VesCollector, Policy and Tca).
48      */
49     protected AbstractModelElement(String type, ModelBpmn modelBpmn, JsonObject modelJson) {
50         this.id = modelBpmn.getId(type);
51         this.modelElementJsonNode = modelJson.get(id);
52         this.isFound = modelBpmn.isModelElementTypeInList(type);
53     }
54
55     /**
56      * Get the topic publishes.
57      *
58      * @return the topicPublishes
59      */
60     public String getTopicPublishes() {
61         return topicPublishes;
62     }
63
64     /**
65      * Get the id.
66      *
67      * @return the id
68      */
69     public String getId() {
70         return id;
71     }
72
73     /**
74      * Get the isFound flag.
75      *
76      * @return the isFound
77      */
78     public boolean isFound() {
79         return isFound;
80     }
81 }