use of org.onap.so.bpmn.servicedecomposition.bbobjects.Customer in project so by onap.
the class SDNCDeactivateTasks method deactivateNetwork.
/**
* BPMN access method to invoke deactivate on a L3Network object
*
* @param execution
*/
public void deactivateNetwork(BuildingBlockExecution execution) {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
L3Network l3Network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
Customer customer = gBBInput.getCustomer();
RequestContext requestContext = gBBInput.getRequestContext();
CloudRegion cloudRegion = gBBInput.getCloudRegion();
GenericResourceApiNetworkOperationInformation req = sdncNetworkResources.deactivateNetwork(l3Network, serviceInstance, customer, requestContext, cloudRegion);
SDNCRequest sdncRequest = new SDNCRequest();
sdncRequest.setSDNCPayload(req);
sdncRequest.setTopology(SDNCTopology.NETWORK);
execution.setVariable(SDNC_REQUEST, sdncRequest);
} catch (Exception ex) {
logger.error("Exception occurred in SDNCDeactivateTasks deactivateNetwork", ex);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.Customer in project so by onap.
the class AAICreateTasks method createServiceSubscription.
/**
* This method is used for creating and subscribing the service in A&AI.
*
* @param execution
* @throws @return
*/
public void createServiceSubscription(BuildingBlockExecution execution) {
try {
ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
Customer customer = execution.getGeneralBuildingBlock().getCustomer();
if (null == customer) {
String errorMessage = "Exception in creating ServiceSubscription. Customer not present for ServiceInstanceID: " + serviceInstance.getServiceInstanceId();
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), errorMessage, "BPMN", ErrorCode.UnknownError.getValue(), errorMessage);
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, errorMessage);
}
aaiSIResources.createServiceSubscription(customer);
} catch (BpmnError ex) {
throw ex;
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.Customer in project so by onap.
the class BBInputSetupMapperLayerTest method testMapAAICustomer.
@Test
public void testMapAAICustomer() throws IOException {
Customer expected = mapper.readValue(new File(RESOURCE_PATH + "Customer.json"), Customer.class);
org.onap.aai.domain.yang.Customer customerAAI = mapper.readValue(new File(RESOURCE_PATH + "Customer_AAI.json"), org.onap.aai.domain.yang.Customer.class);
Customer actual = bbInputSetupMapperLayer.mapAAICustomer(customerAAI);
assertThat(actual, sameBeanAs(expected));
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.Customer in project so by onap.
the class BuildingBlockTestDataSetup method setAvpnCustomer.
public Customer setAvpnCustomer() {
Customer customer = buildCustomer();
gBBInput.setCustomer(customer);
return customer;
}
use of org.onap.so.bpmn.servicedecomposition.bbobjects.Customer in project so by onap.
the class BuildingBlockTestDataSetup method setCustomer.
public Customer setCustomer() {
if (gBBInput.getCustomer() != null)
return gBBInput.getCustomer();
Customer customer = new Customer();
customer.setGlobalCustomerId("testGlobalCustomerId");
customer.setSubscriberType("testSubscriberType");
customer.setServiceSubscription(buildServiceSubscription());
gBBInput.setCustomer(customer);
return customer;
}
Aggregations