2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.enrichment.impl;
23 import org.openecomp.core.enrichment.api.EnrichmentManager;
24 import org.openecomp.core.enrichment.types.EntityInfo;
25 import org.openecomp.sdc.datatypes.error.ErrorMessage;
26 import org.openecomp.sdc.enrichment.EnrichmentInfo;
27 import org.openecomp.sdc.enrichment.factory.EnricherHandlerFactory;
28 import org.openecomp.sdc.enrichment.inter.Enricher;
29 import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
30 import org.openecomp.sdc.versioning.dao.types.Version;
31 import org.slf4j.Logger;
32 import org.slf4j.LoggerFactory;
34 import java.util.List;
37 public class EnrichmentManagerImpl implements EnrichmentManager<ToscaServiceModel> {
39 private static Logger logger = LoggerFactory.getLogger(EnrichmentManagerImpl.class);
41 private EnrichmentInfo input = null;
42 private ToscaServiceModel model;
46 public Map<String, List<ErrorMessage>> enrich() {
47 List<Enricher> enricherList =
48 EnricherHandlerFactory.getInstance().createInterface().getEnrichers();
49 for (Enricher enricher : enricherList) {
50 enricher.setInput(input);
51 enricher.setModel(model);
59 public void addEntityInput(String type, EntityInfo info) {
60 this.input.addEntityInfo(type, info);
65 public void initInput(String key, Version version) {
66 input = new EnrichmentInfo();
68 input.setVersion(version);
72 public void addModel(ToscaServiceModel model) {
79 public ToscaServiceModel getModel() {