package org.openecomp.sdc.translator.services.heattotosca;
-import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
import java.util.Optional;
public class UnifiedCompositionManager {
-
- private MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
private ConsolidationService consolidationService;
private TranslationService translationService = new TranslationService();
private UnifiedCompositionService unifiedCompositionService = new UnifiedCompositionService();
*/
public ToscaServiceModel createUnifiedComposition(ToscaServiceModel toscaServiceModel,
TranslationContext translationContext) {
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
Map<String, ServiceTemplate> serviceTemplates = toscaServiceModel.getServiceTemplates();
ServiceTemplate mainServiceTemplate =
serviceTemplates.get(toscaServiceModel.getEntryDefinitionServiceTemplate());
createUnifiedComposition(toscaServiceModel, mainServiceTemplate, translationContext);
ToscaServiceModel unifiedToscaServiceModel =
HeatToToscaUtil.createToscaServiceModel(mainServiceTemplate, translationContext);
-
- mdcDataDebugMessage.debugExitMessage(null, null);
return unifiedToscaServiceModel;
}
private void createUnifiedComposition(ToscaServiceModel toscaServiceModel,
ServiceTemplate serviceTemplate,
TranslationContext translationContext) {
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
handleNestedServiceTemplates(toscaServiceModel, serviceTemplate, translationContext);
consolidationService.serviceTemplateConsolidation(serviceTemplate, translationContext);
unifiedCompositionService
.updateUnifiedAbstractNodesConnectivity(serviceTemplate, translationContext);
translationContext.addUnifiedHandledServiceTeamplte(serviceTemplate);
-
- mdcDataDebugMessage.debugExitMessage(null, null);
}
private void handleNestedServiceTemplates(ToscaServiceModel toscaServiceModel,
ServiceTemplate serviceTemplate,
TranslationContext translationContext) {
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
String serviceTemplateFileName = ToscaUtil.getServiceTemplateFileName(serviceTemplate);
FileNestedConsolidationData fileNestedConsolidationData =
translationContext.getConsolidationData().getNestedConsolidationData()
substitutedNodeTemplateId);
}
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
}
private void createUnifiedCompositionForNestedServiceTemplate(
ServiceTemplate substitutionServiceTemplate,
String substitutedNodeTemplateId,
TranslationContext translationContext) {
- mdcDataDebugMessage.debugEntryMessage(null, null);
handleNestedServiceTemplates(toscaServiceModel, substitutionServiceTemplate,
translationContext);
consolidationService.substitutionServiceTemplateConsolidation(substitutedNodeTemplateId,
unifiedCompositionService
.updateUnifiedAbstractNodesConnectivity(substitutionServiceTemplate, translationContext);
translationContext.addUnifiedHandledServiceTeamplte(substitutionServiceTemplate);
- mdcDataDebugMessage.debugExitMessage(null, null);
}
}
import org.openecomp.core.utilities.file.FileUtils;
import org.openecomp.sdc.heat.datatypes.HeatBoolean;
import org.openecomp.sdc.heat.datatypes.model.Resource;
-import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
import org.openecomp.sdc.tosca.datatypes.ToscaFunctions;
import org.openecomp.sdc.translator.datatypes.heattotosca.PropertyRegexMatcher;
import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext;
import java.util.Optional;
public class ContrailTranslationHelper {
-
- private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
/**
* Gets compute node type id.
*
String contrailServiceTemplateResourceId,
String contrailServiceTemplateTranslatedId,
TranslationContext context) {
- mdcDataDebugMessage.debugEntryMessage(null, null);
NameExtractor nodeTypeNameExtractor =
context.getNameExtractorImpl(ConfigConstants.CONTRAIL_COMPUTE_NODE_TYPE_IMPL_KEY);
-
- mdcDataDebugMessage.debugExitMessage(null, null);
return nodeTypeNameExtractor
.extractNodeTypeName(contrailServiceTemplateResource, contrailServiceTemplateResourceId,
contrailServiceTemplateTranslatedId);
public String getSubstitutionContrailServiceTemplateMetadata(String heatFileName,
String serviceInstanceTranslatedId) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
- mdcDataDebugMessage.debugExitMessage(null, null);
return FileUtils.getFileWithoutExtention(heatFileName) + "_" + serviceInstanceTranslatedId;
}
import org.openecomp.sdc.heat.services.HeatConstants;
import org.openecomp.sdc.logging.api.Logger;
import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate;
import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment;
public class ContrailV2VirtualMachineInterfaceHelper {
static Logger logger =
(Logger) LoggerFactory.getLogger(ContrailV2VirtualMachineInterfaceHelper.class);
- private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-
/**
* Connect Virtual Machine Interface node template to network node template in TOSCA.
*
*/
public void connectVmiToNetwork(ResourceTranslationBase resourceTranslationImpl,
TranslateTo translateTo, NodeTemplate vmiNodeTemplate) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
Object virtualNetworkRefs =
translateTo.getResource().getProperties()
.get(HeatConstants.VIRTUAL_NETWORK_REFS_PROPERTY_NAME);
}
}
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
}
/**
}
private Optional<Object> getVlanTagPropertyValue(Resource resource) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
Object vmiProperties = resource.getProperties()
.get(HeatConstants.VMI_PROPERTIES_PROPERTY_NAME);
if (vmiProperties != null && vmiProperties instanceof Map) {
- mdcDataDebugMessage.debugExitMessage(null, null);
return Optional.ofNullable(((Map) vmiProperties)
.get(HeatConstants.VMI_SUB_INTERFACE_VLAN_TAG_PROPERTY_NAME));
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
return Optional.empty();
}
import org.openecomp.sdc.heat.datatypes.model.Output;
import org.openecomp.sdc.heat.datatypes.model.Resource;
import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
import org.openecomp.sdc.tosca.services.YamlUtil;
import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId;
import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext;
public class VolumeTranslationHelper {
private final Logger logger;
- private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-
public VolumeTranslationHelper(Logger logger) {
this.logger = logger;
}
String resourceId,
TranslateTo translateTo,
FileData.Type... types) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
if (CollectionUtils.isEmpty(filesToSearch)) {
- mdcDataDebugMessage.debugExitMessage(null, null);
return Optional.empty();
}
Optional<ResourceFileDataAndIDs> fileDataAndIDs =
getResourceFileDataAndIDsForVolumeConnection(resourceId, translateTo, fileDatas);
if (fileDataAndIDs.isPresent()) {
- mdcDataDebugMessage.debugExitMessage(null, null);
return fileDataAndIDs;
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
return Optional.empty();
}
private Optional<ResourceFileDataAndIDs> getResourceFileDataAndIDsForVolumeConnection(
String resourceId, TranslateTo translateTo, List<FileData> fileDatas) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
for (FileData data : fileDatas) {
HeatOrchestrationTemplate heatOrchestrationTemplate = new YamlUtil()
.yamlToObject(translateTo.getContext().getFiles().getFileContent(data.getFile()),
logger.warn("output: '" + resourceId + "' in file '" + data.getFile() + "' is not found");
}
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
return Optional.empty();
}
private Optional<List<Map.Entry<String, Resource>>> getResourceByTranslatedResourceId(
String fileName, HeatOrchestrationTemplate heatOrchestrationTemplate,
String translatedResourceId, TranslateTo translateTo, String heatResourceType) {
-
-
- mdcDataDebugMessage.debugEntryMessage("file", fileName);
-
List<Map.Entry<String, Resource>> list = heatOrchestrationTemplate.getResources().entrySet()
.stream()
.filter(
.allMatch(p -> p.test(entry)))
.collect(Collectors.toList());
if (CollectionUtils.isEmpty(list)) {
- mdcDataDebugMessage.debugExitMessage("file", fileName);
return Optional.empty();
} else {
- mdcDataDebugMessage.debugExitMessage("file", fileName);
return Optional.of(list);
}
}
import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes;
import org.openecomp.sdc.heat.datatypes.model.Resource;
import org.openecomp.sdc.heat.services.HeatConstants;
-import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType;
import org.openecomp.sdc.tosca.datatypes.ToscaNodeType;
import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType;
import java.util.function.Predicate;
public class ContrailPortToNetResourceConnection extends ResourceConnectionUsingRequirementHelper {
- private MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-
public ContrailPortToNetResourceConnection(ResourceTranslationBase resourceTranslationBase,
TranslateTo translateTo, FileData nestedFileData,
NodeTemplate substitutionNodeTemplate,
HeatOrchestrationTemplate
nestedHeatOrchestrationTemplate,
String nestedHeatFileName) {
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
Object interfaceListProperty =
heatResource.getProperties().get(HeatConstants.INTERFACE_LIST_PROPERTY_NAME);
if (interfaceListProperty == null) {
}
}
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
return Optional.of(paramsList);
} else if (interfaceListProperty instanceof Map) {
Optional<AttachedResourceId> attachedVirtualNetwork = HeatToToscaUtil
return Optional.of(paramsList);
}
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
return Optional.empty();
}
protected void addRequirementToConnectResources(
Map.Entry<String, RequirementDefinition> requirementDefinitionEntry,
List<String> paramNames) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
if (paramNames == null || paramNames.isEmpty()) {
return;
}
addRequirementToConnectResource(requirementDefinitionEntry, paramName, paramValue,
supportedNetworkTypes);
-
- mdcDataDebugMessage.debugExitMessage(null, null);
}
@Override
String connectionPointId,
Resource connectedResource,
List<String> supportedTypes) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
if (!resourceTranslationBase.isResourceTypeSupported(connectedResource, supportedTypes)) {
logger.warn("Nested resource '" + nestedResourceId + "' property '" + nestedPropertyName
+ "' is pointing to a resource with type '" + connectedResource.getType()
+ "' that connect contrail port to network. Supported types are: '"
+ supportedTypes.toString()
+ "', therefore, this TOSCA requirement will not be connected.");
-
- mdcDataDebugMessage.debugExitMessage(null, null);
return false;
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
return true;
}
@Override
protected void translate(TranslateTo translateTo) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
TranslationContext context = translateTo.getContext();
Map<String, Object> properties = translateTo.getResource().getProperties();
String heatFileName = translateTo.getHeatFileName();
manageNovaServerGroupMapping(translateTo, context, properties, heatFileName, serviceTemplate,
novaNodeTemplate, heatOrchestrationTemplate);
DataModelUtil.addNodeTemplate(serviceTemplate, translateTo.getTranslatedId(), novaNodeTemplate);
-
- mdcDataDebugMessage.debugExitMessage(null, null);
}
private void manageNovaServerGroupMapping(TranslateTo translateTo, TranslationContext context,
ServiceTemplate serviceTemplate,
NodeTemplate novaNodeTemplate,
HeatOrchestrationTemplate heatOrchestrationTemplate) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
if (isSchedulerHintsPropExist(properties)) {
Object schedulerHints = properties.get("scheduler_hints");
if (schedulerHints instanceof Map) {
+ "' is not valid. This property should be a map");
}
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
}
private void addServerGroupHintsToPoliciesGroups(TranslateTo translateTo,
HeatOrchestrationTemplate
heatOrchestrationTemplate,
Map<String, Object> schedulerHints) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
for (Object hint : schedulerHints.values()) {
Optional<AttachedResourceId> attachedResourceId = HeatToToscaUtil
.extractAttachedResourceId(heatFileName, heatOrchestrationTemplate, context, hint);
}
}
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
}
private boolean isResourceTypeServerGroup(TranslatedHeatResource translatedServerGroupResource) {
HeatOrchestrationTemplate heatOrchestrationTemplate,
String resourceToTranslate,
NodeTemplate novaNodeTemplate) {
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
Resource serverGroup =
HeatToToscaUtil.getResource(heatOrchestrationTemplate, resourceToTranslate, heatFileName);
Optional<String> serverGroupTranslatedId = ResourceTranslationFactory.getInstance(serverGroup)
serverGroupTranslatedId.get());
}
- mdcDataDebugMessage.debugExitMessage(null, null);
}
private boolean isSchedulerHintsPropExist(Map<String, Object> properties) {
private void manageNovaServerBlockDeviceMapping(TranslateTo translateTo,
NodeTemplate novaNodeTemplate) {
- mdcDataDebugMessage.debugEntryMessage(null, null);
String heatFileName = translateTo.getHeatFileName();
TranslationContext context = translateTo.getContext();
ServiceTemplate serviceTemplate = translateTo.getServiceTemplate();
}
index++;
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
}
private void connectNovaServerToVolume(NodeTemplate novaNodeTemplate, String volumeResourceId,
String relationshipId, TranslateTo translateTo) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
RequirementAssignment requirementAssignment = new RequirementAssignment();
requirementAssignment.setCapability(ToscaCapabilityType.NATIVE_ATTACHMENT);
requirementAssignment.setNode(volumeResourceId);
ConsolidationDataUtil.updateComputeConsolidationDataVolumes(translateTo, novaNodeTemplate
.getType(), translateTo.getTranslatedId(), ToscaConstants.LOCAL_STORAGE_REQUIREMENT_ID,
requirementAssignment);
-
- mdcDataDebugMessage.debugExitMessage(null, null);
}
private void createCinderVolumeNodeTemplate(ServiceTemplate serviceTemplate, String resourceId,
Map<String, Object> blockDeviceMapping,
HeatOrchestrationTemplate heatOrchestrationTemplate,
TranslationContext context) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
NodeTemplate cinderVolumeNodeTemplate = new NodeTemplate();
cinderVolumeNodeTemplate.setType(ToscaNodeType.CINDER_VOLUME);
cinderVolumeNodeTemplate.setProperties(TranslatorHeatToToscaPropertyConverter
HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE.getHeatResource(),
cinderVolumeNodeTemplate, context));
DataModelUtil.addNodeTemplate(serviceTemplate, volumeResourceId, cinderVolumeNodeTemplate);
-
- mdcDataDebugMessage.debugExitMessage(null, null);
}
private void createVolumeAttachesToRelationship(ServiceTemplate serviceTemplate,
String deviceName, String novaServerTranslatedId,
String volumeId, String relationshipId) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
RelationshipTemplate relationshipTemplate = new RelationshipTemplate();
relationshipTemplate.setType(ToscaRelationshipType.CINDER_VOLUME_ATTACHES_TO);
Map<String, Object> properties = new HashMap<>();
relationshipTemplate.setProperties(properties);
DataModelUtil.addRelationshipTemplate(serviceTemplate, relationshipId, relationshipTemplate);
-
- mdcDataDebugMessage.debugExitMessage(null, null);
}
private List<Map<String, Object>> getBlockDeviceMappingList(Resource resource) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
if (Objects.isNull(resource.getProperties())) {
return Collections.emptyList();
}
blockDeviceMappingList.addAll(blockDeviceMappingV2List);
} else if (CollectionUtils.isEmpty(blockDeviceMappingList)
&& CollectionUtils.isEmpty(blockDeviceMappingV2List)) {
-
- mdcDataDebugMessage.debugExitMessage(null, null);
return null;
} else {
blockDeviceMappingList =
blockDeviceMappingList != null ? blockDeviceMappingList : blockDeviceMappingV2List;
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
return blockDeviceMappingList;
}
private void manageNovaServerNetwork(TranslateTo translateTo,
NodeTemplate novaNodeTemplate) {
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
Resource resource = translateTo.getResource();
String translatedId = translateTo.getTranslatedId();
getOrTranslatePortTemplate(translateTo, heatNetwork.get(
Constants.PORT_PROPERTY_NAME), translatedId, novaNodeTemplate);
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
-
}
private void getOrTranslatePortTemplate(TranslateTo translateTo,
Object port,
String novaServerResourceId,
NodeTemplate novaNodeTemplate) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null, null);
-
String heatFileName = translateTo.getHeatFileName();
HeatOrchestrationTemplate heatOrchestrationTemplate = translateTo
.getHeatOrchestrationTemplate();
+ HeatResourcesTypes.NEUTRON_PORT_RESOURCE_TYPE.getHeatResource() + ", "
+ HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE
.getHeatResource());
- mdcDataDebugMessage.debugExitMessage(null, null);
return;
} else if (HeatResourcesTypes.CONTRAIL_V2_VIRTUAL_MACHINE_INTERFACE_RESOURCE_TYPE
.getHeatResource().equals(portResource.getType())) {
+ "ignored.");
}
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
}
private String createLocalNodeType(ServiceTemplate serviceTemplate, Resource resource, String
resourceId,
String translatedId, TranslationContext context) {
- mdcDataDebugMessage.debugEntryMessage(null, null);
NameExtractor nodeTypeNameExtractor = context.getNameExtractorImpl(resource.getType());
String nodeTypeName =
nodeTypeNameExtractor.extractNodeTypeName(resource, resourceId, translatedId);
if (!isNodeTypeCreated(serviceTemplate, nodeTypeName)) {
DataModelUtil.addNodeType(serviceTemplate, nodeTypeName, createNodeType());
}
-
- mdcDataDebugMessage.debugExitMessage(null, null);
return nodeTypeName;
}
package org.openecomp.sdc.vendorlicense;
-import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
import java.text.ParseException;
import java.text.SimpleDateFormat;
public class VendorLicenseUtil {
-
- private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-
public static String getIsoFormatDate(String inputDate) {
- mdcDataDebugMessage.debugEntryMessage("inputDate date", inputDate);
String isoFormatDate = null;
SimpleDateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
SimpleDateFormat inputDateFormat = new SimpleDateFormat("MM/dd/yyyy'T'HH:mm:ss'Z'");
try {
isoFormatDate = isoDateFormat.format(inputDateFormat.parse(inputDate));
} catch (ParseException e) {
- mdcDataDebugMessage.debugExitMessage("parsing error", isoFormatDate);
isoFormatDate = null;
}
-
- mdcDataDebugMessage.debugExitMessage("formatted date", isoFormatDate);
return isoFormatDate;
}
}
import com.datastax.driver.mapping.annotations.PartitionKey;
import com.datastax.driver.mapping.annotations.Table;
import org.apache.commons.lang3.StringUtils;
-import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
import org.openecomp.sdc.vendorlicense.VendorLicenseUtil;
import org.openecomp.sdc.vendorlicense.dao.types.xml.LimitForXml;
import org.openecomp.sdc.vendorlicense.dao.types.xml.LimitXml;
@Table(keyspace = "dox", name = "entitlement_pool")
public class EntitlementPoolEntity implements VersionableEntity {
-
- private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage();
private static final String ENTITY_TYPE = "Entitlement Pool";
@PartitionKey
}
public String getIsoFormatStartDate() {
- MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("start date", startDate);
String isoFormatStartDate = null;
if (!StringUtils.isEmpty(startDate)) {
isoFormatStartDate = VendorLicenseUtil.getIsoFormatDate(startDate);
- MDC_DATA_DEBUG_MESSAGE.debugExitMessage("start date", "iso format start date", startDate,
- isoFormatStartDate);
}
return isoFormatStartDate;
}
public String getIsoFormatExpiryDate() {
- MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("expiry date", expiryDate);
String isoFormatExpDate = null;
if (!StringUtils.isEmpty(expiryDate)) {
isoFormatExpDate = VendorLicenseUtil.getIsoFormatDate(expiryDate);
- MDC_DATA_DEBUG_MESSAGE.debugExitMessage("expiry date", "iso format expiry date", expiryDate,
- isoFormatExpDate);
}
return isoFormatExpDate;
}
import com.datastax.driver.mapping.annotations.PartitionKey;
import com.datastax.driver.mapping.annotations.Table;
import org.apache.commons.lang3.StringUtils;
-import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
import org.openecomp.sdc.vendorlicense.VendorLicenseUtil;
import org.openecomp.sdc.vendorlicense.dao.types.xml.LicenseKeyTypeForXml;
import org.openecomp.sdc.vendorlicense.dao.types.xml.LimitForXml;
@Table(keyspace = "dox", name = "license_key_group")
public class LicenseKeyGroupEntity implements VersionableEntity {
-
- private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage();
private static final String ENTITY_TYPE = "License Key Group";
@PartitionKey
}
public String getIsoFormatStartDate() {
- MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("start date", startDate);
String isoFormatStartDate = null;
if (!StringUtils.isEmpty(startDate)) {
isoFormatStartDate = VendorLicenseUtil.getIsoFormatDate(startDate);
- MDC_DATA_DEBUG_MESSAGE.debugExitMessage("start date", "iso format start date", startDate,
- isoFormatStartDate);
}
return isoFormatStartDate;
}
public String getIsoFormatExpiryDate() {
- MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("expiry date", expiryDate);
String isoFormatExpDate = null;
if (!StringUtils.isEmpty(expiryDate)) {
isoFormatExpDate = VendorLicenseUtil.getIsoFormatDate(expiryDate);
- MDC_DATA_DEBUG_MESSAGE.debugExitMessage("expiry date", "iso format expiry date", expiryDate,
- isoFormatExpDate);
}
return isoFormatExpDate;
}
import org.openecomp.sdc.common.errors.CoreException;
import org.openecomp.sdc.common.errors.ErrorCode;
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;
private static final LicenseKeyGroupDao
licenseKeyGroupDao = LicenseKeyGroupDaoFactory.getInstance().createInterface();
private static final LimitDao limitDao = LimitDaoFactory.getInstance().createInterface();
- private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-
/**
* Instantiates a new Vendor license facade.
*/
@Override
public VendorLicenseModelEntity getVendorLicenseModel(String vlmId, Version version) {
- mdcDataDebugMessage.debugEntryMessage("VLM id", vlmId);
-
VendorLicenseModelEntity vendorLicenseModel =
vendorLicenseModelDao.get(new VendorLicenseModelEntity(vlmId, version));
if (vendorLicenseModel == null) {
LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.ENTITY_NOT_FOUND);
throw new CoreException(new VendorLicenseModelNotFoundErrorBuilder(vlmId).build());
}
-
- mdcDataDebugMessage.debugExitMessage("VLM id", vlmId);
return vendorLicenseModel;
}
package org.openecomp.sdc.vendorlicense.healing.impl;
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;
EntitlementPoolDaoFactory.getInstance().createInterface();
private static final LicenseKeyGroupDao licenseKeyGroupDao =
LicenseKeyGroupDaoFactory.getInstance().createInterface();
- private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-
@Override
public VersionableEntity heal(VersionableEntity toHeal) {
return handleMissingVersionId(toHeal);
}
private VersionableEntity handleMissingVersionId(VersionableEntity toHeal) {
-
-
- mdcDataDebugMessage.debugEntryMessage(null);
-
if (toHeal != null && toHeal.getVersionUuId() != null) {
return toHeal;
}
throw new UnsupportedOperationException(
"Unsupported operation for 1610 release/1607->1610 migration.");
}
-
- mdcDataDebugMessage.debugExitMessage(null);
return toHeal;
}
}
import org.apache.commons.collections.CollectionUtils;
import org.openecomp.core.utilities.file.FileContentHandler;
-import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
import org.openecomp.sdc.vendorlicense.HealingServiceFactory;
import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity;
import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
VendorLicenseFacadeFactory.getInstance().createInterface();
public static final HealingService healingService =
HealingServiceFactory.getInstance().createInterface();
- private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
-
-
private static byte[] createVnfArtifact(String vspId, String vlmId, Version vlmVersion, String vendorName,
List<String> featureGroups) {
-
-
- mdcDataDebugMessage.debugEntryMessage("VLM name", vendorName);
-
VnfLicenseArtifact artifact = new VnfLicenseArtifact();
artifact.setVspId(vspId);
artifact.getFeatureGroups().add(featureGroupModel);
}
}
-
- mdcDataDebugMessage.debugExitMessage("VLM name", vendorName);
return artifact.toXml().getBytes();
}
private static byte[] createVendorLicenseArtifact(String vlmId, String vendorName) {
-
-
- mdcDataDebugMessage.debugEntryMessage("VLM name", vendorName);
-
VendorLicenseArtifact vendorLicenseArtifact = new VendorLicenseArtifact();
vendorLicenseArtifact.setVendorName(vendorName);
Set<EntitlementPoolEntity> entitlementPoolEntities = new HashSet<>();
healLkgs(filterChangedEntities(prepareForFiltering(licenseKeyGroupEntities, false)));
vendorLicenseArtifact.setEntitlementPoolEntities(entitlementPoolEntities);
vendorLicenseArtifact.setLicenseKeyGroupEntities(licenseKeyGroupEntities);
-
- mdcDataDebugMessage.debugExitMessage("VLM name", vendorName);
return vendorLicenseArtifact.toXml().getBytes();
}
*/
public FileContentHandler createLicenseArtifacts(String vspId, String vlmId, Version vlmVersion,
List<String> featureGroups) {
-
-
- mdcDataDebugMessage.debugEntryMessage("VSP Id", vspId);
-
FileContentHandler artifacts = new FileContentHandler();
String vendorName = getVendorName(vlmId);
createVnfArtifact(vspId, vlmId, vlmVersion, vendorName, featureGroups));
artifacts.addFile(VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH,
createVendorLicenseArtifact(vlmId, vendorName));
-
- mdcDataDebugMessage.debugExitMessage("VSP Id", vspId);
-
return artifacts;
}