summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceInstanceController.java7
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/ServiceInstanceService.java2
-rw-r--r--server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java22
3 files changed, 31 insertions, 0 deletions
diff --git a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceInstanceController.java b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceInstanceController.java
index 79503873..7e6d94ae 100644
--- a/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceInstanceController.java
+++ b/server/src/main/java/org/onap/usecaseui/server/controller/lcm/ServiceInstanceController.java
@@ -102,6 +102,13 @@ public class ServiceInstanceController {
public String serviceNumByCustomer(HttpServletRequest request) throws JsonProcessingException{
return serviceInstanceService.serviceNumByCustomer();
}
+
+ @ResponseBody
+ @RequestMapping(value = {"/uui-lcm/serviceNumByServiceType/{customerId}"}, method = RequestMethod.GET , produces = "application/json")
+ public String serviceNumByServiceType(String customerId) throws JsonProcessingException{
+ return serviceInstanceService.serviceNumByServiceType(customerId);
+ }
+
@ResponseBody
@RequestMapping(value = {"/uui-lcm/getServiceInstanceById"}, method = RequestMethod.GET , produces = "application/json")
public String getServiceInstanceById(HttpServletRequest request){
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/ServiceInstanceService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/ServiceInstanceService.java
index 28bd9e06..7f5f430e 100644
--- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/ServiceInstanceService.java
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/ServiceInstanceService.java
@@ -26,4 +26,6 @@ public interface ServiceInstanceService {
String getRelationShipData(String customerId, String serviceType,String serviceId );
String serviceNumByCustomer() throws JsonProcessingException;
+
+ String serviceNumByServiceType(String customerId) throws JsonProcessingException;
}
diff --git a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java
index 8a6f7aa2..92b2755e 100644
--- a/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java
+++ b/server/src/main/java/org/onap/usecaseui/server/service/lcm/impl/DefaultServiceInstanceService.java
@@ -180,4 +180,26 @@ public class DefaultServiceInstanceService implements ServiceInstanceService {
result.put("customerServiceList", list);
return omAlarm.writeValueAsString(result);
}
+
+ @Override
+ public String serviceNumByServiceType(String customerId) throws JsonProcessingException{
+
+ List<AAIServiceSubscription> serviceTypes = customerService.listServiceSubscriptions(customerId);
+
+ List<Map<String,Object>> list = new ArrayList<>();
+
+ ObjectMapper omAlarm = new ObjectMapper();
+
+ for (AAIServiceSubscription aaiServiceSubscription : serviceTypes) {
+
+ Map<String,Object> serviceTypeMap = new HashMap<String,Object>();
+
+ List<String> serviceInstances =this.listServiceInstances(customerId, aaiServiceSubscription.getServiceType());
+
+ serviceTypeMap.put(aaiServiceSubscription.getServiceType(),serviceInstances.size());
+
+ list.add(serviceTypeMap);
+ }
+ return omAlarm.writeValueAsString(list);
+ }
}