import org.openecomp.sdc.enrichment.EnrichmentInfo;
import org.openecomp.sdc.enrichment.inter.ExternalArtifactEnricherInterface;
import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao;
+import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory;
import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDao;
import org.openecomp.sdc.vendorsoftwareproduct.dao.ProcessDaoFactory;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
-import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity;
import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessType;
public class ProcessArtifactEnricher implements ExternalArtifactEnricherInterface {
- private VendorSoftwareProductDao vendorSoftwareProductDao;
+ private ComponentDao componentDao;
//private ProcessArtifactDao processArtifactDao;
private ProcessDao processDao;
private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
Version version = enrichmentInfo.getVersion();
Collection<ComponentEntity> components =
- getVendorSoftwareProductDao().listComponents(vspId, version);
- components.stream()
- .forEach(componentEntry -> errors.putAll(enrichComponent(componentEntry,
- vspId, version)));
+ getComponentDao().list(new ComponentEntity(vspId, version, null));
+ components.forEach(componentEntry -> errors.putAll(enrichComponent(componentEntry,
+ vspId, version)));
return errors;
}
ProcessArtifactEntity artifactEntity = new ProcessArtifactEntity(vspId, version,
componentId, entity.getId());*/
- processes.stream()
- .forEach(entity -> {
- ProcessEntity artifactEntity = new ProcessEntity(vspId, version,
- componentId, entity.getId());
+ processes.forEach(entity -> {
+ ProcessEntity artifactEntity = new ProcessEntity(vspId, version,
+ componentId, entity.getId());
ProcessEntity artifactProcessEntity = getProcessDao().get(artifactEntity);
//ProcessArtifactEntity artifact = getProcessArtifactDao().get(artifactEntity);
}
});
- mdcDataDebugMessage.debugExitMessage(null, null);
+ mdcDataDebugMessage.debugExitMessage(null);
}
void enrichServiceArtifact(ComponentProcessInfo componentProcessInfo,
Map<String, List<ErrorMessage>> errors) {
- mdcDataDebugMessage.debugEntryMessage(null, null);
+ mdcDataDebugMessage.debugEntryMessage(null);
processServiceArtifact.setName(componentProcessInfo.getName());
processServiceArtifact.setContentData(FileUtils.toByteArray(componentProcessInfo.getContent()));
getEnrichedServiceModelDao().storeExternalArtifact(processServiceArtifact);
- mdcDataDebugMessage.debugExitMessage(null, null);
+ mdcDataDebugMessage.debugExitMessage(null);
}
- private VendorSoftwareProductDao getVendorSoftwareProductDao() {
- if (vendorSoftwareProductDao == null) {
- vendorSoftwareProductDao = VendorSoftwareProductDaoFactory.getInstance().createInterface();
+ private ComponentDao getComponentDao() {
+ if (componentDao == null) {
+ componentDao = ComponentDaoFactory.getInstance().createInterface();
}
- return vendorSoftwareProductDao;
+ return componentDao;
}
private ProcessDao getProcessDao() {