From 38f720752af4d4aad8c4e467a288d9048659f688 Mon Sep 17 00:00:00 2001 From: Rob Daugherty Date: Wed, 14 Mar 2018 02:07:32 -0400 Subject: AT&T 1712 and 1802 release code This is code from AT&T's 1712 and 1802 releases. Change-Id: Ie1e85851e94bc66c4d9514a0226c221939531a04 Issue-ID: SO-425 Signed-off-by: Rob Daugherty --- .../adapters/requestsdb/MsoRequestsDbAdapter.java | 7 ++++--- .../requestsdb/MsoRequestsDbAdapterImpl.java | 24 +++++++++++++++++++--- .../mso/adapters/requestsdb/RequestStatusType.java | 3 ++- 3 files changed, 27 insertions(+), 7 deletions(-) (limited to 'adapters/mso-requests-db-adapter/src/main/java') 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 877012c2fe..fa9016c69c 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 @@ -49,6 +49,8 @@ public interface MsoRequestsDbAdapter { @WebParam(name = "vfModuleId") @XmlElement(required = false) String vfModuleId, @WebParam(name = "volumeGroupId") @XmlElement(required = false) String volumeGroupId, @WebParam(name = "serviceInstanceName") @XmlElement(required = false) String serviceInstanceName, + @WebParam(name = "configurationId") @XmlElement(required = false) String configurationId, + @WebParam(name = "configurationName") @XmlElement(required = false) String configurationName, @WebParam(name = "vfModuleName") @XmlElement(required = false) String vfModuleName) throws MsoRequestsDbException; @WebMethod @@ -60,7 +62,6 @@ public interface MsoRequestsDbAdapter { @WebMethod public void updateServiceOperationStatus (@WebParam(name = "serviceId") @XmlElement(required = true) String serviceId, @WebParam(name = "operationId") @XmlElement(required = false) String operationId, - @WebParam(name = "serviceName") @XmlElement(required = false) String serviceName, @WebParam(name = "operationType") @XmlElement(required = false) String operationType, @WebParam(name = "userId") @XmlElement(required = false) String userId, @WebParam(name = "result") @XmlElement(required = false) String result, @@ -73,11 +74,12 @@ 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, @@ -89,5 +91,4 @@ public interface MsoRequestsDbAdapter { @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 99f6e86b00..358fe53ecb 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 @@ -61,6 +61,8 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter { String vfModuleId, String volumeGroupId, String serviceInstanceName, + String configurationId, + String configurationName, String vfModuleName) throws MsoRequestsDbException { MsoLogger.setLogContext (requestId, null); Session session = requestsDbSessionFactoryManager.getSessionFactory ().openSession (); @@ -105,6 +107,12 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter { if (vfModuleName != null) { queryString += "vfModuleName = :vfModuleName, "; } + if (configurationId != null) { + queryString += "configurationId = :configurationId, "; + } + if (configurationName != null) { + queryString += "configurationName = :configurationName, "; + } if (requestStatus == RequestStatusType.COMPLETE || requestStatus == RequestStatusType.FAILED) { queryString += "endTime = :endTime, "; } else { @@ -165,6 +173,18 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter { query.setParameter ("vfModuleName", vfModuleName); logger.debug ("vfModuleName in updateInfraRequest is set to: " + vfModuleName); } + if (configurationId != null) { + query.setParameter ("configurationId", configurationId); + logger.debug ("configurationId in updateInfraRequest is set to: " + configurationId); + } + if (configurationName != null) { + query.setParameter ("configurationName", configurationName); + logger.debug ("configurationName in updateInfraRequest is set to: " + configurationName); + } + if (vfModuleName != null) { + query.setParameter ("vfModuleName", vfModuleName); + logger.debug ("vfModuleName in updateInfraRequest is set to: " + vfModuleName); + } Timestamp nowTimeStamp = new Timestamp (System.currentTimeMillis ()); if (requestStatus == RequestStatusType.COMPLETE || requestStatus == RequestStatusType.FAILED) { query.setParameter ("endTime", nowTimeStamp); @@ -282,13 +302,11 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter { * @since ONAP Amsterdam Release */ @Override - public void updateServiceOperationStatus(String serviceId, String operationId, String serviceName,String operationType, String userId, + public void updateServiceOperationStatus(String serviceId, String operationId, 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); operStatus.setUserId(userId); operStatus.setOperation(operationType); operStatus.setReason(reason); diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/RequestStatusType.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/RequestStatusType.java index 58c77b4ad7..cebde1aa7a 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/RequestStatusType.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/RequestStatusType.java @@ -56,7 +56,8 @@ public enum RequestStatusType { COMPLETE, FAILED, - IN_PROGRESS; + IN_PROGRESS, + PENDING_MANUAL_TASK; public String value() { return name(); -- cgit 1.2.3-korg