summaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2017-10-27 08:30:08 +0000
committerGerrit Code Review <gerrit@onap.org>2017-10-27 08:30:08 +0000
commit6175f2bd105fda0ad3b794c268aff47bdd88ce08 (patch)
tree30e04fe55178419e46f3c5256f41927d87ff4cea /adapters
parent01bffc83d24e169342607dc71d2c2ebab01e9004 (diff)
parenta75282a875b6f1aa394733a3e65c0debdd2f01fc (diff)
Merge "Add resource operation status oper"
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java17
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java54
2 files changed, 70 insertions, 1 deletions
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java
index 2b2e2dce78..877012c2fe 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java
@@ -27,6 +27,7 @@ import javax.xml.bind.annotation.XmlElement;
import org.openecomp.mso.adapters.requestsdb.exceptions.MsoRequestsDbException;
import org.openecomp.mso.requestsdb.InfraActiveRequests;
+import org.openecomp.mso.requestsdb.ResourceOperationStatus;
/**
* MSO Request DB Adapter Web Service
@@ -72,5 +73,21 @@ public interface MsoRequestsDbAdapter {
@WebParam(name = "operationId") @XmlElement(required = true) String operationId,
@WebParam(name = "operationType") @XmlElement(required = true) String operationType,
@WebParam(name = "resourceTemplateUUIDs") @XmlElement(required = true) String resourceTemplateUUIDs) throws MsoRequestsDbException;
+
+ @WebMethod
+ public ResourceOperationStatus getResourceOperationStatus (@WebParam(name="serviceId") @XmlElement(required = true) String serviceId,
+ @WebParam(name = "operationId") @XmlElement(required = true) String operationId,
+ @WebParam(name = "resourceTemplateUUID") @XmlElement(required = true) String resourceTemplateUUID) throws MsoRequestsDbException;
+ @WebMethod
+ public void updateResourceOperationStatus (@WebParam(name = "serviceId") @XmlElement(required = true) String serviceId,
+ @WebParam(name = "operationId") @XmlElement(required = true) String operationId,
+ @WebParam(name = "resourceTemplateUUID") @XmlElement(required = true) String resourceTemplateUUID,
+ @WebParam(name = "operType") @XmlElement(required = false) String operType,
+ @WebParam(name = "resourceInstanceID") @XmlElement(required = false) String resourceInstanceID,
+ @WebParam(name = "jobId") @XmlElement(required = false) String jobId,
+ @WebParam(name = "status") @XmlElement(required = false) String status,
+ @WebParam(name = "progress") @XmlElement(required = false) String progress,
+ @WebParam(name = "errorCode") @XmlElement(required = false) String errorCode,
+ @WebParam(name = "statusDescription") @XmlElement(required = false) String statusDescription) throws MsoRequestsDbException;
}
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
index 900107d3c3..0bdead4835 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
@@ -285,6 +285,7 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
public void updateServiceOperationStatus(String serviceId, String operationId, String serviceName,String operationType, String userId,
String result, String operationContent, String progress, String reason) throws MsoRequestsDbException {
OperationStatus operStatus = new OperationStatus();
+ operStatus.setResult(RequestsDbConstant.Status.PROCESSING);
operStatus.setServiceId(serviceId);
operStatus.setOperationId(operationId);
operStatus.setServiceName(serviceName);
@@ -322,5 +323,56 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
RequestsDatabase.getInstance().updateResOperStatus(resourceStatus);
}
}
-
+
+ /**
+ * get resource operation status
+ * <br>
+ *
+ * @param serviceId
+ * @param operationId
+ * @param resourceUUID
+ * @return
+ * @throws MsoRequestsDbException
+ * @since ONAP Amsterdam Release
+ */
+ @Override
+ public ResourceOperationStatus getResourceOperationStatus(String serviceId, String operationId, String resourceTemplateUUID)
+ throws MsoRequestsDbException {
+ return RequestsDatabase.getInstance().getResourceOperationStatus(serviceId, operationId, resourceTemplateUUID);
+ }
+
+ /**
+ * update resource operation status
+ * <br>
+ *
+ * @param serviceId
+ * @param operationId
+ * @param resourceUUID
+ * @param operationType
+ * @param resourceInstanceID
+ * @param jobId
+ * @param status
+ * @param progress
+ * @param errorCode
+ * @param statusDescription
+ * @throws MsoRequestsDbException
+ * @since ONAP Amsterdam Release
+ */
+ @Override
+ public void updateResourceOperationStatus(String serviceId, String operationId, String resourceTemplateUUID,
+ String operType, String resourceInstanceID, String jobId, String status, String progress,
+ String errorCode, String statusDescription) throws MsoRequestsDbException {
+ ResourceOperationStatus resStatus = new ResourceOperationStatus();
+ resStatus.setServiceId(serviceId);
+ resStatus.setOperationId(operationId);
+ resStatus.setResourceTemplateUUID(resourceTemplateUUID);
+ resStatus.setOperType(operType);
+ resStatus.setResourceInstanceID(resourceInstanceID);
+ resStatus.setJobId(jobId);
+ resStatus.setStatus(status);
+ resStatus.setProgress(progress);
+ resStatus.setErrorCode(errorCode);
+ resStatus.setStatusDescription(statusDescription);
+ RequestsDatabase.getInstance().updateResOperStatus(resStatus);
+ }
}