diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-07-30 15:56:09 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-07-31 11:09:25 -0400 |
commit | 5a6a6de6f1a26a1897e4917a0df613e25a24eb70 (patch) | |
tree | 59a968f27b4b603aacc9d5e7b51fb598aeec5321 /adapters/mso-requests-db-adapter/src/main/java/org/openecomp | |
parent | b6dc38501f3b746426b42d9de4cc883d894149e8 (diff) |
Containerization feature of SO
Change-Id: I95381232eeefcd247a66a5cec370a8ce1c288e18
Issue-ID: SO-670
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'adapters/mso-requests-db-adapter/src/main/java/org/openecomp')
8 files changed, 0 insertions, 809 deletions
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandler.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandler.java deleted file mode 100644 index 2a74d797da..0000000000 --- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandler.java +++ /dev/null @@ -1,60 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.adapters.requestsdb; - - -import javax.ws.rs.GET; -import javax.ws.rs.HEAD; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Response; -import org.openecomp.mso.logger.MsoLogger; -import org.openecomp.mso.HealthCheckUtils; -import org.openecomp.mso.utils.UUIDChecker; - - -@Path("/") - public class HealthCheckHandler { - - private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA); - - @HEAD - @GET - @Path("/healthcheck") - @Produces("text/html") - public Response healthcheck (@QueryParam("requestId") String requestId) { - long startTime = System.currentTimeMillis (); - MsoLogger.setServiceName ("Healthcheck"); - UUIDChecker.verifyOldUUID(requestId, msoLogger); - HealthCheckUtils healthCheck = new HealthCheckUtils (); - if (!healthCheck.siteStatusCheck(msoLogger)) { - return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE; - } - - if (!healthCheck.requestDBCheck (msoLogger, startTime)) { - return HealthCheckUtils.NOT_STARTED_RESPONSE; - } - msoLogger.debug("healthcheck - Successful"); - return HealthCheckUtils.HEALTH_CHECK_RESPONSE; - } - -} 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 deleted file mode 100644 index fa9016c69c..0000000000 --- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java +++ /dev/null @@ -1,94 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.adapters.requestsdb; - -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -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 - */ -@WebService(name = "RequestsDbAdapter", targetNamespace = "http://org.openecomp.mso/requestsdb") -public interface MsoRequestsDbAdapter { - - @WebMethod - public void updateInfraRequest (@WebParam(name = "requestId") @XmlElement(required = true) String requestId, - @WebParam(name = "lastModifiedBy") @XmlElement(required = true) String lastModifiedBy, - @WebParam(name = "statusMessage") @XmlElement(required = false) String statusMessage, - @WebParam(name = "responseBody") @XmlElement(required = false) String responseBody, - @WebParam(name = "requestStatus") @XmlElement(required = false) RequestStatusType requestStatus, - @WebParam(name = "progress") @XmlElement(required = false) String progress, - @WebParam(name = "vnfOutputs") @XmlElement(required = false) String vnfOutputs, - @WebParam(name = "serviceInstanceId") @XmlElement(required = false) String serviceInstanceId, - @WebParam(name = "networkId") @XmlElement(required = false) String networkId, - @WebParam(name = "vnfId") @XmlElement(required = false) String vnfId, - @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 - public InfraActiveRequests getInfraRequest (@WebParam(name="requestId") @XmlElement(required = true) String requestId) throws MsoRequestsDbException; - - @WebMethod - public boolean getSiteStatus (@WebParam(name="siteName") @XmlElement(required = true) String siteName); - - @WebMethod - public void updateServiceOperationStatus (@WebParam(name = "serviceId") @XmlElement(required = true) String serviceId, - @WebParam(name = "operationId") @XmlElement(required = false) String operationId, - @WebParam(name = "operationType") @XmlElement(required = false) String operationType, - @WebParam(name = "userId") @XmlElement(required = false) String userId, - @WebParam(name = "result") @XmlElement(required = false) String result, - @WebParam(name = "operationContent") @XmlElement(required = false) String operationContent, - @WebParam(name = "progress") @XmlElement(required = false) String progress, - @WebParam(name = "reason") @XmlElement(required = false) String reason) throws MsoRequestsDbException; - - @WebMethod - public void initResourceOperationStatus (@WebParam(name = "serviceId") @XmlElement(required = true) String serviceId, - @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 deleted file mode 100644 index 3dcf69c815..0000000000 --- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java +++ /dev/null @@ -1,400 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.adapters.requestsdb; - -import java.sql.Timestamp; - -import javax.jws.WebService; - -import org.hibernate.HibernateException; -import org.hibernate.Query; -import org.hibernate.Session; -import org.openecomp.mso.adapters.requestsdb.exceptions.MsoRequestsDbException; -import org.openecomp.mso.db.AbstractSessionFactoryManager; -import org.openecomp.mso.logger.MessageEnum; -import org.openecomp.mso.logger.MsoLogger; -import org.openecomp.mso.requestsdb.InfraActiveRequests; -import org.openecomp.mso.requestsdb.OperationStatus; -import org.openecomp.mso.requestsdb.RequestsDatabase; -import org.openecomp.mso.requestsdb.RequestsDbConstant; -import org.openecomp.mso.requestsdb.RequestsDbSessionFactoryManager; -import org.openecomp.mso.requestsdb.ResourceOperationStatus; -import org.openecomp.mso.requestsdb.SiteStatus; -import org.openecomp.mso.utils.UUIDChecker; - -@WebService(serviceName = "RequestsDbAdapter", endpointInterface = "org.openecomp.mso.adapters.requestsdb.MsoRequestsDbAdapter", targetNamespace = "http://org.openecomp.mso/requestsdb") -public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter { - - protected AbstractSessionFactoryManager requestsDbSessionFactoryManager = new RequestsDbSessionFactoryManager (); - - private static MsoLogger logger = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - - @Override - public void updateInfraRequest (String requestId, - String lastModifiedBy, - String statusMessage, - String responseBody, - RequestStatusType requestStatus, - String progress, - String vnfOutputs, - String serviceInstanceId, - String networkId, - String vnfId, - String vfModuleId, - String volumeGroupId, - String serviceInstanceName, - String configurationId, - String configurationName, - String vfModuleName) throws MsoRequestsDbException { - MsoLogger.setLogContext (requestId, null); - Session session = requestsDbSessionFactoryManager.getSessionFactory ().openSession (); - int result = 0; - long startTime = System.currentTimeMillis (); - try { - session.beginTransaction (); - StringBuilder queryString = new StringBuilder("update InfraActiveRequests set "); - if (statusMessage != null) { - queryString.append("statusMessage = :statusMessage, "); - } - if (responseBody != null) { - queryString.append("responseBody = :responseBody, "); - } - if (requestStatus != null) { - queryString.append("requestStatus = :requestStatus, "); - } - if (progress != null) { - queryString.append("progress = :progress, "); - } - if (vnfOutputs != null) { - queryString.append("vnfOutputs = :vnfOutputs, "); - } - if (serviceInstanceId != null) { - queryString.append("serviceInstanceId = :serviceInstanceId, "); - } - if (networkId != null) { - queryString.append("networkId = :networkId, "); - } - if (vnfId != null) { - queryString.append("vnfId = :vnfId, "); - } - if (vfModuleId != null) { - queryString.append("vfModuleId = :vfModuleId, "); - } - if (volumeGroupId != null) { - queryString.append("volumeGroupId = :volumeGroupId, "); - } - if (serviceInstanceName != null) { - queryString.append("serviceInstanceName = :serviceInstanceName, "); - } - if (vfModuleName != null) { - queryString.append("vfModuleName = :vfModuleName, "); - } - if (configurationId != null) { - queryString.append("configurationId = :configurationId, "); - } - if (configurationName != null) { - queryString.append("configurationName = :configurationName, "); - } - if (requestStatus == RequestStatusType.COMPLETE || requestStatus == RequestStatusType.FAILED) { - queryString.append("endTime = :endTime, "); - } else { - queryString.append("modifyTime = :modifyTime, "); - } - queryString.append("lastModifiedBy = :lastModifiedBy where requestId = :requestId OR clientRequestId = :requestId"); - - logger.debug("Executing update: " + queryString.toString()); - - Query query = session.createQuery (queryString.toString()); - query.setParameter ("requestId", requestId); - if (statusMessage != null) { - query.setParameter ("statusMessage", statusMessage); - logger.debug ("StatusMessage in updateInfraRequest is set to: " + statusMessage); - } - if (responseBody != null) { - query.setParameter ("responseBody", responseBody); - logger.debug ("ResponseBody in updateInfraRequest is set to: " + responseBody); - } - if (requestStatus != null) { - query.setParameter ("requestStatus", requestStatus.toString ()); - logger.debug ("RequestStatus in updateInfraRequest is set to: " + requestStatus.toString()); - } - - if (progress != null) { - query.setParameter ("progress", Long.parseLong (progress)); - logger.debug ("Progress in updateInfraRequest is set to: " + progress); - } - if (vnfOutputs != null) { - query.setParameter ("vnfOutputs", vnfOutputs); - logger.debug ("VnfOutputs in updateInfraRequest is set to: " + vnfOutputs); - } - if (serviceInstanceId != null) { - query.setParameter ("serviceInstanceId", serviceInstanceId); - logger.debug ("ServiceInstanceId in updateInfraRequest is set to: " + serviceInstanceId); - } - if (networkId != null) { - query.setParameter ("networkId", networkId); - logger.debug ("NetworkId in updateInfraRequest is set to: " + networkId); - } - if (vnfId != null) { - query.setParameter ("vnfId", vnfId); - logger.debug ("VnfId in updateInfraRequest is set to: " + vnfId); - } - if (vfModuleId != null) { - query.setParameter ("vfModuleId", vfModuleId); - logger.debug ("vfModuleId in updateInfraRequest is set to: " + vfModuleId); - } - if (volumeGroupId != null) { - query.setParameter ("volumeGroupId", volumeGroupId); - logger.debug ("VolumeGroupId in updateInfraRequest is set to: " + volumeGroupId); - } - if (serviceInstanceName != null) { - query.setParameter ("serviceInstanceName", serviceInstanceName); - logger.debug ("ServiceInstanceName in updateInfraRequest is set to: " + serviceInstanceName); - } - if (vfModuleName != null) { - 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); - logger.debug ("EndTime in updateInfraRequest is set to: " + nowTimeStamp); - } else { - query.setParameter ("modifyTime", nowTimeStamp); - logger.debug ("ModifyTime in updateInfraRequest is set to: " + nowTimeStamp); - } - query.setParameter ("lastModifiedBy", lastModifiedBy); - logger.debug ("LastModifiedBy in updateInfraRequest is set to: " + lastModifiedBy); - result = query.executeUpdate (); - checkIfExists (result, requestId); - session.getTransaction ().commit (); - } catch (HibernateException e) { - String error = "Unable to update MSO Requests DB: " + e.getMessage (); - logger.error (MessageEnum.RA_CANT_UPDATE_REQUEST, "infra request parameters", requestId, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "HibernateException - " + error, e); - logger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, error); - throw new MsoRequestsDbException (error, e); - } finally { - if (session != null && session.isOpen ()) { - session.close (); - } - } - logger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful"); - } - - - private void checkIfExists (int result, String requestId) throws MsoRequestsDbException { - if (result == 0) { - String error = "Request ID does not exist in MSO Requests DB: " + requestId; - logger.error (MessageEnum.RA_DB_REQUEST_NOT_EXIST, requestId, "", "", MsoLogger.ErrorCode.DataError, error); - throw new MsoRequestsDbException (error); - } - } - - - @Override - public InfraActiveRequests getInfraRequest (String requestId) throws MsoRequestsDbException { - long startTime = System.currentTimeMillis (); - MsoLogger.setLogContext (requestId, null); - Session session = requestsDbSessionFactoryManager.getSessionFactory ().openSession (); - - logger.debug ("Call to MSO Infra RequestsDb adapter get method with request Id: " + requestId); - - InfraActiveRequests request = null; - try { - session.beginTransaction (); - Query query = session.createQuery ("FROM InfraActiveRequests where requestId = :requestId OR clientRequestId = :requestId"); - query.setParameter ("requestId", requestId); - request = (InfraActiveRequests) query.uniqueResult(); - } catch (HibernateException e) { - String error = "Unable to retrieve MSO Infra Requests DB for Request ID " - + requestId; - logger.error (MessageEnum.RA_DB_REQUEST_NOT_EXIST, "Get Infra request", requestId, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "HibernateException - " + error, e); - logger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, error); - throw new MsoRequestsDbException (error, e); - } finally { - if (session != null && session.isOpen ()) { - session.close (); - } - } - logger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful"); - return request; - } - - - /** - * Get SiteStatus by SiteName. - * - * @param siteName The unique name of the site - * @return Status of that site - */ - @Override - public boolean getSiteStatus (String siteName) { - UUIDChecker.generateUUID (logger); - Session session = requestsDbSessionFactoryManager.getSessionFactory ().openSession (); - - long startTime = System.currentTimeMillis (); - SiteStatus siteStatus = null; - logger.debug ("Request database - get Site Status with Site name:" + siteName); - try { - String hql = "FROM SiteStatus WHERE siteName = :site_name"; - Query query = session.createQuery (hql); - query.setParameter ("site_name", siteName); - - siteStatus = (SiteStatus) query.uniqueResult (); - } finally { - if (session != null && session.isOpen ()) { - session.close (); - } - } - if (siteStatus == null) { - // if not exist in DB, it means the site is not disabled, thus return true - logger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful"); - return true; - } else { - logger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful"); - return siteStatus.getStatus(); - } - } - - /** - * update operation status - * <br> - * - * @param serviceId - * @param operationId - * @param operationType - * @param userId - * @param result - * @param operationContent - * @param progress - * @param reason - * @throws MsoRequestsDbException - * @since ONAP Amsterdam Release - */ - @Override - 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.setServiceId(serviceId); - operStatus.setOperationId(operationId); - operStatus.setUserId(userId); - operStatus.setOperation(operationType); - operStatus.setReason(reason); - operStatus.setProgress(progress); - operStatus.setResult(result); - operStatus.setOperationContent(operationContent); - RequestsDatabase.getInstance().updateOperationStatus(operStatus); - } - - /** - * init the operation status of all the resources - * <br> - * - * @param serviceId the service Id - * @param operationId the operation Id - * @param operationType the operationType - * @param resourceTemplateUUIDs the resources, the UUID is split by ":" - * @throws MsoRequestsDbException - * @since ONAP Amsterdam Release - */ - @Override - public void initResourceOperationStatus(String serviceId, String operationId, String operationType, - String resourceTemplateUUIDs) throws MsoRequestsDbException{ - String[] resourceLst = resourceTemplateUUIDs.split(":"); - for(String resource: resourceLst){ - if("".equals(resource)){ - continue; - } - ResourceOperationStatus resourceStatus = new ResourceOperationStatus(); - resourceStatus.setOperationId(operationId); - resourceStatus.setServiceId(serviceId); - resourceStatus.setResourceTemplateUUID(resource); - resourceStatus.setOperType(operationType); - resourceStatus.setStatus(RequestsDbConstant.Status.PROCESSING); - resourceStatus.setStatusDescription("Waiting for start"); - RequestsDatabase.getInstance().updateResOperStatus(resourceStatus); - } - } - - /** - * get resource operation status - * <br> - * - * @param serviceId - * @param operationId - * @param resourceTemplateUUID - * @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 resourceTemplateUUID - * @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 operationType, 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(operationType); - resStatus.setResourceInstanceID(resourceInstanceID); - resStatus.setJobId(jobId); - resStatus.setStatus(status); - resStatus.setProgress(progress); - resStatus.setErrorCode(errorCode); - resStatus.setStatusDescription(statusDescription); - RequestsDatabase.getInstance().updateResOperStatus(resStatus); - } -} 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 deleted file mode 100644 index cebde1aa7a..0000000000 --- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/RequestStatusType.java +++ /dev/null @@ -1,70 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -// -// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 -// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> -// Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.07.24 at 11:49:17 AM EDT -// - - -package org.openecomp.mso.adapters.requestsdb; - - - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlType; - - -/** - * <p>Java class for request-status-type. - * - * <p>The following schema fragment specifies the expected content contained within this class. - * <p> - * <pre> - * <simpleType name="request-status-type"> - * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> - * <enumeration value="COMPLETE"/> - * <enumeration value="FAILED"/> - * <enumeration value="IN_PROGRESS"/> - * </restriction> - * </simpleType> - * </pre> - * - */ -@XmlType(name = "request-status-type") -@XmlEnum -public enum RequestStatusType { - - COMPLETE, - FAILED, - IN_PROGRESS, - PENDING_MANUAL_TASK; - - public String value() { - return name(); - } - - public static RequestStatusType fromValue(String v) { - return valueOf(v); - } - -} diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/ResponseStatus.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/ResponseStatus.java deleted file mode 100644 index 152eb5cf8a..0000000000 --- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/ResponseStatus.java +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.adapters.requestsdb; - - - -/* - * Enum for Status values returned by API Handler to Tail-F -*/ -public enum ResponseStatus { - SENDING_FINAL_NOTIFY, - SUCCESS, - FAILED, - TIMEOUT -} diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/Status.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/Status.java deleted file mode 100644 index 3c6f9224e5..0000000000 --- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/Status.java +++ /dev/null @@ -1,40 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.adapters.requestsdb; - - -/* - * Enum for Status values returned by API Handler to Tail-F -*/ -public enum Status { - PENDING, INPROGRESS, COMPLETED, FAILED, TIMEOUT; - - public boolean isFinished () { - switch (this) { - case COMPLETED: - case FAILED: - case TIMEOUT: - return true; - default: - return false; - } - } -} diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/exceptions/MsoRequestsDbException.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/exceptions/MsoRequestsDbException.java deleted file mode 100644 index 3d909786be..0000000000 --- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/exceptions/MsoRequestsDbException.java +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.adapters.requestsdb.exceptions; - - - -import javax.xml.ws.WebFault; - -/** - * This class simply extends Exception (without addition additional functionality) - * to provide an identifier for RequestsDB related exceptions on create, delete, query. - * - * - */ -@WebFault (name="MsoRequestsDbException", faultBean="org.openecomp.mso.adapters.requestsdb.exceptions.MsoRequestsDbExceptionBean", targetNamespace="http://org.openecomp.mso/requestsdb") -public class MsoRequestsDbException extends Exception { - - private static final long serialVersionUID = 1L; - - private MsoRequestsDbExceptionBean faultInfo; - - public MsoRequestsDbException (String msg) { - super(msg); - faultInfo = new MsoRequestsDbExceptionBean (msg); - } - - public MsoRequestsDbException (Throwable e) { - super(e); - faultInfo = new MsoRequestsDbExceptionBean (e.getMessage()); - } - - public MsoRequestsDbException (String msg, Throwable e) { - super (msg, e); - faultInfo = new MsoRequestsDbExceptionBean (msg); - } - - public MsoRequestsDbExceptionBean getFaultInfo() { - return faultInfo; - } - - public void setFaultInfo(MsoRequestsDbExceptionBean faultInfo) { - this.faultInfo = faultInfo; - } -} diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/exceptions/MsoRequestsDbExceptionBean.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/exceptions/MsoRequestsDbExceptionBean.java deleted file mode 100644 index dce1cf9365..0000000000 --- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/exceptions/MsoRequestsDbExceptionBean.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.adapters.requestsdb.exceptions; - - -import java.io.Serializable; - -/** - * Jax-WS Fault Bean for MsoRequestsDB Exception - */ -public class MsoRequestsDbExceptionBean implements Serializable { - - private static final long serialVersionUID = 1360000062602372639L; - - private String message; - - public MsoRequestsDbExceptionBean () { - /* Empty constructor */ - } - - public MsoRequestsDbExceptionBean (String message) { - this.message = message; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} |