summaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2019-12-19 07:13:57 +0000
committerGerrit Code Review <gerrit@onap.org>2019-12-19 07:13:57 +0000
commitfa71335438b9425fbf50c79be92dc541b7b103ce (patch)
treee627a819b69b127c55d0770b5cd94e0f93df72fe /vid-app-common/src/main/java/org/onap
parent50f08102564af0938a66071af6c1d1fbf6667943 (diff)
parentfbb6e45a9186104f50162472e05b4bd76d20de5c (diff)
Merge "on templates - filter only Action==INSTANTIATE"
Diffstat (limited to 'vid-app-common/src/main/java/org/onap')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/AsyncInstantiationController.java2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/dal/AsyncInstantiationRepository.kt9
2 files changed, 6 insertions, 5 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/AsyncInstantiationController.java b/vid-app-common/src/main/java/org/onap/vid/controller/AsyncInstantiationController.java
index 96e777a13..c73a01877 100644
--- a/vid-app-common/src/main/java/org/onap/vid/controller/AsyncInstantiationController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/AsyncInstantiationController.java
@@ -92,7 +92,7 @@ public class AsyncInstantiationController extends VidRestrictedBaseController {
if (serviceModelId == null) {
return asyncInstantiationBL.getAllServicesInfo();
} else {
- return asyncInstantiationRepository.listServicesByServiceModelId(serviceModelId);
+ return asyncInstantiationRepository.listInstantiatedServicesByServiceModelId(serviceModelId);
}
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/dal/AsyncInstantiationRepository.kt b/vid-app-common/src/main/java/org/onap/vid/dal/AsyncInstantiationRepository.kt
index c26b88a5e..e26247281 100644
--- a/vid-app-common/src/main/java/org/onap/vid/dal/AsyncInstantiationRepository.kt
+++ b/vid-app-common/src/main/java/org/onap/vid/dal/AsyncInstantiationRepository.kt
@@ -90,9 +90,10 @@ class AsyncInstantiationRepository @Autowired constructor(val dataAccessService:
" and created >= '" + filterDate + "' "
}
- private fun filterByServiceModelId(serviceModelUuid: UUID): String {
+ private fun filterInstantiatedServiceByServiceModelId(serviceModelUuid: UUID): String {
return filterServicesByNotHiddenAndNotDeleted() +
- " and SERVICE_MODEL_ID = '$serviceModelUuid'"
+ " and SERVICE_MODEL_ID = '$serviceModelUuid'" +
+ " and ACTION = 'INSTANTIATE'"
}
private fun filterServicesByNotHiddenAndNotDeleted(): String {
@@ -154,6 +155,6 @@ class AsyncInstantiationRepository @Autowired constructor(val dataAccessService:
return dataAccessService.getList(className, " WHERE $condition", orderBy, null) as List<T>
}
- fun listServicesByServiceModelId(serviceModelId: UUID): List<ServiceInfo> =
- dataAccessService.getList(ServiceInfo::class.java, filterByServiceModelId(serviceModelId), orderByCreatedDateAndStatus(), null) as List<ServiceInfo>;
+ fun listInstantiatedServicesByServiceModelId(serviceModelId: UUID): List<ServiceInfo> =
+ dataAccessService.getList(ServiceInfo::class.java, filterInstantiatedServiceByServiceModelId(serviceModelId), orderByCreatedDateAndStatus(), null) as List<ServiceInfo>;
}