summaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main
diff options
context:
space:
mode:
authorEinat Vinouze <einat.vinouze@intl.att.com>2019-12-17 19:10:31 +0200
committerEinat Vinouze <einat.vinouze@intl.att.com>2019-12-18 15:07:08 +0200
commitfbb6e45a9186104f50162472e05b4bd76d20de5c (patch)
tree248099c778963ecc892130ebe8e2455570b35cdd /vid-app-common/src/main
parente6de82bfd595d5c680a515c2ff32de21a163cd70 (diff)
on templates - filter only Action==INSTANTIATE
Issue-ID: VID-730 Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com> Change-Id: I16b73639f18b49b546868326cc6ed82d14818c1f Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main')
-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>;
}