Search in sources :

Example 56 with ServiceInstance

use of org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance in project so by onap.

the class TestDataSetup method setServiceInstance.

public ServiceInstance setServiceInstance() {
    ServiceInstance serviceInstance = buildServiceInstance();
    if (gBBInput.getCustomer() == null) {
        gBBInput.setCustomer(buildCustomer());
    }
    gBBInput.getCustomer().getServiceSubscription().getServiceInstances().add(serviceInstance);
    lookupKeyMap.put(ResourceKey.SERVICE_INSTANCE_ID, serviceInstance.getServiceInstanceId());
    return serviceInstance;
}
Also used : ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)

Example 57 with ServiceInstance

use of org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance in project so by onap.

the class TestDataSetup method setVpnBondingLink.

public VpnBondingLink setVpnBondingLink() {
    VpnBondingLink vpnBondingLink = buildVpnBondingLink();
    ServiceInstance serviceInstance = null;
    try {
        serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
    } catch (BBObjectNotFoundException e) {
        serviceInstance = setServiceInstance();
    }
    serviceInstance.getVpnBondingLinks().add(vpnBondingLink);
    lookupKeyMap.put(ResourceKey.VPN_BONDING_LINK_ID, vpnBondingLink.getVpnBondingLinkId());
    return vpnBondingLink;
}
Also used : BBObjectNotFoundException(org.onap.so.client.exception.BBObjectNotFoundException) VpnBondingLink(org.onap.so.bpmn.servicedecomposition.bbobjects.VpnBondingLink) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)

Example 58 with ServiceInstance

use of org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance in project so by onap.

the class TestDataSetup method setConfiguration.

public Configuration setConfiguration() {
    Configuration config = new Configuration();
    config.setConfigurationId("testConfigurationId");
    List<Configuration> configurations = new ArrayList<>();
    configurations.add(config);
    ServiceInstance serviceInstance = new ServiceInstance();
    try {
        serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
    } catch (BBObjectNotFoundException e) {
        serviceInstance = setServiceInstance();
    }
    lookupKeyMap.put(ResourceKey.CONFIGURATION_ID, "testConfigurationId");
    serviceInstance.setConfigurations(configurations);
    return config;
}
Also used : BBObjectNotFoundException(org.onap.so.client.exception.BBObjectNotFoundException) Configuration(org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration) ModelInfoConfiguration(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoConfiguration) ArrayList(java.util.ArrayList) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)

Example 59 with ServiceInstance

use of org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance in project so by onap.

the class TestDataSetup method setGenericVnf.

public GenericVnf setGenericVnf() {
    GenericVnf genericVnf = buildGenericVnf();
    ServiceInstance serviceInstance = null;
    try {
        serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
    } catch (BBObjectNotFoundException e) {
        serviceInstance = setServiceInstance();
    }
    serviceInstance.getVnfs().add(genericVnf);
    lookupKeyMap.put(ResourceKey.GENERIC_VNF_ID, genericVnf.getVnfId());
    return genericVnf;
}
Also used : BBObjectNotFoundException(org.onap.so.client.exception.BBObjectNotFoundException) ModelInfoGenericVnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf) GenericVnf(org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)

Example 60 with ServiceInstance

use of org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance in project so by onap.

the class AAIServiceInstanceResources method updateOrchestrationStatusServiceInstance.

public void updateOrchestrationStatusServiceInstance(ServiceInstance serviceInstance, OrchestrationStatus orchestrationStatus) {
    ServiceInstance copiedServiceInstance = serviceInstance.shallowCopyId();
    copiedServiceInstance.setOrchestrationStatus(orchestrationStatus);
    copiedServiceInstance.setServiceInstanceName(serviceInstance.getServiceInstanceName());
    serviceInstance.setOrchestrationStatus(orchestrationStatus);
    updateServiceInstance(copiedServiceInstance);
}
Also used : ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)

Aggregations

ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)228 Test (org.junit.Test)118 ModelInfoServiceInstance (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)110 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)84 RequestContext (org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext)70 GeneralBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock)61 CloudRegion (org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion)54 Customer (org.onap.so.bpmn.servicedecomposition.bbobjects.Customer)53 VfModule (org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule)51 HashMap (java.util.HashMap)50 Service (org.onap.so.db.catalog.beans.Service)46 BBObjectNotFoundException (org.onap.so.client.exception.BBObjectNotFoundException)40 L3Network (org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network)38 ResourceKey (org.onap.so.bpmn.servicedecomposition.entities.ResourceKey)37 RequestDetails (org.onap.so.serviceinstancebeans.RequestDetails)35 ModelInfoGenericVnf (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoGenericVnf)33 ModelInfoVfModule (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoVfModule)33 File (java.io.File)31 OrchestrationContext (org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext)25 ModelInfo (org.onap.so.serviceinstancebeans.ModelInfo)24