diff options
Diffstat (limited to 'bpmn')
10 files changed, 418 insertions, 35 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index c7665acc68..9a39334af1 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -150,6 +150,17 @@ public class BBInputSetup implements JavaDelegate { this.mapperLayer = mapperLayer; } + /** + * This method is used for executing the building block. + * + * It will get the BB from the execution object by checking if the aLaCarte and homing is true. + * + * Then it will get the GBB and execute it. + * + * @param execution + * @throws Exception + * @return + */ @Override public void execute(DelegateExecution execution) throws Exception { try { @@ -1538,6 +1549,14 @@ public class BBInputSetup implements JavaDelegate { return serviceInstance; } + /** + * This method is used for getting the existing service instance. + * + * This will map the serviceInstanceAAI to serviceInstance and return the serviceInstance. + * + * @throws Exception + * @return serviceInstance + */ public ServiceInstance getExistingServiceInstance(org.onap.aai.domain.yang.ServiceInstance serviceInstanceAAI) throws Exception { ServiceInstance serviceInstance = mapperLayer.mapAAIServiceInstanceIntoServiceInstance(serviceInstanceAAI); diff --git a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/BaseTaskTest.java b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/BaseTaskTest.java index 49f373c01e..a9f33f20c5 100644 --- a/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/BaseTaskTest.java +++ b/bpmn/MSOCoreBPMN/src/test/java/org/onap/so/bpmn/core/BaseTaskTest.java @@ -38,9 +38,9 @@ public class BaseTaskTest { private String anyValueString = "anyValue"; private String badValueString = "123abc"; private int anyValueInt = 123; - private Integer anyValueInteger = new Integer(anyValueInt); + private Integer anyValueInteger = Integer.valueOf(anyValueInt); private long anyValuelong = 123L; - private Long anyValueLong = new Long(anyValuelong); + private Long anyValueLong = Long.valueOf(anyValuelong); private DelegateExecution mockExecution; private Expression mockExpression; @@ -113,7 +113,7 @@ public class BaseTaskTest { assertEquals(anyValueString, obj1.toString()); expectedException.expect(MissingInjectedFieldException.class); - Object objectBoolean = new Boolean(true); // bad data + Object objectBoolean = Boolean.valueOf(true); // bad data when(mockExpression.getValue(mockExecution)).thenReturn(objectBoolean); obj2 = baseTask.getStringField(null, mockExecution, anyVariable); } @@ -134,7 +134,7 @@ public class BaseTaskTest { @Test public void testGetIntegerFieldAndMissingInjectedFieldException() throws Exception { - objectInteger = new Integer(anyValueInt); + objectInteger = Integer.valueOf(anyValueInt); when(mockExpression.getValue(mockExecution)).thenReturn(objectInteger); obj1 = baseTask.getIntegerField(mockExpression, mockExecution, anyVariable); assertEquals(anyValueInteger, (Integer) obj1); @@ -154,7 +154,7 @@ public class BaseTaskTest { @Test public void testGetOptionalIntegerField() throws Exception { - objectInteger = new Integer(anyValueInt); + objectInteger = Integer.valueOf(anyValueInt); when(mockExpression.getValue(mockExecution)).thenReturn(objectInteger); obj1 = baseTask.getOptionalIntegerField(mockExpression, mockExecution, anyVariable); assertEquals(anyValueInteger, (Integer) obj1); @@ -163,14 +163,14 @@ public class BaseTaskTest { @Test public void testGetOptionalIntegerFieldAndBadInjectedFieldException() throws Exception { expectedException.expect(BadInjectedFieldException.class); - objectBoolean = new Boolean(true); + objectBoolean = Boolean.valueOf(true); when(mockExpression.getValue(mockExecution)).thenReturn(objectBoolean); obj1 = baseTask.getOptionalIntegerField(mockExpression, mockExecution, anyVariable); } @Test public void testGetLongFieldAndMissingInjectedFieldException() throws Exception { - objectLong = new Long(anyValuelong); + objectLong = Long.valueOf(anyValuelong); when(mockExpression.getValue(mockExecution)).thenReturn(objectLong); obj1 = baseTask.getLongField(mockExpression, mockExecution, anyVariable); assertEquals(anyValueLong, (Long) obj1); @@ -189,7 +189,7 @@ public class BaseTaskTest { @Test public void testGetOptionalLongField() throws Exception { - objectLong = new Long(anyValuelong); + objectLong = Long.valueOf(anyValuelong); when(mockExpression.getValue(mockExecution)).thenReturn(objectLong); obj1 = baseTask.getOptionalLongField(mockExpression, mockExecution, anyVariable); assertEquals(anyValueLong, (Long) obj1); @@ -198,7 +198,7 @@ public class BaseTaskTest { @Test public void testGetOptionalLongFieldAndBadInjectedFieldException() throws Exception { expectedException.expect(BadInjectedFieldException.class); - objectBoolean = new Boolean(true); + objectBoolean = Boolean.valueOf(true); when(mockExpression.getValue(mockExecution)).thenReturn(objectBoolean); obj1 = baseTask.getOptionalLongField(mockExpression, mockExecution, anyVariable); } @@ -233,7 +233,7 @@ public class BaseTaskTest { @Test public void testGetOptionalOutputFieldAndBadInjectedFieldException() throws Exception { expectedException.expect(BadInjectedFieldException.class); - objectBoolean = new Boolean(true); + objectBoolean = Boolean.valueOf(true); when(mockExpression.getValue(mockExecution)).thenReturn(objectBoolean); obj1 = baseTask.getOptionalOutputField(mockExpression, mockExecution, anyVariable); } diff --git a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java index 39a8995607..f3527fad7d 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java +++ b/bpmn/mso-infrastructure-bpmn/src/test/java/org/onap/so/bpmn/common/OofHomingTestIT.java @@ -60,7 +60,6 @@ public class OofHomingTestIT extends BaseIntegrationTest { Logger logger = LoggerFactory.getLogger(CreateAAIVfModuleIT.class); ServiceDecomposition serviceDecomposition = new ServiceDecomposition(); - String subscriber = ""; String subscriber2 = ""; private final CallbackSet callbacks = new CallbackSet(); @@ -208,8 +207,6 @@ public class OofHomingTestIT extends BaseIntegrationTest { serviceDecomposition.setServiceInstance(si); // Subscriber - subscriber = - "{\"globalSubscriberId\": \"SUB12_0322_DS_1201\",\"subscriberCommonSiteId\": \"DALTX0101\",\"subscriberName\": \"SUB_12_0322_DS_1201\"}"; subscriber2 = "{\"globalSubscriberId\": \"SUB12_0322_DS_1201\",\"subscriberName\": \"SUB_12_0322_DS_1201\"}"; } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java index 583e3e172a..68cfd487b3 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java @@ -104,6 +104,14 @@ public class AAICreateTasks { @Autowired private Environment env; + /** + * This method is used for creating the service instance in A&AI. + * + * It will check the alaCarte and create the service instance in A&AI. + * + * @param execution + * @throws @return + */ public void createServiceInstance(BuildingBlockExecution execution) { try { ServiceInstance serviceInstance = @@ -115,6 +123,12 @@ public class AAICreateTasks { } } + /** + * 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 = @@ -136,6 +150,12 @@ public class AAICreateTasks { } } + /** + * This method is used for creation of the project A&AI. + * + * @param execution + * @throws @return + */ public void createProject(BuildingBlockExecution execution) { try { ServiceInstance serviceInstance = @@ -153,6 +173,12 @@ public class AAICreateTasks { } } + /** + * This method is used for creating OwningEntity A&AI. + * + * @param execution + * @throws @return + */ public void createOwningEntity(BuildingBlockExecution execution) { try { ServiceInstance serviceInstance = @@ -192,6 +218,16 @@ public class AAICreateTasks { } } + /** + * This method is used for creating Vnf in A&AI. + * + * It will check if the Vnf Name is exits in A&AI then it will throw the duplicate name exception. + * + * Otherwise it will create the vnf amd connect to the serviceinstance. + * + * @param execution + * @throws @return + */ public void createVnf(BuildingBlockExecution execution) { try { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); @@ -204,6 +240,12 @@ public class AAICreateTasks { } } + /** + * This method is used for separating (,) from the string. + * + * @param str + * @throws @return + */ public void createPlatform(BuildingBlockExecution execution) { try { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); @@ -223,10 +265,22 @@ public class AAICreateTasks { } + /** + * This method is used for separating (,) from the string. + * + * @param str + * @throws @return + */ public List<String> splitCDL(String str) { return Stream.of(str.split(",")).map(String::trim).map(elem -> new String(elem)).collect(Collectors.toList()); } + /** + * This method is used for creating the type of business in A&AI. + * + * @param execution + * @throws @return + */ public void createLineOfBusiness(BuildingBlockExecution execution) { try { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); @@ -246,6 +300,12 @@ public class AAICreateTasks { } } + /** + * This method is used for creating the volume group in A&AI. + * + * @param execution + * @throws @return + */ public void createVolumeGroup(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); @@ -261,6 +321,12 @@ public class AAICreateTasks { } } + /** + * This method is used for creating the vfModule in A&AI. + * + * @param execution + * @throws @return + */ public void createVfModule(BuildingBlockExecution execution) { try { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); @@ -279,7 +345,7 @@ public class AAICreateTasks { /** * BPMN access method to establish relationships in AAI - * + * * @param execution * @throws Exception */ @@ -304,7 +370,7 @@ public class AAICreateTasks { /** * BPMN access method to execute Create L3Network operation (PUT )in AAI - * + * * @param execution * @throws Exception */ @@ -325,6 +391,12 @@ public class AAICreateTasks { } } + /** + * This method is used for creating the customer in A&AI. + * + * @param execution + * @throws Exception + */ public void createCustomer(BuildingBlockExecution execution) throws Exception { try { Customer customer = execution.getGeneralBuildingBlock().getCustomer(); @@ -337,7 +409,7 @@ public class AAICreateTasks { /** * BPMN access method to execute NetworkCollection operation (PUT) in AAI - * + * * @param execution * @throws Exception */ @@ -357,7 +429,7 @@ public class AAICreateTasks { /** * BPMN access method to execute NetworkCollectionInstanceGroup operation (PUT) in AAI - * + * * @param execution * @throws Exception */ @@ -378,7 +450,7 @@ public class AAICreateTasks { /** * BPMN access method to establish relationships in AAI - * + * * @param execution * @throws Exception */ @@ -393,7 +465,7 @@ public class AAICreateTasks { /** * BPMN access method to establish relationships in AAI - * + * * @param execution * @throws Exception */ @@ -409,7 +481,7 @@ public class AAICreateTasks { /** * BPMN access method to establish relationships in AAI - * + * * @param execution * @throws Exception */ @@ -432,7 +504,7 @@ public class AAICreateTasks { /** * BPMN access method to establish relationships in AAI - * + * * @param execution * @throws Exception */ @@ -447,7 +519,7 @@ public class AAICreateTasks { /** * BPMN access method to establish relationships in AAI - * + * * @param execution * @throws Exception */ @@ -464,7 +536,7 @@ public class AAICreateTasks { /** * BPMN access method to establish relationships in AAI - * + * * @param execution * @throws Exception */ @@ -482,6 +554,11 @@ public class AAICreateTasks { } } + /** + * This method is used for configuring the service in A&AI. + * + * @param execution @throws + */ public void createConfiguration(BuildingBlockExecution execution) { try { Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID); @@ -491,6 +568,11 @@ public class AAICreateTasks { } } + /** + * This method is used for creating vnf instance group in A&AI. + * + * @param execution @throws + */ public void createInstanceGroupVnf(BuildingBlockExecution execution) { try { ServiceInstance serviceInstance = @@ -502,6 +584,11 @@ public class AAICreateTasks { } } + /** + * This method is used to put the network policy in A&AI. + * + * @param execution @throws + */ public void createNetworkPolicies(BuildingBlockExecution execution) { try { String fqdns = execution.getVariable(CONTRAIL_NETWORK_POLICY_FQDN_LIST); @@ -536,10 +623,10 @@ public class AAICreateTasks { /** * Groups existing vf modules by the model uuid of our new vf module and returns the lowest unused index - * + * * if we have a module type A, and there are 3 instances of those, and then module type B has 2 instances, if we are * adding a new module type A, the vf-module-index should be 3 assuming contiguous indices (not 5, or 2) - * + * */ protected int getLowestUnusedVfModuleIndexFromAAIVnfResponse(GenericVnf genericVnf, VfModule newVfModule) { diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java index 01bdc09419..20f4443291 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java @@ -79,6 +79,11 @@ public class AAIUpdateTasks { @Autowired private AAIConfigurationResources aaiConfigurationResources; + /** + * BPMN access method to update the status of Service to Assigned in AAI + * + * @param execution + */ public void updateOrchestrationStatusAssignedService(BuildingBlockExecution execution) { try { ServiceInstance serviceInstance = @@ -91,6 +96,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of Service to Active in AAI + * + * @param execution + */ public void updateOrchestrationStatusActiveService(BuildingBlockExecution execution) { try { ServiceInstance serviceInstance = @@ -102,6 +112,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of Vnf to Assigned in AAI + * + * @param execution + */ public void updateOrchestrationStatusAssignedVnf(BuildingBlockExecution execution) { try { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); @@ -111,6 +126,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of Vnf to Active in AAI + * + * @param execution + */ public void updateOrchestrationStatusActiveVnf(BuildingBlockExecution execution) { try { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); @@ -120,6 +140,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of VolumeGroup to Assigned in AAI + * + * @param execution + */ public void updateOrchestrationStatusAssignedVolumeGroup(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); @@ -134,6 +159,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of VolumeGroup to Active in AAI + * + * @param execution + */ public void updateOrchestrationStatusActiveVolumeGroup(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); @@ -148,6 +178,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of VolumeGroup to Created in AAI + * + * @param execution + */ public void updateOrchestrationStatusCreatedVolumeGroup(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); @@ -162,6 +197,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update HeatStackId and VolumeGroup in AAI + * + * @param execution + */ public void updateHeatStackIdVolumeGroup(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); @@ -179,6 +219,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of VfModule to Assigned in AAI + * + * @param execution + */ public void updateOrchestrationStatusAssignedVfModule(BuildingBlockExecution execution) { try { VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); @@ -190,6 +235,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of VfModule to PendingActivation in AAI + * + * @param execution + */ public void updateOrchestrationStatusPendingActivationVfModule(BuildingBlockExecution execution) { try { VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); @@ -201,6 +251,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of VfModule to AssignedOrPendingActivation in AAI + * + * @param execution + */ public void updateOrchestrationStatusAssignedOrPendingActivationVfModule(BuildingBlockExecution execution) { try { VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); @@ -222,6 +277,12 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of VfModule to Created in AAI + * + * @param execution + * + */ public void updateOrchestrationStatusCreatedVfModule(BuildingBlockExecution execution) { try { VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); @@ -232,6 +293,12 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update aaiDeactivateVfModuleRollback to true for deactivating the VfModule + * + * @param execution + * @throws buildAndThrowWorkflowException + */ public void updateOrchestrationStatusDeactivateVfModule(BuildingBlockExecution execution) { execution.setVariable("aaiDeactivateVfModuleRollback", false); try { @@ -246,7 +313,7 @@ public class AAIUpdateTasks { /** * BPMN access method to update status of L3Network to Assigned in AAI - * + * * @param execution * @throws BBObjectNotFoundException */ @@ -256,7 +323,7 @@ public class AAIUpdateTasks { /** * BPMN access method to update status of L3Network to Active in AAI - * + * * @param execution * @throws BBObjectNotFoundException */ @@ -266,7 +333,7 @@ public class AAIUpdateTasks { /** * BPMN access method to update status of L3Network to Created in AAI - * + * * @param execution * @throws BBObjectNotFoundException */ @@ -302,7 +369,7 @@ public class AAIUpdateTasks { /** * BPMN access method to update status of L3Network Collection to Active in AAI - * + * * @param execution * @throws BBObjectNotFoundException */ @@ -323,6 +390,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of VfModule to Active in AAI + * + * @param execution + */ public void updateOrchestrationStatusActivateVfModule(BuildingBlockExecution execution) { execution.setVariable("aaiActivateVfModuleRollback", false); try { @@ -335,6 +407,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update HeatStackId of VfModule in AAI + * + * @param execution + */ public void updateHeatStackIdVfModule(BuildingBlockExecution execution) { try { String heatStackId = execution.getVariable("heatStackId"); @@ -352,7 +429,7 @@ public class AAIUpdateTasks { /** * BPMN access method to update L3Network after it was created in cloud - * + * * @param execution * @throws Exception */ @@ -395,7 +472,7 @@ public class AAIUpdateTasks { /** * BPMN access method to update L3Network after it was updated in cloud - * + * * @param execution * @throws Exception */ @@ -422,6 +499,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update L3Network Object + * + * @param execution + */ public void updateObjectNetwork(BuildingBlockExecution execution) { try { L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID); @@ -433,7 +515,7 @@ public class AAIUpdateTasks { /** * BPMN access method to update ServiceInstance - * + * * @param execution */ public void updateServiceInstance(BuildingBlockExecution execution) { @@ -446,6 +528,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update Vnf Object + * + * @param execution + */ public void updateObjectVnf(BuildingBlockExecution execution) { try { GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); @@ -455,6 +542,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of VfModuleRollback as true + * + * @param execution + */ public void updateOrchestrationStatusDeleteVfModule(BuildingBlockExecution execution) { execution.setVariable("aaiDeleteVfModuleRollback", false); try { @@ -471,6 +563,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update Model of VfModule + * + * @param execution + */ public void updateModelVfModule(BuildingBlockExecution execution) { try { VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); @@ -481,6 +578,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of FabricConfiguration to Assigned in AAI + * + * @param execution + */ public void updateOrchestrationStatusAssignFabricConfiguration(BuildingBlockExecution execution) { try { Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID); @@ -491,6 +593,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of FabricConfiguration to Active in AAI + * + * @param execution + */ public void updateOrchestrationStatusActivateFabricConfiguration(BuildingBlockExecution execution) { try { Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID); @@ -500,6 +607,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of FabricConfiguration to deactive in AAI + * + * @param execution + */ public void updateOrchestrationStatusDeactivateFabricConfiguration(BuildingBlockExecution execution) { try { Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID); @@ -510,6 +622,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update Ipv4OamAddress of Vnf + * + * @param execution + */ public void updateIpv4OamAddressVnf(BuildingBlockExecution execution) { try { String ipv4OamAddress = execution.getVariable("oamManagementV4Address"); @@ -527,6 +644,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update ManagementV6Address of Vnf + * + * @param execution + */ public void updateManagementV6AddressVnf(BuildingBlockExecution execution) { try { String managementV6Address = execution.getVariable("oamManagementV6Address"); @@ -544,6 +666,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update ContrailServiceInstanceFqdn of VfModule + * + * @param execution + */ public void updateContrailServiceInstanceFqdnVfModule(BuildingBlockExecution execution) { try { String contrailServiceInstanceFqdn = execution.getVariable("contrailServiceInstanceFqdn"); @@ -558,6 +685,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of Vnf to ConfigAssigned in AAI + * + * @param execution + */ public void updateOrchestrationStatusConfigAssignedVnf(BuildingBlockExecution execution) { try { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); @@ -567,6 +699,11 @@ public class AAIUpdateTasks { } } + /** + * BPMN access method to update status of Vnf to Configure in AAI + * + * @param execution + */ public void updateOrchestrationStausConfigDeployConfigureVnf(BuildingBlockExecution execution) { try { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); @@ -578,6 +715,11 @@ public class AAIUpdateTasks { } + /** + * BPMN access method to update status of Vnf to configured in AAI + * + * @param execution + */ public void updateOrchestrationStausConfigDeployConfiguredVnf(BuildingBlockExecution execution) { try { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java index b257e91165..9396f9dbfc 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java @@ -59,6 +59,12 @@ public class VnfAdapterCreateTasks { @Autowired private ExceptionBuilder exceptionUtil; + /** + * This method is used for creating the request for the VolumeGroup. + * + * @param execution + * @return + */ public void createVolumeGroupRequest(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); @@ -93,6 +99,12 @@ public class VnfAdapterCreateTasks { } + /** + * This method is used for creating the request for the VfModule. + * + * @param execution + * @return + */ public void createVfModule(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java index ab2647a68d..1dcdfa912c 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java @@ -52,6 +52,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; +/* + * This class is used for creating the service instance, assigning vnf, assigning the Vfmodule & assigning the L3Network + * on SDNC. + */ @Component public class SDNCAssignTasks extends AbstractSDNCTask { private static final Logger logger = LoggerFactory.getLogger(SDNCAssignTasks.class); @@ -71,6 +75,13 @@ public class SDNCAssignTasks extends AbstractSDNCTask { @Autowired private Environment env; + /** + * BPMN access method to assigning the service instance in SDNC. + * + * It will assign the service instance by the service instance id. + * + * @param execution + */ public void assignServiceInstance(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); @@ -89,6 +100,13 @@ public class SDNCAssignTasks extends AbstractSDNCTask { } } + /** + * BPMN access method to assigning the vnf in SDNC. + * + * It will assign the vnf according to the service instance id and vnf id. + * + * @param execution + */ public void assignVnf(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); @@ -111,6 +129,13 @@ public class SDNCAssignTasks extends AbstractSDNCTask { } } + /** + * BPMN access method to assigning the vfModule in SDNC. + * + * It will assign the VfModule by the service instance id ,Vnf id and module id. + * + * @param execution + */ public void assignVfModule(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java index 9bbe94a077..7478479a86 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java @@ -39,6 +39,9 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +/** + * This class is used for quering the SDNC + */ @Component public class SDNCQueryTasks { private static final Logger logger = LoggerFactory.getLogger(SDNCQueryTasks.class); @@ -53,6 +56,14 @@ public class SDNCQueryTasks { @Autowired private ExtractPojosForBB extractPojosForBB; + /** + * BPMN access method to query the SDNC for fetching the vnf details. + * + * It will get the vnf details according to service instance id. + * + * @param execution + * @throws Exception + */ public void queryVnf(BuildingBlockExecution execution) throws Exception { ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); @@ -77,7 +88,14 @@ public class SDNCQueryTasks { } } - + /** + * BPMN access method to query the SDNC for fetching the VfModule details. + * + * It will get the vnf details according to service instance id, vnf id & Vf module id. + * + * @param execution + * @throws Exception + */ public void queryVfModule(BuildingBlockExecution execution) throws Exception { ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); @@ -108,6 +126,13 @@ public class SDNCQueryTasks { } } + /** + * BPMN access method to query the SDNC for fetching the VfModuleForVolumeGroup details. + * + * It will get the vnf details according to Vf module id. + * + * @param execution @throws + */ public void queryVfModuleForVolumeGroup(BuildingBlockExecution execution) { try { VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java index 4fcacb3c42..7eaf011c75 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java @@ -63,6 +63,11 @@ public class OrchestrationStatusValidator { @Autowired private CatalogDbClient catalogDbClient; + /** + * This method validate's the status of the OrchestrationStatus against the buildingBlockDetail ResourceType + * + * @param execution + */ public void validateOrchestrationStatus(BuildingBlockExecution execution) { try { OrchestrationStatusValidationDirective previousOrchestrationStatusValidationResult = diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java index 12aae1e6a6..6434bfb176 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java @@ -50,6 +50,17 @@ public class SDNCVnfResources { @Autowired private SDNCClient sdncClient; + /** + * This method is used for setting the SDNCSvcAction for assignVnf . + * + * @param vnf + * @param serviceInstance + * @param customer + * @param cloudRegion + * @param requestContext + * @param homing + * @return + */ public GenericResourceApiVnfOperationInformation assignVnf(GenericVnf vnf, ServiceInstance serviceInstance, Customer customer, CloudRegion cloudRegion, RequestContext requestContext, boolean homing, URI callbackURI) { @@ -58,6 +69,17 @@ public class SDNCVnfResources { cloudRegion, requestContext, homing, callbackURI); } + /** + * This method is used for setting the SDNCSvcAction for activate vnf. + * + * @param vnf + * @param serviceInstance + * @param customer + * @param cloudRegion + * @param requestContext + * @param homing + * @return + */ public GenericResourceApiVnfOperationInformation activateVnf(GenericVnf vnf, ServiceInstance serviceInstance, Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) { return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.ACTIVATE, @@ -65,7 +87,17 @@ public class SDNCVnfResources { cloudRegion, requestContext, false, callbackURI); } - + /** + * This method is used for setting the SDNCSvcAction for deactivate vnf. + * + * @param vnf + * @param serviceInstance + * @param customer + * @param cloudRegion + * @param requestContext + * @param homing + * @return + */ public GenericResourceApiVnfOperationInformation deactivateVnf(GenericVnf vnf, ServiceInstance serviceInstance, Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) { return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.DEACTIVATE, @@ -73,7 +105,17 @@ public class SDNCVnfResources { cloudRegion, requestContext, false, callbackURI); } - + /** + * This method is used for setting the SDNCSvcAction for unassign vnf. + * + * @param vnf + * @param serviceInstance + * @param customer + * @param cloudRegion + * @param requestContext + * @param homing + * @return + */ public GenericResourceApiVnfOperationInformation unassignVnf(GenericVnf vnf, ServiceInstance serviceInstance, Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) { return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.UNASSIGN, @@ -81,6 +123,17 @@ public class SDNCVnfResources { cloudRegion, requestContext, false, callbackURI); } + /** + * This method is used for setting the SDNCSvcAction for delete vnf. + * + * @param vnf + * @param serviceInstance + * @param customer + * @param cloudRegion + * @param requestContext + * @param homing + * @return + */ public GenericResourceApiVnfOperationInformation deleteVnf(GenericVnf vnf, ServiceInstance serviceInstance, Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) { return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.DEACTIVATE, @@ -88,6 +141,17 @@ public class SDNCVnfResources { cloudRegion, requestContext, false, callbackURI); } + /** + * This method is used for setting the SDNCSvcAction for changeModelVnf. + * + * @param vnf + * @param serviceInstance + * @param customer + * @param cloudRegion + * @param requestContext + * @param homing + * @return + */ public GenericResourceApiVnfOperationInformation changeModelVnf(GenericVnf vnf, ServiceInstance serviceInstance, Customer customer, CloudRegion cloudRegion, RequestContext requestContext, URI callbackURI) { return sdncRM.reqMapper(SDNCSvcOperation.VNF_TOPOLOGY_OPERATION, SDNCSvcAction.CHANGE_ASSIGN, @@ -95,6 +159,13 @@ public class SDNCVnfResources { cloudRegion, requestContext, false, callbackURI); } + /** + * This method is used for querying SDNC client for getting the vnf details. + * + * @param vnf + * @exception MapperException & BadResponseException + * @return + */ public String queryVnf(GenericVnf vnf) throws MapperException, BadResponseException { String queryPath = vnf.getSelflink(); return sdncClient.get(queryPath); |