Fix Category Check for E2E Network slicing use case 36/104736/2
authorPriyadharshini <priyadharshini.b96@wipro.com>
Tue, 31 Mar 2020 09:31:56 +0000 (15:01 +0530)
committerPriyadharshini <priyadharshini.b96@wipro.com>
Wed, 1 Apr 2020 14:13:35 +0000 (19:43 +0530)
Issue-ID: EXTAPI-423

Signed-off-by: Priyadharshini <priyadharshini.b96@wipro.com>
Change-Id: I98af0879c71564e9ad9c6a7efb8cb57ae407e8f4

src/main/java/org/onap/nbi/apis/serviceorder/ServiceOrderResource.java
src/main/java/org/onap/nbi/apis/serviceorder/utils/E2EServiceUtils.java
src/main/java/org/onap/nbi/apis/serviceorder/workflow/CreateAAIServiceTypeManager.java
src/main/java/org/onap/nbi/apis/serviceorder/workflow/SOTaskManager.java

index 2f0717d..e34beaa 100644 (file)
@@ -31,6 +31,8 @@ import org.onap.nbi.commons.JsonRepresentation;
 import org.onap.nbi.commons.MultiCriteriaRequestBuilder;
 import org.onap.nbi.commons.ResourceManagement;
 import org.onap.nbi.exceptions.ValidationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.mongodb.core.MongoTemplate;
 import org.springframework.data.mongodb.core.query.Query;
@@ -54,6 +56,8 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping(OnapComponentsUrlPaths.SERVICE_ORDER_PATH)
 public class ServiceOrderResource extends ResourceManagement {
 
+       private static final Logger LOGGER = LoggerFactory.getLogger(ServiceOrderResource.class);
+
     @Autowired
     ServiceOrderService serviceOrderService;
 
@@ -155,6 +159,7 @@ public class ServiceOrderResource extends ResourceManagement {
     }
 
     public ServiceOrder checkServiceOrder(ServiceOrder serviceOrder) {
+               LOGGER.debug("Checking Service order : {} ", serviceOrder.getId());
         ServiceOrderInfo serviceOrderInfo = checkOrderConsistenceManager.checkServiceOrder(serviceOrder);
         if (serviceOrderInfo.isServiceOrderRejected()) {
             serviceOrderService.updateOrderState(serviceOrder, StateType.REJECTED);
index 086cd40..284bc91 100644 (file)
@@ -28,7 +28,7 @@ public class E2EServiceUtils {
             // and e2eServiceInstances )APIs for service CRUD
             // All E2E Services are required to be created in SDC under category "E2E Services" until SO fixes the
             // multiple API issue.
-            if (category.startsWith("e2e") || category.startsWith("CST")) {
+            if (category.startsWith("e2e") || category.startsWith("cst")) {
                 e2eService = true;
             }
         }
index 9cadb1e..4ee4491 100644 (file)
@@ -52,6 +52,7 @@ public class CreateAAIServiceTypeManager {
                 String serviceTypeFromJson = serviceOrderItem.getService().getServicetype();
                 String serviceType = serviceTypeFromJson != null ? serviceTypeFromJson : (String) serviceOrderItemInfo.getCatalogResponse().get("name");
                 if (!serviceNameExistsInAAI(servicesInAaiForCustomer, serviceType)) {
+                                       LOGGER.debug("Creating AAI Service Type : {} ", serviceType);
                     boolean serviceCreated = serviceOrderConsumerService.putServiceType(
                             serviceOrderInfo.getSubscriberInfo().getGlobalSubscriberId(), serviceType, serviceOrder);
                     if (!serviceCreated) {
index 8cabd97..ad4901c 100644 (file)
@@ -50,6 +50,7 @@ public class SOTaskManager {
         Map<String, Long> internalIdOrderItemsMap = new HashMap<>();\r
         if (orderItems != null) {\r
             // first we save create all the execution tasks with order item id in relied tasks\r
+                       LOGGER.debug("Creating {} relied tasks with order item id", orderItems.size());\r
             for (ServiceOrderItem orderItem : orderItems) {\r
                 ExecutionTask task = new ExecutionTask();\r
                 task.setOrderItemId(orderItem.getId());\r