summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuanyu Chen <chenchuanyu@huawei.com>2020-05-08 06:10:02 +0000
committerGerrit Code Review <gerrit@onap.org>2020-05-08 06:10:02 +0000
commit2cb6eb1ce2b1b261c8482cf2298bb2836362d6ce (patch)
treee387fb676127cdcfea0467c11f345d262744cd70
parentbe721f0ce683a5d6618b4cf07e15c7d5da7f4e62 (diff)
parent1a7d5c0fd308bc5f494027c04280cd6de853bf8f (diff)
Merge "interface getServiceOperationStatus in request-db-adapter not exist" into frankfurt
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapter.java7
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java21
2 files changed, 28 insertions, 0 deletions
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;
/**
@@ -77,6 +78,12 @@ public interface MsoRequestsDbAdapter {
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,
@WebParam(name = "operationId") @XmlElement(required = false) String operationId,
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
@@ -222,6 +222,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 <br>
*
* @param serviceId