From fbb6e45a9186104f50162472e05b4bd76d20de5c Mon Sep 17 00:00:00 2001 From: Einat Vinouze Date: Tue, 17 Dec 2019 19:10:31 +0200 Subject: on templates - filter only Action==INSTANTIATE Issue-ID: VID-730 Signed-off-by: Einat Vinouze Change-Id: I16b73639f18b49b546868326cc6ed82d14818c1f Signed-off-by: Einat Vinouze --- .../org/onap/vid/controller/AsyncInstantiationController.java | 2 +- .../main/java/org/onap/vid/dal/AsyncInstantiationRepository.kt | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'vid-app-common/src/main/java') 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 } - fun listServicesByServiceModelId(serviceModelId: UUID): List = - dataAccessService.getList(ServiceInfo::class.java, filterByServiceModelId(serviceModelId), orderByCreatedDateAndStatus(), null) as List; + fun listInstantiatedServicesByServiceModelId(serviceModelId: UUID): List = + dataAccessService.getList(ServiceInfo::class.java, filterInstantiatedServiceByServiceModelId(serviceModelId), orderByCreatedDateAndStatus(), null) as List; } -- cgit 1.2.3-korg