Rename packages from openecomp to onap.
[sdc.git] / openecomp-be / lib / openecomp-sdc-translator-lib / openecomp-sdc-translator-core / src / main / java / org / openecomp / sdc / translator / services / heattotosca / globaltypes / GlobalTypesGenerator.java
1 /*
2  * Copyright © 2016-2017 European Support Limited
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 package org.openecomp.sdc.translator.services.heattotosca.globaltypes;
18
19 import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
20 import org.onap.sdc.tosca.datatypes.model.Import;
21 import org.onap.sdc.tosca.datatypes.model.ServiceTemplate;
22 import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil;
23
24 import java.util.ArrayList;
25 import java.util.HashMap;
26 import java.util.List;
27 import java.util.Map;
28
29
30 public class GlobalTypesGenerator {
31
32   private GlobalTypesGenerator() {
33   }
34
35   /**
36    * Gets global types service template.
37    *
38    * @return the global types service template
39    */
40   public static Map<String, ServiceTemplate> getGlobalTypesServiceTemplate(OnboardingTypesEnum
41                                                                                onboardingType) {
42     return GlobalTypesServiceTemplates.getGlobalTypesServiceTemplates(onboardingType);
43   }
44
45   /**
46    * Gets global types import list.
47    *
48    * @return the global types import list
49    */
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);
59     return globalImports;
60   }
61
62   /**
63    * Gets global types import list for Manual Vsp onboarding.
64    *
65    * @return the global types import list
66    */
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);
76     return globalImports;
77   }
78 }