package org.openecomp.sdc.generator.core.utils;
-import static org.openecomp.sdc.tosca.services.DataModelUtil.addSubstitutionNodeTypeRequirements;
-
import org.openecomp.sdc.datatypes.error.ErrorLevel;
-import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage;
import org.openecomp.sdc.logging.types.LoggerConstants;
import org.openecomp.sdc.logging.types.LoggerErrorCode;
import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
import org.openecomp.sdc.tosca.services.DataModelUtil;
import org.openecomp.sdc.tosca.services.ToscaAnalyzerService;
+import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
import org.openecomp.sdc.tosca.services.ToscaUtil;
import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl;
-import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
-import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
+import static org.openecomp.sdc.tosca.services.DataModelUtil.addSubstitutionNodeTypeRequirements;
+
/**
* The type Generator utils.
*/
public class GeneratorUtils {
- public static List<String> supportedCapabilities = new ArrayList<>();
- public static List<String> supportedRequirements = new ArrayList<>();
- protected static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-
+ private static List<String> supportedCapabilities = new ArrayList<>();
+ private static List<String> supportedRequirements = new ArrayList<>();
static {
//TODO : Read from configuration
supportedCapabilities.addAll(Arrays.asList("host", "os", "endpoint", "scalable"));
} catch (Exception ex) {
MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API,
LoggerTragetServiceName.GENERATE_MANUAL_VSP_TOSCA, ErrorLevel.INFO.name(),
- LoggerErrorCode.DATA_ERROR.getErrorCode(), "Error occured in get node type exposed "
- + "points");
+ LoggerErrorCode.DATA_ERROR.getErrorCode(),
+ "Error occured in get node type exposed points : " + ex.getMessage());
return null;
}
return substitutionMapping;
Map<String, CapabilityDefinition> nodeTypeCapabilitiesDefinition,
Map<String, List<String>> capabilitySubstitutionMapping, String type, String templateName,
ServiceTemplate substitutionServiceTemplate, ToscaServiceModel toscaServiceModel) {
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
ToscaAnalyzerService toscaAnalyzerService = new ToscaAnalyzerServiceImpl();
NodeType flatNodeType = (NodeType) toscaAnalyzerService
.getFlatEntity(ToscaElementTypes.NODE_TYPE, type, substitutionServiceTemplate,
capabilitySubstitutionMapping.put(capabilityKey, capabilityMapping);
}
}
- mdcDataDebugMessage.debugExitMessage(null, null);
}
}