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.translator.services.heattotosca.globaltypes;
24 import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
25 import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition;
26 import org.openecomp.sdc.tosca.datatypes.model.Import;
27 import org.openecomp.sdc.tosca.services.ToscaUtil;
29 import java.util.HashMap;
32 public class GlobalTypesUtil {
36 * Create common import list map.
40 public static Map<String, Import> createCommonImportList() {
41 Map<String, Import> importsMap = new HashMap<>();
42 importsMap.put("common_definitions", CommonGlobalTypes.createCommonServiceTemplateImport());
47 * Create attachment capability capability definition.
49 * @return the capability definition
51 public static CapabilityDefinition createAttachmentCapability() {
52 CapabilityDefinition capability = new CapabilityDefinition();
53 capability.setType(ToscaCapabilityType.ATTACHMENT.getDisplayName());
59 * Create service template import import.
61 * @param serviceTemplateName the service template name
64 public static Import createServiceTemplateImport(String serviceTemplateName) {
65 Import serviceTemplateImport = new Import();
66 serviceTemplateImport.setFile(ToscaUtil.getServiceTemplateFileName(serviceTemplateName));
67 return serviceTemplateImport;