use of org.onap.so.db.catalog.beans.PnfResourceCustomization in project so by onap.
the class PnfCustomizationRepositoryTest method findById_ValidUuid_ExpectedOutput.
@Test
public void findById_ValidUuid_ExpectedOutput() throws Exception {
PnfResourceCustomization pnfResourceCustomization = pnfCustomizationRepository.findById("68dc9a92-214c-11e7-93ae-92361f002680").orElseThrow(() -> new NoEntityFoundException("Cannot Find Operation"));
checkPnfResourceCustomization(pnfResourceCustomization);
}
use of org.onap.so.db.catalog.beans.PnfResourceCustomization in project so by onap.
the class NfSoftwareUpgradeDispatcher method execute.
@Override
public void execute(DelegateExecution delegateExecution) throws Exception {
logger.debug("Running execute block for activity id: {}, name: {}", delegateExecution.getCurrentActivityId(), delegateExecution.getCurrentActivityName());
RequestDetails bpmnRequestDetails = requestVerification(delegateExecution);
final String serviceInstanceName = bpmnRequestDetails.getRequestInfo().getInstanceName();
final String pnfName = bpmnRequestDetails.getRequestParameters().getUserParamValue(PNF_NAME);
final String serviceModelUuid = bpmnRequestDetails.getModelInfo().getModelUuid();
final List<Map<String, Object>> userParams = bpmnRequestDetails.getRequestParameters().getUserParams();
final Pnf pnf = getPnfByPnfName(delegateExecution, pnfName);
final List<PnfResourceCustomization> pnfCustomizations = getPnfResourceCustomizations(delegateExecution, serviceModelUuid);
final PnfResourceCustomization pnfResourceCustomization = pnfCustomizations.get(0);
final String payload = bpmnRequestDetails.getRequestParameters().getPayload();
populateExecution(delegateExecution, bpmnRequestDetails, pnfResourceCustomization, pnf, serviceInstanceName, pnfName, serviceModelUuid, userParams, payload);
logger.trace("Completed preProcessRequest PnfSoftwareUpgradeServiceRequest Request ");
}
use of org.onap.so.db.catalog.beans.PnfResourceCustomization in project so by onap.
the class NfSoftwareUpgradeDispatcherTest method buildPnfResourceCustomization.
private PnfResourceCustomization buildPnfResourceCustomization() {
PnfResourceCustomization pnfResourceCustomization = new PnfResourceCustomization();
pnfResourceCustomization.setSkipPostInstConf(true);
pnfResourceCustomization.setBlueprintName(TEST_PNF_RESOURCE_BLUEPRINT_NAME);
pnfResourceCustomization.setBlueprintVersion(TEST_PNF_RESOURCE_BLUEPRINT_VERSION);
pnfResourceCustomization.setModelInstanceName(TEST_PNF_RESOURCE_INSTANCE_NAME);
pnfResourceCustomization.setModelCustomizationUUID(TEST_PNF_RESOURCE_CUSTOMIZATION_UUID);
pnfResourceCustomization.setControllerActor(TEST_PRC_CONTROLLER_ACTOR);
return pnfResourceCustomization;
}
use of org.onap.so.db.catalog.beans.PnfResourceCustomization in project so by onap.
the class SkipCDSBuildingBlockListenerTest method before.
@Before
public void before() {
executeBuildingBlock = new ExecuteBuildingBlock();
buildingBlock = new BuildingBlock();
ArrayList<Resource> resources = new ArrayList<>();
Resource service = new Resource(WorkflowType.SERVICE, SERVICE_MODEL_VERSION_ID, false, null);
service.setModelVersionId(SERVICE_MODEL_VERSION_ID);
resources.add(service);
Resource vnf = new Resource(WorkflowType.VNF, VNF_MODEL_CUSTOMIZATION_ID, false, null);
vnf.setModelCustomizationId(VNF_MODEL_CUSTOMIZATION_ID);
resources.add(vnf);
Resource vfModule = new Resource(WorkflowType.VFMODULE, VF_MODULE_CUSTOMIZATION_ID, false, null);
vfModule.setModelCustomizationId(VF_MODULE_CUSTOMIZATION_ID);
resources.add(vfModule);
Resource pnf = new Resource(WorkflowType.PNF, PNF_CUSTOMIZATION_ID, false, null);
pnf.setModelCustomizationId(PNF_CUSTOMIZATION_ID);
resources.add(pnf);
buildingBlockExecution.setVariable("resources", resources);
vnfCust = new VnfResourceCustomization();
vfCust = new VfModuleCustomization();
pnfResourceCustomization = new PnfResourceCustomization();
}
use of org.onap.so.db.catalog.beans.PnfResourceCustomization in project so by onap.
the class ConfigCheckerDelegate method execute.
@Override
public void execute(DelegateExecution delegateExecution) throws Exception {
logger.debug("Running execute block for activity id:{}, name:{}", delegateExecution.getCurrentActivityId(), delegateExecution.getCurrentActivityName());
if (delegateExecution.hasVariable(SERVICE_MODEL_INFO)) {
String serviceModelInfo = (String) delegateExecution.getVariable(SERVICE_MODEL_INFO);
String serviceModelUuid = JsonUtils.getJsonValue(serviceModelInfo, MODEL_UUID);
delegateExecution.setVariable(MODEL_UUID, serviceModelUuid);
List<PnfResourceCustomization> pnfCustomizations = catalogDbClient.getPnfResourceCustomizationByModelUuid(serviceModelUuid);
if (pnfCustomizations != null && !pnfCustomizations.isEmpty()) {
PnfResourceCustomization pnfResourceCustomization = pnfCustomizations.get(0);
boolean skipPostInstantiationConfiguration = pnfResourceCustomization.getSkipPostInstConf();
delegateExecution.setVariable(SKIP_POST_INSTANTIATION_CONFIGURATION, skipPostInstantiationConfiguration);
delegateExecution.setVariable(PRC_BLUEPRINT_NAME, pnfResourceCustomization.getBlueprintName());
delegateExecution.setVariable(PRC_BLUEPRINT_VERSION, pnfResourceCustomization.getBlueprintVersion());
delegateExecution.setVariable(PRC_CUSTOMIZATION_UUID, pnfResourceCustomization.getModelCustomizationUUID());
delegateExecution.setVariable(PRC_INSTANCE_NAME, pnfResourceCustomization.getModelInstanceName());
delegateExecution.setVariable(PRC_CONTROLLER_ACTOR, pnfResourceCustomization.getControllerActor());
} else {
logger.warn("Unable to find the PNF resource customizations of model service UUID: {}", serviceModelUuid);
exceptionUtil.buildAndThrowWorkflowException(delegateExecution, ERROR_CODE, "Unable to find the PNF resource customizations of model service UUID: " + serviceModelUuid);
}
} else {
logger.warn("Unable to find the parameter: {} in the execution context", SERVICE_MODEL_INFO);
exceptionUtil.buildAndThrowWorkflowException(delegateExecution, ERROR_CODE, "Unable to find parameter " + SERVICE_MODEL_INFO);
}
}
Aggregations