2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
24 package org.onap.clamp.clds.model.properties;
26 import com.att.eelf.configuration.EELFLogger;
27 import com.att.eelf.configuration.EELFManager;
28 import com.google.gson.JsonElement;
29 import com.google.gson.JsonObject;
32 * Provide base ModelElement functionality. Perform base parsing of properties for a ModelElement (such as,
33 * VesCollector, Policy, Tca, Holmes, ...)
35 public abstract class AbstractModelElement {
37 protected static final EELFLogger logger = EELFManager.getInstance().getLogger(AbstractModelElement.class);
38 protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
39 private final String type;
40 private final ModelBpmn modelBpmn;
41 private final String id;
42 protected String topicPublishes;
43 protected final JsonElement modelElementJsonNode;
44 private boolean isFound;
45 private final ModelProperties modelProp;
48 * Perform base parsing of properties for a ModelElement (such as, VesCollector, Policy and Tca).
50 protected AbstractModelElement(String type, ModelProperties modelProp, ModelBpmn modelBpmn, JsonObject modelJson) {
52 this.modelProp = modelProp;
53 this.modelBpmn = modelBpmn;
54 this.id = modelBpmn.getId(type);
55 this.modelElementJsonNode = modelJson.get(id);
56 this.isFound = modelBpmn.isModelElementTypeInList(type);
60 * Get the topic publishes.
61 * @return the topicPublishes
63 public String getTopicPublishes() {
64 return topicPublishes;
72 public String getId() {
77 * Get the isFound flag.
80 public boolean isFound() {