From 6aaad8e5b33ed357b911a2522e022bf8806ffa63 Mon Sep 17 00:00:00 2001 From: hetengjiao Date: Thu, 7 May 2020 11:00:13 +0800 Subject: interface getServiceOperationStatus in request-db-adapter not exist Issue-ID: SO-2905 Change-Id: I2f66a0efa2e0ba894c8750bdd4d302bcf8924103 Signed-off-by: hetengjiao --- .../adapters/requestsdb/MsoRequestsDbAdapter.java | 7 +++++++ .../requestsdb/MsoRequestsDbAdapterImpl.java | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'adapters/mso-requests-db-adapter/src') diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java index 84ff054a7c..7feaa9c4c3 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java @@ -27,6 +27,7 @@ import javax.xml.bind.annotation.XmlElement; import org.onap.so.adapters.requestsdb.exceptions.MsoRequestsDbException; import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.db.request.beans.InstanceNfvoMapping; +import org.onap.so.db.request.beans.OperationStatus; import org.onap.so.db.request.beans.ResourceOperationStatus; /** @@ -76,6 +77,12 @@ public interface MsoRequestsDbAdapter { @WebMethod public boolean getSiteStatus(@WebParam(name = "siteName") @XmlElement(required = true) String siteName); + @WebMethod + public OperationStatus getServiceOperationStatus( + @WebParam(name = "serviceId") @XmlElement(required = true) String serviceId, + @WebParam(name = "operationId") @XmlElement(required = false) String operationId) + throws MsoRequestsDbException; + @WebMethod public void updateServiceOperationStatus( @WebParam(name = "serviceId") @XmlElement(required = true) String serviceId, diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java index b262cb21cb..8782cce34a 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java @@ -221,6 +221,27 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter { } } + /** + * get the operation status + * + * @param serviceId + * @param operationId + * @return operationStatus + * @throws MsoRequestsDbException + */ + @Override + @Transactional + public OperationStatus getServiceOperationStatus(String serviceId, String operationId) + throws MsoRequestsDbException { + OperationStatus operationStatus; + if (operationId.isEmpty()) { + operationStatus = operationStatusRepository.findOneByServiceId(serviceId); + } else { + operationStatus = operationStatusRepository.findOneByServiceIdAndOperationId(serviceId, operationId); + } + return operationStatus; + } + /** * update operation status
* -- cgit 1.2.3-korg