Search in sources :

Example 11 with InstanceGroup

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

the class BBInputSetup method populateInstanceGroup.

protected void populateInstanceGroup(BBInputSetupParameter parameter) {
    InstanceGroup instanceGroup = new InstanceGroup();
    instanceGroup.setId(parameter.getInstanceGroupId());
    instanceGroup.setInstanceGroupName(parameter.getInstanceName());
    mapCatalogInstanceGroup(instanceGroup, parameter.getModelInfo(), parameter.getService());
    parameter.getServiceInstance().getInstanceGroups().add(instanceGroup);
}
Also used : InstanceGroup(org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup)

Example 12 with InstanceGroup

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

the class BBInputSetup method populateNetworkCollectionAndInstanceGroupAssign.

protected void populateNetworkCollectionAndInstanceGroupAssign(BBInputSetupParameter parameter) throws Exception {
    if (parameter.getServiceInstance().getCollection() == null && parameter.getBbName().equalsIgnoreCase(AssignFlows.NETWORK_COLLECTION.toString())) {
        Collection collection = this.createCollection(parameter.getResourceId());
        parameter.getServiceInstance().setCollection(collection);
        this.mapCatalogCollection(parameter.getService(), parameter.getServiceInstance().getCollection(), parameter.getKey());
        if (isVlanTagging(parameter.getService(), parameter.getKey())) {
            InstanceGroup instanceGroup = this.createInstanceGroup();
            parameter.getServiceInstance().getCollection().setInstanceGroup(instanceGroup);
            this.mapCatalogNetworkCollectionInstanceGroup(parameter.getService(), parameter.getServiceInstance().getCollection().getInstanceGroup(), parameter.getKey());
        }
    }
}
Also used : Collection(org.onap.so.bpmn.servicedecomposition.bbobjects.Collection) InstanceGroup(org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup)

Example 13 with InstanceGroup

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

the class BBInputSetup method createInstanceGroup.

protected InstanceGroup createInstanceGroup() {
    InstanceGroup instanceGroup = new InstanceGroup();
    String instanceGroupId = this.generateRandomUUID();
    instanceGroup.setId(instanceGroupId);
    return instanceGroup;
}
Also used : InstanceGroup(org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup)

Example 14 with InstanceGroup

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

the class BBInputSetup method mapNetworkCollectionInstanceGroup.

protected void mapNetworkCollectionInstanceGroup(GenericVnf genericVnf, String instanceGroupId) {
    org.onap.aai.domain.yang.InstanceGroup aaiInstanceGroup = bbInputSetupUtils.getAAIInstanceGroup(instanceGroupId);
    InstanceGroup instanceGroup = this.mapperLayer.mapAAIInstanceGroupIntoInstanceGroup(aaiInstanceGroup);
    instanceGroup.setModelInfoInstanceGroup(this.mapperLayer.mapCatalogInstanceGroupToInstanceGroup(null, this.bbInputSetupUtils.getCatalogInstanceGroup(aaiInstanceGroup.getModelVersionId())));
    genericVnf.getInstanceGroups().add(instanceGroup);
}
Also used : InstanceGroup(org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup)

Example 15 with InstanceGroup

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

the class NetworkTopologyOperationRequestMapperTest method before.

@Before
public void before() {
    // prepare and set service instance
    serviceInstance = new ServiceInstance();
    serviceInstanceNoCollection = new ServiceInstance();
    ModelInfoServiceInstance modelInfoServiceInstance = new ModelInfoServiceInstance();
    modelInfoServiceInstance.setModelInvariantUuid("modelInvariantUuid");
    modelInfoServiceInstance.setModelName("modelName");
    modelInfoServiceInstance.setModelUuid("modelUuid");
    modelInfoServiceInstance.setModelVersion("modelVersion");
    serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
    serviceInstanceNoCollection.setModelInfoServiceInstance(modelInfoServiceInstance);
    // prepare Customer object
    customer = new Customer();
    customer.setGlobalCustomerId("globalCustomerId");
    // serviceInstance.setCustomer(customer);
    // set Customer on service instance
    ServiceSubscription serviceSubscription = new ServiceSubscription();
    serviceSubscription.setServiceType("productFamilyId");
    customer.setServiceSubscription(serviceSubscription);
    // set Customer on service instance
    customer.getServiceSubscription().getServiceInstances().add(serviceInstance);
    customer.getServiceSubscription().getServiceInstances().add(serviceInstanceNoCollection);
    // 
    InstanceGroup networkInstanceGroup = new InstanceGroup();
    networkInstanceGroup.setId("networkInstanceGroupId");
    networkInstanceGroup.setInstanceGroupFunction("instanceGroupFunction");
    Collection networkCollection = new Collection();
    networkCollection.setInstanceGroup(networkInstanceGroup);
    serviceInstance.setCollection(networkCollection);
    // 
    requestContext = new RequestContext();
    Map<String, Object> userParams = new HashMap<>();
    userParams.put("key1", "value1");
    requestContext.setUserParams(userParams);
    requestContext.setProductFamilyId("productFamilyId");
    requestContext.setMsoRequestId("MsoRequestId");
    network = new L3Network();
    network.setNetworkId("TEST_NETWORK_ID");
    network.setNetworkName("TEST_NETWORK_NAME");
    ModelInfoNetwork modelInfoNetwork = new ModelInfoNetwork();
    modelInfoNetwork.setModelInvariantUUID("modelInvariantUuid");
    modelInfoNetwork.setModelName("modelName");
    modelInfoNetwork.setModelVersion("modelVersion");
    modelInfoNetwork.setModelUUID("modelUuid");
    modelInfoNetwork.setModelCustomizationUUID("modelCustomizationUUID");
    network.setModelInfoNetwork(modelInfoNetwork);
    cloudRegion = new CloudRegion();
}
Also used : L3Network(org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network) CloudRegion(org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion) Customer(org.onap.so.bpmn.servicedecomposition.bbobjects.Customer) HashMap(java.util.HashMap) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) InstanceGroup(org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup) ServiceSubscription(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription) ModelInfoNetwork(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoNetwork) Collection(org.onap.so.bpmn.servicedecomposition.bbobjects.Collection) RequestContext(org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) Before(org.junit.Before)

Aggregations

InstanceGroup (org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup)32 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)14 ModelInfoInstanceGroup (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup)13 Test (org.junit.Test)9 GenericVnf (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf)9 ModelInfoServiceInstance (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)9 Collection (org.onap.so.bpmn.servicedecomposition.bbobjects.Collection)8 BBObjectNotFoundException (org.onap.so.client.exception.BBObjectNotFoundException)7 ArrayList (java.util.ArrayList)6 Service (org.onap.so.db.catalog.beans.Service)4 AAIFluentTypeBuilder (org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder)3 Customer (org.onap.so.bpmn.servicedecomposition.bbobjects.Customer)3 ServiceSubscription (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceSubscription)3 ModelInfoCollection (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoCollection)3 CollectionResource (org.onap.so.db.catalog.beans.CollectionResource)3 NetworkCollectionResourceCustomization (org.onap.so.db.catalog.beans.NetworkCollectionResourceCustomization)3 HashMap (java.util.HashMap)2 Before (org.junit.Before)2 GenericResourceApiVnfOperationInformation (org.onap.sdnc.northbound.client.model.GenericResourceApiVnfOperationInformation)2 CloudRegion (org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion)2