use of org.onap.so.bpmn.infrastructure.workflow.tasks.Resource in project so by onap.
the class ServiceEBBLoader method traverseVrfConfiguration.
protected void traverseVrfConfiguration(List<Pair<WorkflowType, String>> aaiResourceIds, List<Resource> resourceList, Resource serviceResource, org.onap.so.db.catalog.beans.Service service, RelatedInstance relatedVpnBinding, RelatedInstance relatedLocalNetwork) throws VrfBondingServiceException, JsonProcessingException {
org.onap.aai.domain.yang.L3Network aaiLocalNetwork = bbInputSetupUtils.getAAIL3Network(relatedLocalNetwork.getInstanceId());
vrfValidation.vrfServiceValidation(service);
vrfValidation.vrfCatalogDbChecks(service);
vrfValidation.aaiVpnBindingValidation(relatedVpnBinding.getInstanceId(), bbInputSetupUtils.getAAIVpnBinding(relatedVpnBinding.getInstanceId()));
vrfValidation.aaiNetworkValidation(relatedLocalNetwork.getInstanceId(), aaiLocalNetwork);
vrfValidation.aaiSubnetValidation(aaiLocalNetwork);
vrfValidation.aaiAggregateRouteValidation(aaiLocalNetwork);
vrfValidation.aaiRouteTargetValidation(aaiLocalNetwork);
String existingAAIVrfConfiguration = getExistingAAIVrfConfiguration(relatedVpnBinding, aaiLocalNetwork);
if (existingAAIVrfConfiguration != null) {
aaiResourceIds.add(new Pair<>(WorkflowType.CONFIGURATION, existingAAIVrfConfiguration));
}
resourceList.add(new Resource(WorkflowType.CONFIGURATION, service.getConfigurationCustomizations().get(0).getModelCustomizationUUID(), false, serviceResource));
}
use of org.onap.so.bpmn.infrastructure.workflow.tasks.Resource in project so by onap.
the class ServiceEBBLoader method traverseServiceInstanceMSOVnfs.
private void traverseServiceInstanceMSOVnfs(List<Resource> resourceList, Resource serviceResource, List<Pair<WorkflowType, String>> aaiResourceIds, org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO) {
if (serviceInstanceMSO.getVnfs() == null) {
return;
}
for (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf : serviceInstanceMSO.getVnfs()) {
aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId()));
GenericVnf genericVnf = bbInputSetupUtils.getAAIGenericVnf(vnf.getVnfId());
Resource vnfResource = new Resource(WorkflowType.VNF, vnf.getVnfId(), false, serviceResource);
vnfResource.setVnfCustomizationId(genericVnf.getModelCustomizationId());
vnfResource.setModelCustomizationId(genericVnf.getModelCustomizationId());
vnfResource.setModelVersionId(genericVnf.getModelVersionId());
resourceList.add(vnfResource);
traverseVnfModules(resourceList, vnfResource, aaiResourceIds, vnf);
if (vnf.getVolumeGroups() != null) {
for (org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup volumeGroup : vnf.getVolumeGroups()) {
aaiResourceIds.add(new Pair<>(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId()));
resourceList.add(new Resource(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId(), false, vnfResource));
}
}
}
}
use of org.onap.so.bpmn.infrastructure.workflow.tasks.Resource in project so by onap.
the class VnfEBBLoader method findVnfWithGivenId.
private void findVnfWithGivenId(ServiceInstance serviceInstanceMSO, String vnfId, List<Pair<WorkflowType, String>> aaiResourceIds, List<Resource> resourceList, Resource serviceResource, DelegateExecution execution) {
for (GenericVnf vnf : serviceInstanceMSO.getVnfs()) {
if (vnf.getVnfId().equals(vnfId)) {
aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId()));
Resource vnfResource = new Resource(WorkflowType.VNF, vnf.getVnfId(), false, serviceResource);
org.onap.aai.domain.yang.GenericVnf aaiGenericVnf = bbInputSetupUtils.getAAIGenericVnf(vnfId);
vnfResource.setModelCustomizationId(aaiGenericVnf.getModelCustomizationId());
vnfResource.setModelVersionId(aaiGenericVnf.getModelVersionId());
resourceList.add(vnfResource);
processVfModules(vnf, aaiResourceIds, resourceList, vnfResource, execution);
processVolumeGroups(vnf, aaiResourceIds, resourceList, vnfResource);
break;
}
}
}
use of org.onap.so.bpmn.infrastructure.workflow.tasks.Resource in project so by onap.
the class VnfEBBLoader method customTraverseAAIVnf.
public void customTraverseAAIVnf(DelegateExecution execution, List<Resource> resourceList, String serviceId, String vnfId, List<Pair<WorkflowType, String>> aaiResourceIds) {
try {
org.onap.aai.domain.yang.ServiceInstance serviceInstanceAAI = bbInputSetupUtils.getAAIServiceInstanceById(serviceId);
ServiceInstance serviceInstanceMSO = bbInputSetup.getExistingServiceInstance(serviceInstanceAAI);
Resource serviceResource = new Resource(WorkflowType.SERVICE, serviceInstanceMSO.getServiceInstanceId(), false, null);
resourceList.add(serviceResource);
if (serviceInstanceMSO.getVnfs() != null) {
findVnfWithGivenIdAndAddCustomizationUUID(serviceInstanceMSO, vnfId, aaiResourceIds, resourceList, serviceResource, execution);
}
} catch (Exception ex) {
logger.error("Exception in customTraverseAAIVnf", ex);
buildAndThrowException(execution, "Could not find existing Vnf or related Instances to execute the request on.");
}
}
use of org.onap.so.bpmn.infrastructure.workflow.tasks.Resource in project so by onap.
the class VnfEBBLoader method processVolumeGroups.
private void processVolumeGroups(GenericVnf vnf, List<Pair<WorkflowType, String>> aaiResourceIds, List<Resource> resourceList, Resource vnfResource) {
if (vnf.getVolumeGroups() != null) {
for (VolumeGroup volumeGroup : vnf.getVolumeGroups()) {
aaiResourceIds.add(new Pair<>(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId()));
resourceList.add(new Resource(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId(), false, vnfResource));
}
}
}
Aggregations