2 * Copyright © 2016-2017 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
19 import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
20 import org.openecomp.sdc.tosca.datatypes.model.Import;
21 import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
22 import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
24 import java.util.ArrayList;
25 import java.util.HashMap;
26 import java.util.List;
30 public class GlobalTypesGenerator {
32 private GlobalTypesGenerator() {
36 * Gets global types service template.
38 * @return the global types service template
40 public static Map<String, ServiceTemplate> getGlobalTypesServiceTemplate(OnboardingTypesEnum
42 return GlobalTypesServiceTemplates.getGlobalTypesServiceTemplates(onboardingType);
46 * Gets global types import list.
48 * @return the global types import list
50 public static List<Map<String, Import>> getGlobalTypesImportList() {
51 List<Map<String, Import>> globalImports = new ArrayList<>();
52 Map<String, Import> globalImportMap = new HashMap<>();
53 Map<String, ServiceTemplate> globalTypesServiceTemplate =
54 GlobalTypesGenerator.getGlobalTypesServiceTemplate(OnboardingTypesEnum.ZIP);
55 globalImportMap.put("openecomp_heat_index",
56 HeatToToscaUtil.createServiceTemplateImport(globalTypesServiceTemplate.get
57 ("openecomp-heat/_index.yml")));
58 globalImports.add(globalImportMap);
63 * Gets global types import list for Manual Vsp onboarding.
65 * @return the global types import list
67 public static List<Map<String, Import>> getManualVspGlobalTypesImportList() {
68 List<Map<String, Import>> globalImports = new ArrayList<>();
69 Map<String, Import> globalImportMap = new HashMap<>();
70 Map<String, ServiceTemplate> globalTypesServiceTemplate =
71 GlobalTypesGenerator.getGlobalTypesServiceTemplate(OnboardingTypesEnum.MANUAL);
72 globalImportMap.put("openecomp_index",
73 HeatToToscaUtil.createServiceTemplateImport(globalTypesServiceTemplate.get
74 ("openecomp/_index.yml")));
75 globalImports.add(globalImportMap);