diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ArchivedInfraRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ArchivedInfraRequests.java
new file mode 100644
index 0000000..b66e027
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ArchivedInfraRequests.java
@@ -0,0 +1,91 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.onap.so.db.request.beans;
+
+import java.util.Objects;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+@Entity
+@Table(name = "archived_infra_requests")
+public class ArchivedInfraRequests extends InfraRequests {
+
+	private static final long serialVersionUID = 7132783898142451603L;
+
+	public ArchivedInfraRequests() {
+	}
+
+	public ArchivedInfraRequests(String requestId, String action) {
+		setRequestId(requestId);
+		setAction(action);
+	}
+
+	public ArchivedInfraRequests(String requestId) {
+		setRequestId(requestId);
+	}
+
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof ArchivedInfraRequests)) {
+			return false;
+		}
+		ArchivedInfraRequests castOther = (ArchivedInfraRequests) other;
+		return Objects.equals(getRequestId(), castOther.getRequestId());
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(getRequestId());
+	}
+
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("requestId", getRequestId())
+				.append("clientRequestId", getClientRequestId()).append("action", getAction())
+				.append("requestStatus", getRequestStatus()).append("statusMessage", getStatusMessage())
+				.append("progress", getProgress()).append("startTime", getStartTime()).append("endTime", getEndTime())
+				.append("source", getSource()).append("vnfId", getVnfId()).append("vnfName", getVnfName())
+				.append("vnfType", getVnfType()).append("serviceType", getServiceType())
+				.append("aicNodeClli", getAicNodeClli()).append("tenantId", getTenantId())
+				.append("provStatus", getProvStatus()).append("vnfParams", getVnfParams())
+				.append("vnfOutputs", getVnfOutputs()).append("requestBody", getRequestBody())
+				.append("responseBody", getResponseBody()).append("lastModifiedBy", getLastModifiedBy())
+				.append("modifyTime", getModifyTime()).append("requestType", getRequestType())
+				.append("volumeGroupId", getVolumeGroupId()).append("volumeGroupName", getVolumeGroupName())
+				.append("vfModuleId", getVfModuleId()).append("vfModuleName", getVfModuleName())
+				.append("vfModuleModelName", getVfModuleModelName()).append("aaiServiceId", getAaiServiceId())
+				.append("aicCloudRegion", getAicCloudRegion()).append("callBackUrl", getCallBackUrl())
+				.append("correlator", getCorrelator()).append("serviceInstanceId", getServiceInstanceId())
+				.append("serviceInstanceName", getServiceInstanceName()).append("requestScope", getRequestScope())
+				.append("requestAction", getRequestAction()).append("networkId", getNetworkId())
+				.append("networkName", getNetworkName()).append("networkType", getNetworkType())
+				.append("requestorId", getRequestorId()).append("configurationId", getConfigurationId())
+				.append("configurationName", getConfigurationName()).append("operationalEnvId", getOperationalEnvId())
+				.append("operationalEnvName", getOperationalEnvName()).toString();
+	}
+
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraActiveRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraActiveRequests.java
new file mode 100644
index 0000000..84ff458
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraActiveRequests.java
@@ -0,0 +1,93 @@
+/*-
+ * ============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.onap.so.db.request.beans;
+
+import java.util.Objects;
+
+import javax.persistence.Entity;
+import javax.persistence.Table;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * InfraActiveRequests generated by hbm2java
+ */
+@Entity
+@Table(name = "infra_active_requests")
+public class InfraActiveRequests extends InfraRequests {
+
+	private static final long serialVersionUID = -6818265918910035170L;
+
+	public InfraActiveRequests() {
+	}
+
+	public InfraActiveRequests(String requestId, String action) {
+		setRequestId(requestId);
+		setAction(action);
+	}
+
+	public InfraActiveRequests(String requestId) {
+		setRequestId(requestId);
+	}    
+	
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof InfraActiveRequests)) {
+			return false;
+		}
+		InfraActiveRequests castOther = (InfraActiveRequests) other;
+		return Objects.equals(getRequestId(), castOther.getRequestId());
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(getRequestId());
+	}
+
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("requestId", getRequestId())
+				.append("clientRequestId", getClientRequestId()).append("action", getAction())
+				.append("requestStatus", getRequestStatus()).append("statusMessage", getStatusMessage())
+				.append("progress", getProgress()).append("startTime", getStartTime()).append("endTime", getEndTime())
+				.append("source", getSource()).append("vnfId", getVnfId()).append("vnfName", getVnfName())
+				.append("vnfType", getVnfType()).append("serviceType", getServiceType())
+				.append("aicNodeClli", getAicNodeClli()).append("tenantId", getTenantId())
+				.append("provStatus", getProvStatus()).append("vnfParams", getVnfParams())
+				.append("vnfOutputs", getVnfOutputs()).append("requestBody", getRequestBody())
+				.append("responseBody", getResponseBody()).append("lastModifiedBy", getLastModifiedBy())
+				.append("modifyTime", getModifyTime()).append("requestType", getRequestType())
+				.append("volumeGroupId", getVolumeGroupId()).append("volumeGroupName", getVolumeGroupName())
+				.append("vfModuleId", getVfModuleId()).append("vfModuleName", getVfModuleName())
+				.append("vfModuleModelName", getVfModuleModelName()).append("aaiServiceId", getAaiServiceId())
+				.append("aicCloudRegion", getAicCloudRegion()).append("callBackUrl", getCallBackUrl())
+				.append("correlator", getCorrelator()).append("serviceInstanceId", getServiceInstanceId())
+				.append("serviceInstanceName", getServiceInstanceName()).append("requestScope", getRequestScope())
+				.append("requestAction", getRequestAction()).append("networkId", getNetworkId())
+				.append("networkName", getNetworkName()).append("networkType", getNetworkType())
+				.append("requestorId", getRequestorId()).append("configurationId", getConfigurationId())
+				.append("configurationName", getConfigurationName()).append("operationalEnvId", getOperationalEnvId())
+				.append("operationalEnvName", getOperationalEnvName()).toString();
+	}
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java
new file mode 100644
index 0000000..48a6cf3
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/InfraRequests.java
@@ -0,0 +1,556 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.onap.so.db.request.beans;
+
+import java.net.URI;
+import java.sql.Timestamp;
+import java.util.Date;
+import java.util.Objects;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import javax.persistence.MappedSuperclass;
+import javax.persistence.PrePersist;
+import javax.persistence.PreUpdate;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.onap.so.requestsdb.adapter.TimestampXMLAdapter;
+
+import uk.co.blackpepper.bowman.annotation.ResourceId;
+
+@MappedSuperclass
+public abstract class InfraRequests implements java.io.Serializable {
+
+	private static final long serialVersionUID = -5497583682393936143L;
+	private static final String UNKNOWN = "unknown";
+	
+	
+	@Id
+   	@Column(name = "REQUEST_ID", length=45)
+    private String requestId;
+   	@Column(name = "CLIENT_REQUEST_ID", length=45, unique=true)
+	private String clientRequestId;
+   	@Column(name = "ACTION", length=45)
+	private String action;
+   	@Column(name = "REQUEST_STATUS", length=20)
+	private String requestStatus;
+   	@Column(name = "STATUS_MESSAGE", length=2000)
+	private String statusMessage;
+   	@Column(name = "PROGRESS", precision=11)
+	private Long progress;
+   	
+   	@Column(name = "START_TIME")
+	private Timestamp startTime;
+   	@Column(name = "END_TIME")
+	private Timestamp endTime;
+   	@Column(name = "SOURCE", length=45)
+	private String source;
+   	@Column(name = "VNF_ID", length=45)
+	private String vnfId;
+   	@Column(name = "VNF_NAME", length=80)
+	private String vnfName;
+   	@Column(name = "VNF_TYPE", length=200)
+	private String vnfType;
+   	@Column(name = "SERVICE_TYPE", length=45)
+	private String serviceType;
+   	@Column(name = "AIC_NODE_CLLI", length=11)
+	private String aicNodeClli;
+   	@Column(name = "TENANT_ID", length=45)
+	private String tenantId;
+   	@Column(name = "PROV_STATUS", length=20)
+	private String provStatus;
+   	@Column(name = "VNF_PARAMS")
+	private String vnfParams;
+   	@Column(name = "VNF_OUTPUTS")
+	private String vnfOutputs;
+   	@Column(name = "REQUEST_BODY")
+	private String requestBody;
+   	@Column(name = "RESPONSE_BODY")
+	private String responseBody;
+   	@Column(name = "LAST_MODIFIED_BY", length=50)
+	private String lastModifiedBy;
+   	@Column(name = "MODIFY_TIME")
+   	@Temporal(TemporalType.TIMESTAMP)
+	private Date modifyTime;
+   	@Column(name = "REQUEST_TYPE", length=20)
+	private String requestType;
+   	@Column(name = "VOLUME_GROUP_ID", length=45)
+	private String volumeGroupId;
+   	@Column(name = "VOLUME_GROUP_NAME", length=45)
+	private String volumeGroupName;
+   	@Column(name = "VF_MODULE_ID", length=45)
+	private String vfModuleId;
+   	@Column(name = "VF_MODULE_NAME", length=200)
+	private String vfModuleName;
+   	@Column(name = "VF_MODULE_MODEL_NAME", length=200)
+	private String vfModuleModelName;
+   	@Column(name = "AAI_SERVICE_ID", length=50)
+	private String aaiServiceId;
+   	@Column(name = "AIC_CLOUD_REGION", length=11)
+	private String aicCloudRegion;
+   	@Column(name = "CALLBACK_URL", length=200)
+	private String callBackUrl;
+   	@Column(name = "CORRELATOR", length=80)
+	private String correlator;
+   	@Column(name = "SERVICE_INSTANCE_ID", length=45)
+	private String serviceInstanceId;
+   	@Column(name = "SERVICE_INSTANCE_NAME", length=80)
+	private String serviceInstanceName;
+   	@Column(name = "REQUEST_SCOPE", length=45)
+	private String requestScope;
+   	@Column(name = "REQUEST_ACTION", length=45)
+	private String requestAction;
+   	@Column(name = "NETWORK_ID", length=45)
+	private String networkId;
+   	@Column(name = "NETWORK_NAME", length=80)
+	private String networkName;
+   	@Column(name = "NETWORK_TYPE", length=80)
+	private String networkType;
+   	@Column(name = "REQUESTOR_ID", length=80)
+	private String requestorId;
+   	@Column(name = "CONFIGURATION_ID", length=45)
+	private String configurationId;
+   	@Column(name = "CONFIGURATION_NAME", length=200)
+	private String configurationName;
+   	@Column(name = "OPERATIONAL_ENV_ID", length=45)
+	private String operationalEnvId;
+   	@Column(name = "OPERATIONAL_ENV_NAME", length=200)
+	private String operationalEnvName;
+
+   	@ResourceId
+	public URI getRequestURI() {
+		return URI.create(this.requestId);
+	}
+
+	public String getRequestId() {
+		return this.requestId;
+	}
+   	
+	public void setRequestId(String requestId) {
+		this.requestId = requestId;
+	}
+
+	public String getClientRequestId() {
+		return clientRequestId;
+	}
+
+	public void setClientRequestId(String clientRequestId) {
+		this.clientRequestId = clientRequestId;
+	}
+
+	public String getAction() {
+		return this.action;
+	}
+
+	public void setAction(String action) {
+		this.action = action;
+	}
+
+	public String getRequestStatus() {
+		return this.requestStatus;
+	}
+
+	public void setRequestStatus(String requestStatus) {
+		this.requestStatus = requestStatus;
+	}
+
+	public String getStatusMessage() {
+		return this.statusMessage;
+	}
+
+	public void setStatusMessage(String statusMessage) {
+		this.statusMessage = statusMessage;
+	}
+
+	public Long getProgress() {
+		return this.progress;
+	}
+
+	public void setProgress(Long progress) {
+		this.progress = progress;
+	}
+
+    @XmlJavaTypeAdapter(TimestampXMLAdapter.class)
+	public Timestamp getStartTime() {
+		return this.startTime;
+	}
+
+	public void setStartTime(Timestamp startTime) {
+		this.startTime = startTime;
+	}
+
+    @XmlJavaTypeAdapter(TimestampXMLAdapter.class)
+	public Timestamp getEndTime() {
+		return this.endTime;
+	}
+
+	public void setEndTime(Timestamp endTime) {
+		this.endTime = endTime;
+	}
+
+	public String getSource() {
+		return this.source;
+	}
+
+	public void setSource(String source) {
+		this.source = source;
+	}
+
+	public String getVnfId() {
+		return this.vnfId;
+	}
+
+	public void setVnfId(String vnfId) {
+		this.vnfId = vnfId;
+	}
+
+	public String getVnfName() {
+		return this.vnfName;
+	}
+
+	public void setVnfName(String vnfName) {
+		this.vnfName = vnfName;
+	}
+
+	public String getVnfType() {
+		return this.vnfType;
+	}
+
+	public void setVnfType(String vnfType) {
+		this.vnfType = vnfType;
+	}
+
+	public String getServiceType() {
+		return this.serviceType;
+	}
+
+	public void setServiceType(String serviceType) {
+		this.serviceType = serviceType;
+	}
+
+	public String getAicNodeClli() {
+		return this.aicNodeClli;
+	}
+
+	public void setAicNodeClli(String aicNodeClli) {
+		this.aicNodeClli = aicNodeClli;
+	}
+
+	public String getTenantId() {
+		return this.tenantId;
+	}
+
+	public void setTenantId(String tenantId) {
+		this.tenantId = tenantId;
+	}
+
+	public String getProvStatus() {
+		return this.provStatus;
+	}
+
+	public void setProvStatus(String provStatus) {
+		this.provStatus = provStatus;
+	}
+
+	public String getVnfParams() {
+		return this.vnfParams;
+	}
+
+	public void setVnfParams(String vnfParams) {
+		this.vnfParams = vnfParams;
+	}
+
+	public String getVnfOutputs() {
+		return this.vnfOutputs;
+	}
+
+	public void setVnfOutputs(String vnfOutputs) {
+		this.vnfOutputs = vnfOutputs;
+	}
+
+	public String getRequestBody() {
+		return this.requestBody;
+	}
+
+	public void setRequestBody(String requestBody) {
+		this.requestBody = requestBody;
+	}
+
+	public String getResponseBody() {
+		return this.responseBody;
+	}
+
+	public void setResponseBody(String responseBody) {
+		this.responseBody = responseBody;
+	}
+
+	public String getLastModifiedBy() {
+		return this.lastModifiedBy;
+	}
+
+	public void setLastModifiedBy(String lastModifiedBy) {
+		this.lastModifiedBy = lastModifiedBy;
+	}
+
+	public Date getModifyTime() {
+		return this.modifyTime;
+	}
+	
+	public String getRequestType() {
+		return this.requestType;
+	}
+
+	public void setRequestType(String requestType) {
+		this.requestType = requestType;
+	}
+
+	public String getVolumeGroupId() {
+		return this.volumeGroupId;
+	}
+
+	public void setVolumeGroupId(String volumeGroupId) {
+		this.volumeGroupId = volumeGroupId;
+	}
+
+	public String getVolumeGroupName() {
+		return this.volumeGroupName;
+	}
+
+	public void setVolumeGroupName(String volumeGroupName) {
+		this.volumeGroupName = volumeGroupName;
+	}
+
+	public String getVfModuleId() {
+		return this.vfModuleId;
+	}
+
+	public void setVfModuleId(String vfModuleId) {
+		this.vfModuleId = vfModuleId;
+	}
+
+	public String getVfModuleName() {
+		return this.vfModuleName;
+	}
+
+	public void setVfModuleName(String vfModuleName) {
+		this.vfModuleName = vfModuleName;
+	}
+
+	public String getVfModuleModelName() {
+		return this.vfModuleModelName;
+	}
+
+	public void setVfModuleModelName(String vfModuleModelName) {
+		this.vfModuleModelName = vfModuleModelName;
+	}
+
+	public String getAaiServiceId() {
+		return this.aaiServiceId;
+	}
+
+	public void setAaiServiceId(String aaiServiceId) {
+		this.aaiServiceId = aaiServiceId;
+	}
+
+	public String getAicCloudRegion() {
+		return this.aicCloudRegion;
+	}
+
+	public void setAicCloudRegion(String aicCloudRegion) {
+		this.aicCloudRegion = aicCloudRegion;
+	}
+
+	public String getCallBackUrl() {
+		return callBackUrl;
+	}
+
+	public void setCallBackUrl(String callBackUrl) {
+		this.callBackUrl = callBackUrl;
+	}
+
+	public String getCorrelator() {
+		return correlator;
+	}
+
+	public void setCorrelator(String correlator) {
+		this.correlator = correlator;
+	}
+
+	public String getServiceInstanceId() {
+		return serviceInstanceId;
+	}
+
+	public void setServiceInstanceId(String serviceInstanceId) {
+		this.serviceInstanceId = serviceInstanceId;
+	}
+
+	public String getServiceInstanceName() {
+		return serviceInstanceName;
+	}
+
+	public void setServiceInstanceName(String serviceInstanceName) {
+		this.serviceInstanceName = serviceInstanceName;
+	}
+
+	public String getRequestScope() {
+		return requestScope;
+	}
+
+	public void setRequestScope(String requestScope) {
+		this.requestScope = requestScope;
+	}
+
+	public String getRequestAction() {
+		return requestAction;
+	}
+
+	public void setRequestAction(String requestAction) {
+		this.requestAction = requestAction;
+	}
+
+	public String getNetworkId() {
+		return networkId;
+	}
+
+	public void setNetworkId(String networkId) {
+		this.networkId = networkId;
+	}
+
+	public String getNetworkName() {
+		return networkName;
+	}
+
+	public void setNetworkName(String networkName) {
+		this.networkName = networkName;
+	}
+
+	public String getNetworkType() {
+		return networkType;
+	}
+
+	public void setNetworkType(String networkType) {
+		this.networkType = networkType;
+	}
+
+	public String getRequestorId() {
+		return requestorId;
+	}
+
+	public void setRequestorId(String requestorId) {
+		this.requestorId = requestorId;
+	}
+
+	public String getConfigurationId() {
+		return configurationId;
+	}
+
+	public void setConfigurationId(String configurationId) {
+		this.configurationId = configurationId;
+	}
+
+	public String getConfigurationName() {
+		return configurationName;
+	}
+
+	public void setConfigurationName(String configurationName) {
+		this.configurationName = configurationName;
+	}
+
+	public String getOperationalEnvId() {
+		return operationalEnvId;
+	}
+
+	public void setOperationalEnvId(String operationalEnvId) {
+		this.operationalEnvId = operationalEnvId;
+	}
+
+	public String getOperationalEnvName() {
+		return operationalEnvName;
+	}
+
+	public void setOperationalEnvName(String operationalEnvName) {
+		this.operationalEnvName = operationalEnvName;
+	}
+	
+	@PrePersist
+	protected void onCreate() {
+		if(requestScope==null)
+			requestScope=UNKNOWN;
+		if(requestAction==null)
+			requestAction=UNKNOWN;
+		this.modifyTime = new Date();
+	}
+
+	@PreUpdate
+	protected void onUpdate() {
+		if(requestScope==null)
+			requestScope=UNKNOWN;
+		if(requestAction==null)
+			requestAction=UNKNOWN;
+		this.modifyTime = new Date();
+	}
+	
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof InfraRequests)) {
+			return false;
+		}
+		InfraRequests castOther = (InfraRequests) other;
+		return Objects.equals(getRequestId(), castOther.getRequestId());
+	}
+	
+	@Override
+	public int hashCode() {
+		return Objects.hash(getRequestId());
+	}
+	
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("requestId", getRequestId())
+				.append("clientRequestId", getClientRequestId()).append("action", getAction())
+				.append("requestStatus", getRequestStatus()).append("statusMessage", getStatusMessage())
+				.append("progress", getProgress()).append("startTime", getStartTime()).append("endTime", getEndTime())
+				.append("source", getSource()).append("vnfId", getVnfId()).append("vnfName", getVnfName())
+				.append("vnfType", getVnfType()).append("serviceType", getServiceType())
+				.append("aicNodeClli", getAicNodeClli()).append("tenantId", getTenantId())
+				.append("provStatus", getProvStatus()).append("vnfParams", getVnfParams())
+				.append("vnfOutputs", getVnfOutputs()).append("requestBody", getRequestBody())
+				.append("responseBody", getResponseBody()).append("lastModifiedBy", getLastModifiedBy())
+				.append("modifyTime", getModifyTime()).append("requestType", getRequestType())
+				.append("volumeGroupId", getVolumeGroupId()).append("volumeGroupName", getVolumeGroupName())
+				.append("vfModuleId", getVfModuleId()).append("vfModuleName", getVfModuleName())
+				.append("vfModuleModelName", getVfModuleModelName()).append("aaiServiceId", getAaiServiceId())
+				.append("aicCloudRegion", getAicCloudRegion()).append("callBackUrl", getCallBackUrl())
+				.append("correlator", getCorrelator()).append("serviceInstanceId", getServiceInstanceId())
+				.append("serviceInstanceName", getServiceInstanceName()).append("requestScope", getRequestScope())
+				.append("requestAction", getRequestAction()).append("networkId", getNetworkId())
+				.append("networkName", getNetworkName()).append("networkType", getNetworkType())
+				.append("requestorId", getRequestorId()).append("configurationId", getConfigurationId())
+				.append("configurationName", getConfigurationName()).append("operationalEnvId", getOperationalEnvId())
+				.append("operationalEnvName", getOperationalEnvName()).toString();
+	}
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationStatus.java
new file mode 100644
index 0000000..dff9dd6
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationStatus.java
@@ -0,0 +1,239 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.onap.so.db.request.beans;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.PrePersist;
+import javax.persistence.PreUpdate;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import java.util.Objects;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * The service operation status 
+ * <br>
+ * <p>
+ * </p>
+ * 
+ * @author
+ * @version     ONAP Amsterdam Release  2017-08-28
+ */
+
+@IdClass(OperationStatusId.class)
+@Entity
+@Table(name = "operation_status")
+public class OperationStatus implements Serializable{
+    
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+
+    @Id
+   	@Column(name = "SERVICE_ID")
+    private String serviceId;
+    @Id
+   	@Column(name = "OPERATION_ID", length=256)
+    private String operationId;
+    
+    @Column(name = "SERVICE_NAME", length=256)
+    private String serviceName;
+    
+    @Column(name = "OPERATION_TYPE", length=256)
+    private String operation;
+    
+    @Column(name = "USER_ID", length=256)
+    private String userId;
+    
+    @Column(name = "RESULT", length=256)
+    private String result;
+    
+    @Column(name = "OPERATION_CONTENT", length=256)
+    private String operationContent;
+    
+    @Column(name = "PROGRESS", length=256)
+    private String progress = "0";
+    
+    @Column(name = "REASON", length=256)
+    private String reason;
+
+    @Column(name = "OPERATE_AT", length=256, updatable=false)
+    @Temporal(TemporalType.TIMESTAMP)
+    private Date operateAt;
+    
+    @Column(name = "FINISHED_AT", length=256)
+    @Temporal(TemporalType.TIMESTAMP)
+    private Date finishedAt;
+
+    public OperationStatus() {
+    	
+    }
+    
+    public OperationStatus(String serviceId, String operationId) {
+    	this.serviceId = serviceId;
+    	this.operationId = operationId;
+    }
+    
+    
+    public String getServiceId() {
+        return serviceId;
+    }
+
+    
+    public void setServiceId(String serviceId) {
+        this.serviceId = serviceId;
+    }
+
+    
+    public String getOperationId() {
+        return operationId;
+    }
+
+    
+    public void setOperationId(String operationId) {
+        this.operationId = operationId;
+    }
+
+    
+    public String getOperation() {
+        return operation;
+    }
+
+    
+    public void setOperation(String operation) {
+        this.operation = operation;
+    }
+
+    
+    public String getServiceName() {
+		return serviceName;
+	}
+
+	public void setServiceName(String serviceName) {
+		this.serviceName = serviceName;
+	}
+
+	public String getUserId() {
+        return userId;
+    }
+
+    
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    
+    public String getResult() {
+        return result;
+    }
+
+    
+    public void setResult(String result) {
+        this.result = result;
+    }
+
+    
+    public String getOperationContent() {
+        return operationContent;
+    }
+
+    
+    public void setOperationContent(String operationContent) {
+        this.operationContent = operationContent;
+    }
+
+    
+    public String getProgress() {
+        return progress;
+    }
+
+    
+    public void setProgress(String progress) {
+        this.progress = progress;
+    }
+
+    
+    public String getReason() {
+        return reason;
+    }
+
+    
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+
+    
+    public Date getOperateAt() {
+        return operateAt;
+    }
+    
+    public Date getFinishedAt() {
+        return finishedAt;
+    }
+
+    @PrePersist
+    protected void onCreate() {
+    	this.finishedAt = this.operateAt = new Date();
+    }
+    
+    @PreUpdate
+    protected void onUpdate() {
+    	this.finishedAt = new Date();
+    }
+
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof OperationStatus)) {
+			return false;
+		}
+		OperationStatus castOther = (OperationStatus) other;
+		return Objects.equals(getServiceId(), castOther.getServiceId())
+				&& Objects.equals(getOperationId(), castOther.getOperationId());
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(getServiceId(), getOperationId());
+	}
+
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("serviceId", getServiceId()).append("operationId", getOperationId())
+				.append("operation", getOperation()).append("userId", getUserId()).append("result", getResult())
+				.append("operationContent", getOperationContent()).append("progress", getProgress())
+				.append("reason", getReason()).append("operateAt", getOperateAt()).append("finishedAt", getFinishedAt())
+				.toString();
+	}
+
+    
+
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationStatusId.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationStatusId.java
new file mode 100644
index 0000000..d07788e
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationStatusId.java
@@ -0,0 +1,79 @@
+/*-
+ * ============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.onap.so.db.request.beans;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+import com.openpojo.business.annotation.BusinessKey;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+public class OperationStatusId implements Serializable {
+
+	private static final long serialVersionUID = 3114959241155882723L;
+	
+	@BusinessKey
+	private String serviceId;
+	@BusinessKey
+	private String operationId;
+	
+	public OperationStatusId() {
+		
+	}
+	public OperationStatusId(String serviceId, String operationId) {
+		this.serviceId = serviceId;
+		this.operationId = operationId;
+	}
+	public String getServiceId() {
+		return serviceId;
+	}
+	public void setServiceId(String serviceId) {
+		this.serviceId = serviceId;
+	}
+	public String getOperationId() {
+		return operationId;
+	}
+	public void setOperationId(String operationId) {
+		this.operationId = operationId;
+	}
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof OperationStatusId)) {
+			return false;
+		}
+		OperationStatusId castOther = (OperationStatusId) other;
+		return Objects.equals(this.getServiceId(), castOther.getServiceId())
+				&& Objects.equals(this.getOperationId(), castOther.getOperationId());
+	}
+	@Override
+	public int hashCode() {
+		return Objects.hash(this.getServiceId(), this.getOperationId());
+	}
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("serviceId", getServiceId()).append("operationId", getOperationId())
+				.toString();
+	}
+
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationalEnvDistributionStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationalEnvDistributionStatus.java
new file mode 100644
index 0000000..a1e1278
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationalEnvDistributionStatus.java
@@ -0,0 +1,177 @@
+/*-
+ * ============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.onap.so.db.request.beans;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinColumns;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.PrePersist;
+import javax.persistence.PreUpdate;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import java.util.Objects;
+
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+
+@Entity
+@Table(name = "activate_operational_env_per_distributionid_status")
+public class OperationalEnvDistributionStatus implements Serializable {
+
+	/**
+	 * Serialization id.
+	 */
+	private static final long serialVersionUID = 7398393659281364650L;
+
+	@Id
+   	@Column(name = "DISTRIBUTION_ID", length=45)
+	private String distributionId;
+   	@Column(name = "OPERATIONAL_ENV_ID", length=45)
+	private String operationalEnvId;
+   	@Column(name = "SERVICE_MODEL_VERSION_ID", length=45)
+	private String serviceModelVersionId;
+   	@Column(name = "REQUEST_ID", length=45)
+	private String requestId;
+   	@Column(name = "DISTRIBUTION_ID_STATUS", length=45)
+	private String distributionIdStatus;
+   	@Column(name = "DISTRIBUTION_ID_ERROR_REASON", length=250)
+	private String distributionIdErrorReason;
+   	@Column(name = "CREATE_TIME", updatable=false)
+   	@Temporal(TemporalType.TIMESTAMP)
+	private Date createTime;
+   	@Column(name = "MODIFY_TIME")
+   	@Temporal(TemporalType.TIMESTAMP)
+	private Date modifyTime;
+   	
+	
+   	public OperationalEnvDistributionStatus() {
+   		
+   	}
+   	
+   	public OperationalEnvDistributionStatus(String distributionId, String operationalEnvId, String serviceModelVersionId) {
+   		this.distributionId = distributionId;
+   		this.operationalEnvId = operationalEnvId;
+   		this.serviceModelVersionId = serviceModelVersionId;
+   	}
+	public String getDistributionId() {
+		return distributionId;
+	}
+	
+	public void setDistributionId(String distributionId) {
+		this.distributionId = distributionId;
+	}
+	
+	public String getOperationalEnvId() {
+		return operationalEnvId;
+	}
+	
+	public void setOperationalEnvId(String operationalEnvId) {
+		this.operationalEnvId = operationalEnvId;
+	}
+	
+	public String getServiceModelVersionId() {
+		return serviceModelVersionId;
+	}
+	
+	public void setServiceModelVersionId(String serviceModelVersionId) {
+		this.serviceModelVersionId = serviceModelVersionId;
+	}
+
+	public String getRequestId() {
+		return requestId;
+	}
+
+	public void setRequestId(String requestId) {
+		this.requestId = requestId;
+	}
+	
+	public String getDistributionIdStatus() {
+		return distributionIdStatus;
+	}
+	
+	public void setDistributionIdStatus(String distributionIdStatus) {
+		this.distributionIdStatus = distributionIdStatus;
+	}
+	
+	public String getDistributionIdErrorReason() {
+		return distributionIdErrorReason;
+	}
+
+	public void setDistributionIdErrorReason(String distributionIdErrorReason) {
+		this.distributionIdErrorReason = distributionIdErrorReason;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+	
+	public Date getModifyTime() {
+		return modifyTime;
+	}
+	
+	@PrePersist
+	protected void onCreate() {
+		this.createTime = this.modifyTime = new Date();
+	}
+
+	@PreUpdate
+	protected void onUpdate() {
+		this.modifyTime = new Date();
+	}
+
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof OperationalEnvDistributionStatus)) {
+			return false;
+		}
+		OperationalEnvDistributionStatus castOther = (OperationalEnvDistributionStatus) other;
+		return Objects.equals(getDistributionId(), castOther.getDistributionId());
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(getDistributionId());
+	}
+
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("distributionId", getDistributionId())
+				.append("operationalEnvId", getOperationalEnvId())
+				.append("serviceModelVersionId", getServiceModelVersionId()).append("requestId", getRequestId())
+				.append("distributionIdStatus", getDistributionIdStatus())
+				.append("distributionIdErrorReason", getDistributionIdErrorReason())
+				.append("createTime", getCreateTime()).append("modifyTime", getModifyTime()).toString();
+	}
+	
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationalEnvServiceModelStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationalEnvServiceModelStatus.java
new file mode 100644
index 0000000..588822c
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationalEnvServiceModelStatus.java
@@ -0,0 +1,190 @@
+/*-
+ * ============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.onap.so.db.request.beans;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.PrePersist;
+import javax.persistence.PreUpdate;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import java.util.Objects;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * @author PB6115
+ *
+ */
+@IdClass(OperationalEnvServiceModelStatusId.class)
+@Entity
+@Table(name = "activate_operational_env_service_model_distribution_status")
+public class OperationalEnvServiceModelStatus implements Serializable {
+
+    /**
+	 * Serialization id.
+	 */
+	private static final long serialVersionUID = 8197084996598869656L;
+	
+	@Id
+   	@Column(name = "REQUEST_ID", length=45)
+	private String requestId;
+	@Id
+   	@Column(name = "OPERATIONAL_ENV_ID", length=45)
+	private String operationalEnvId;
+	@Id
+   	@Column(name = "SERVICE_MODEL_VERSION_ID", length=45)
+	private String serviceModelVersionId;
+   	@Column(name = "SERVICE_MOD_VER_FINAL_DISTR_STATUS", length=45)
+	private String serviceModelVersionDistrStatus;
+   	@Column(name = "RECOVERY_ACTION", length=30)
+	private String recoveryAction;
+   	@Column(name = "RETRY_COUNT_LEFT")
+	private Integer retryCount;
+   	@Column(name = "WORKLOAD_CONTEXT", length=80)
+	private String workloadContext;
+   	@Column(name = "CREATE_TIME", updatable=false)
+   	@Temporal(TemporalType.TIMESTAMP)
+	private Date createTime;
+   	@Column(name = "MODIFY_TIME")
+   	@Temporal(TemporalType.TIMESTAMP)
+	private Date modifyTime;
+	
+   	public OperationalEnvServiceModelStatus() {
+   		
+   	}
+   	
+   	public OperationalEnvServiceModelStatus(String requestId, String operationalEnvId, String serviceModelVersionId) {
+   		this.requestId = requestId;
+   		this.operationalEnvId = operationalEnvId;
+   		this.serviceModelVersionId = serviceModelVersionId;
+   	}
+	public String getRequestId() {
+		return requestId;
+	}
+	
+	public void setRequestId(String requestId) {
+		this.requestId = requestId;
+	}
+	
+	public String getOperationalEnvId() {
+		return operationalEnvId;
+	}
+	
+	public void setOperationalEnvId(String operationalEnvId) {
+		this.operationalEnvId = operationalEnvId;
+	}
+	
+	public String getServiceModelVersionId() {
+		return serviceModelVersionId;
+	}
+	
+	public void setServiceModelVersionId(String serviceModelVersionId) {
+		this.serviceModelVersionId = serviceModelVersionId;
+	}
+	
+	public String getServiceModelVersionDistrStatus() {
+		return serviceModelVersionDistrStatus;
+	}
+	
+	public void setServiceModelVersionDistrStatus(String serviceModelVersionDistrStatus) {
+		this.serviceModelVersionDistrStatus = serviceModelVersionDistrStatus;
+	}
+	
+	public String getRecoveryAction() {
+		return recoveryAction;
+	}
+	
+	public void setRecoveryAction(String recoveryAction) {
+		this.recoveryAction = recoveryAction;
+	}
+	
+	public Integer getRetryCount() {
+		return retryCount;
+	}
+	
+	public void setRetryCount(Integer retryCount) {
+		this.retryCount = retryCount;
+	}
+
+	public String getWorkloadContext() {
+		return workloadContext;
+	}
+
+	public void setWorkloadContext(String workloadContext) {
+		this.workloadContext = workloadContext;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	
+	public Date getModifyTime() {
+		return modifyTime;
+	}
+	
+	@PrePersist
+	protected void onCreate() {
+		this.createTime = this.modifyTime = new Date();
+	}
+
+	@PreUpdate
+	protected void onUpdate() {
+		this.modifyTime = new Date();
+	}
+
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof OperationalEnvServiceModelStatus)) {
+			return false;
+		}
+		OperationalEnvServiceModelStatus castOther = (OperationalEnvServiceModelStatus) other;
+		return Objects.equals(getRequestId(), castOther.getRequestId())
+				&& Objects.equals(getOperationalEnvId(), castOther.getOperationalEnvId());
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(getRequestId(), getOperationalEnvId());
+	}
+
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("requestId", getRequestId())
+				.append("operationalEnvId", getOperationalEnvId())
+				.append("serviceModelVersionId", getServiceModelVersionId())
+				.append("serviceModelVersionDistrStatus", getServiceModelVersionDistrStatus())
+				.append("recoveryAction", getRecoveryAction()).append("retryCount", getRetryCount())
+				.append("workloadContext", getWorkloadContext()).append("createTime", getCreateTime())
+				.append("modifyTime", getModifyTime()).toString();
+	}
+	
+
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationalEnvServiceModelStatusId.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationalEnvServiceModelStatusId.java
new file mode 100644
index 0000000..301e24f
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/OperationalEnvServiceModelStatusId.java
@@ -0,0 +1,82 @@
+/*-
+ * ============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.onap.so.db.request.beans;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+import com.openpojo.business.annotation.BusinessKey;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+public class OperationalEnvServiceModelStatusId implements Serializable {
+
+	private static final long serialVersionUID = 6885534735320068787L;
+	
+	@BusinessKey
+	private String requestId;
+	@BusinessKey
+	private String operationalEnvId;
+	@BusinessKey
+	private String serviceModelVersionId;
+	
+	public String getRequestId() {
+		return requestId;
+	}
+	public void setRequestId(String requestId) {
+		this.requestId = requestId;
+	}
+	public String getOperationalEnvId() {
+		return operationalEnvId;
+	}
+	public void setOperationalEnvId(String operationalEnvId) {
+		this.operationalEnvId = operationalEnvId;
+	}
+	public String getServiceModelVersionId() {
+		return serviceModelVersionId;
+	}
+	public void setServiceModelVersionId(String serviceModelVersionId) {
+		this.serviceModelVersionId = serviceModelVersionId;
+	}
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof OperationalEnvServiceModelStatusId)) {
+			return false;
+		}
+		OperationalEnvServiceModelStatusId castOther = (OperationalEnvServiceModelStatusId) other;
+		return Objects.equals(this.getRequestId(), castOther.getRequestId())
+				&& Objects.equals(this.getOperationalEnvId(), castOther.getOperationalEnvId())
+				&& Objects.equals(this.getServiceModelVersionId(), castOther.getServiceModelVersionId());
+	}
+	@Override
+	public int hashCode() {
+		return Objects.hash(this.getRequestId(), this.getOperationalEnvId(), this.getServiceModelVersionId());
+	}
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("requestId", getRequestId())
+				.append("operationalEnvId", getOperationalEnvId())
+				.append("serviceModelVersionId", getServiceModelVersionId()).toString();
+	}
+
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/ResourceOperationStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ResourceOperationStatus.java
similarity index 61%
rename from mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/ResourceOperationStatus.java
rename to mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ResourceOperationStatus.java
index 07650ac..386daa6 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/ResourceOperationStatus.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ResourceOperationStatus.java
@@ -17,10 +17,19 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
-package org.openecomp.mso.requestsdb;
+
+package org.onap.so.db.request.beans;
 
 import java.io.Serializable;
 
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+import java.util.Objects;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
 /**
  * The Resource operation status
  * <br>
@@ -30,6 +39,10 @@
  * @author
  * @version     ONAP Amsterdam Release  2017-08-28
  */
+
+@IdClass(ResourceOperationStatusId.class)
+@Entity
+@Table(name = "resource_operation_status")
 public class ResourceOperationStatus implements Serializable{
 
     /**
@@ -37,25 +50,36 @@
      */
     private static final long serialVersionUID = 1L;
 
-    private String serviceId = null;
+    @Id
+	@Column(name = "SERVICE_ID")
+    private String serviceId;
+    @Id
+	@Column(name = "OPERATION_ID", length=256)
+    private String operationId;
+    @Id
+	@Column(name = "RESOURCE_TEMPLATE_UUID")
+    private String resourceTemplateUUID;
+	
+    @Column(name = "OPER_TYPE", length=256)
+    private String operType;
     
-    private String operationId = null;
+    @Column(name = "RESOURCE_INSTANCE_ID", length=256)
+    private String resourceInstanceID;
     
-    private String resourceTemplateUUID = null;
+    @Column(name = "JOB_ID", length=256)
+    private String jobId;
     
-    private String operType = null;
+    @Column(name = "STATUS", length=256)
+    private String status;
     
-    private String resourceInstanceID = null;
-    
-    private String jobId = null;
-    
-    private String status = null;
-    
+    @Column(name = "PROGRESS", length=256)
     private String progress = "0";
     
-    private String errorCode = null;
+    @Column(name = "ERROR_CODE", length=256)
+    private String errorCode;
     
-    private String statusDescription = null;
+    @Column(name = "STATUS_DESCRIPOTION", length=256)
+    private String statusDescription;
 
     public ResourceOperationStatus(){
         
@@ -169,54 +193,31 @@
         this.operType = operType;
     }
 
-    /**
-     * <br>
-     * 
-     * @return
-     * @since   ONAP Amsterdam Release 
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((operationId == null) ? 0 : operationId.hashCode());
-        result = prime * result + ((resourceTemplateUUID == null) ? 0 : resourceTemplateUUID.hashCode());
-        result = prime * result + ((serviceId == null) ? 0 : serviceId.hashCode());
-        return result;
-    }
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof ResourceOperationStatus)) {
+			return false;
+		}
+		ResourceOperationStatus castOther = (ResourceOperationStatus) other;
+		return Objects.equals(getServiceId(), castOther.getServiceId())
+				&& Objects.equals(getOperationId(), castOther.getOperationId())
+				&& Objects.equals(getResourceTemplateUUID(), castOther.getResourceTemplateUUID());
+	}
 
-    /**
-     * <br>
-     * 
-     * @param obj
-     * @return
-     * @since   ONAP Amsterdam Release 
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if(this == obj)
-            return true;
-        if(obj == null)
-            return false;
-        if(getClass() != obj.getClass())
-            return false;
-        ResourceOperationStatus other = (ResourceOperationStatus)obj;
-        if(operationId == null) {
-            if(other.operationId != null)
-                return false;
-        } else if(!operationId.equals(other.operationId))
-            return false;
-        if(resourceTemplateUUID == null) {
-            if(other.resourceTemplateUUID != null)
-                return false;
-        } else if(!resourceTemplateUUID.equals(other.resourceTemplateUUID))
-            return false;
-        if(serviceId == null) {
-            if(other.serviceId != null)
-                return false;
-        } else if(!serviceId.equals(other.serviceId))
-            return false;
-        return true;
-    }   
-    
+	@Override
+	public int hashCode() {
+		return Objects.hash(getServiceId(), getOperationId(), getResourceTemplateUUID());
+	}
+
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("serviceId", getServiceId()).append("operationId", getOperationId())
+				.append("resourceTemplateUUID", getResourceTemplateUUID()).append("operType", getOperType())
+				.append("resourceInstanceID", getResourceInstanceID()).append("jobId", getJobId())
+				.append("status", getStatus()).append("progress", getProgress()).append("errorCode", getErrorCode())
+				.append("statusDescription", getStatusDescription()).toString();
+	}
 }
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ResourceOperationStatusId.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ResourceOperationStatusId.java
new file mode 100644
index 0000000..0f3656c
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/ResourceOperationStatusId.java
@@ -0,0 +1,91 @@
+/*-
+ * ============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.onap.so.db.request.beans;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+import com.openpojo.business.annotation.BusinessKey;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+public class ResourceOperationStatusId implements Serializable {
+
+	private static final long serialVersionUID = -7425019928845751157L;
+	
+	@BusinessKey
+	private String serviceId;
+	@BusinessKey
+    private String operationId;
+	@BusinessKey
+    private String resourceTemplateUUID;
+	
+	public ResourceOperationStatusId() {
+		
+	}
+	
+	public ResourceOperationStatusId(String serviceId, String operationId, String resourceTemplateUUID) {
+		this.serviceId = serviceId;
+		this.operationId = operationId;
+		this.resourceTemplateUUID = resourceTemplateUUID;
+	}
+	public String getServiceId() {
+		return serviceId;
+	}
+	public void setServiceId(String serviceId) {
+		this.serviceId = serviceId;
+	}
+	public String getOperationId() {
+		return operationId;
+	}
+	public void setOperationId(String operationId) {
+		this.operationId = operationId;
+	}
+	public String getResourceTemplateUUID() {
+		return resourceTemplateUUID;
+	}
+	public void setResourceTemplateUUID(String resourceTemplateUUID) {
+		this.resourceTemplateUUID = resourceTemplateUUID;
+	}
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof ResourceOperationStatusId)) {
+			return false;
+		}
+		ResourceOperationStatusId castOther = (ResourceOperationStatusId) other;
+		return Objects.equals(this.getServiceId(), castOther.getServiceId())
+				&& Objects.equals(this.getOperationId(), castOther.getOperationId())
+				&& Objects.equals(this.getResourceTemplateUUID(), castOther.getResourceTemplateUUID());
+	}
+	@Override
+	public int hashCode() {
+		return Objects.hash(this.getServiceId(), this.getOperationId(),this.getResourceTemplateUUID());
+	}
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("serviceId", getServiceId()).append("operationId", getOperationId())
+				.append("resourceTemplateUUID", getResourceTemplateUUID()).toString();
+	}
+
+    
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/SiteStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/SiteStatus.java
new file mode 100644
index 0000000..4e83ea5
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/SiteStatus.java
@@ -0,0 +1,105 @@
+/*-
+ * ============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.onap.so.db.request.beans;
+
+
+import java.time.format.DateTimeFormatter;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.onap.so.logger.MsoLogger;
+import java.util.Objects;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+@Entity
+@Table(name = "site_status")
+public class SiteStatus {
+    
+	@Column(name = "STATUS")
+    private boolean status;
+	@Id
+	@Column(name = "SITE_NAME")
+    private String siteName;
+	@Column(name = "CREATION_TIMESTAMP", insertable = false, updatable = false)
+    @Temporal(TemporalType.TIMESTAMP)
+    private Date created;
+
+    public SiteStatus() {
+    }
+
+    public SiteStatus(String siteName) {
+		this.siteName = siteName;
+	}
+
+	public Date getCreated() {
+        return created;
+    }
+
+    public String getSiteName() {
+        return siteName;
+    }
+
+    public void setSiteName(String siteName) {
+        this.siteName = siteName;
+    }
+
+    public void setStatus(boolean status) {
+        this.status = status;
+    }
+
+    public boolean getStatus() {
+        return status;
+    }
+
+    @PrePersist
+    protected void createdAt() {
+    	this.created = new Date();
+    }
+    @Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof SiteStatus)) {
+			return false;
+		}
+		SiteStatus castOther = (SiteStatus) other;
+		return Objects.equals(getSiteName(), castOther.getSiteName());
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(getSiteName());
+	}
+
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("status", getStatus()).append("siteName", getSiteName())
+				.append("created", getCreated()).toString();
+	}
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/Status.java
similarity index 69%
copy from mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java
copy to mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/Status.java
index 1d62efb..f6ee508 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/Status.java
@@ -18,24 +18,23 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.requestsdb;
+package org.onap.so.db.request.beans;
 
 
-/**
- * InfraActiveRequests
- */
-public class InfraActiveRequests extends InfraRequests {
+/*
+ * Enum for Status values returned by API Handler to Tail-F
+*/
+public enum Status {
+                    PENDING, INPROGRESS, COMPLETED, FAILED, TIMEOUT;
 
-	/**
-     * Serialization id.
-     */
-    private static final long serialVersionUID = 5003555140088137254L;
-
-	public InfraActiveRequests() {
-	    super ();
-	}
-
-	public InfraActiveRequests(String requestId, String action) {
-	    super (requestId, action);
-	}
-}
+    public boolean isFinished () {
+        switch (this) {
+            case COMPLETED:
+            case FAILED:
+            case TIMEOUT:
+                return true;
+            default:
+                return false;
+        }
+    }
+}
\ No newline at end of file
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogComponentDistributionStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogComponentDistributionStatus.java
new file mode 100644
index 0000000..f72a7b3
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogComponentDistributionStatus.java
@@ -0,0 +1,140 @@
+/*-
+ * ============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.onap.so.db.request.beans;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.PrePersist;
+import javax.persistence.PreUpdate;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import java.util.Objects;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+@IdClass(WatchdogComponentDistributionStatusId.class)
+@Entity
+@Table(name = "watchdog_per_component_distribution_status")
+public class WatchdogComponentDistributionStatus implements Serializable {
+
+
+	/**
+	 * Serialization id.
+	 */
+	private static final long serialVersionUID = -4344508954204488669L;
+	@Id
+	@Column(name = "DISTRIBUTION_ID", length=45)
+	private String distributionId;
+	@Id
+	@Column(name = "COMPONENT_NAME", length=45)
+	private String componentName;
+	@Column(name = "COMPONENT_DISTRIBUTION_STATUS", length=45)
+	private String componentDistributionStatus;
+	@Column(name = "CREATE_TIME", updatable=false)
+	@Temporal(TemporalType.TIMESTAMP)
+	private Date createTime;
+	@Column(name = "MODIFY_TIME")
+	@Temporal(TemporalType.TIMESTAMP)
+	private Date modifyTime;
+	
+	public WatchdogComponentDistributionStatus() {
+		
+	}
+	
+	public WatchdogComponentDistributionStatus(String distributionId, String componentName) {
+		this.distributionId = distributionId;
+		this.componentName = componentName;
+	}
+
+	public String getDistributionId() {
+		return distributionId;
+	}
+	
+	public void setDistributionId(String distributionId) {
+		this.distributionId = distributionId;
+	}
+	
+	public String getComponentName() {
+		return componentName;
+	}
+
+	public void setComponentName(String componentName) {
+		this.componentName = componentName;
+	}
+
+	public String getComponentDistributionStatus() {
+		return componentDistributionStatus;
+	}
+
+	public void setComponentDistributionStatus(String componentDistributionStatus) {
+		this.componentDistributionStatus = componentDistributionStatus;
+	}
+	
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public Date getModifyTime() {
+		return modifyTime;
+	}
+	
+	@PrePersist
+	protected void onCreate() {
+		this.createTime = this.modifyTime = new Date();
+	}
+
+	@PreUpdate
+	protected void onUpdate() {
+		this.modifyTime = new Date();
+	}
+
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof WatchdogComponentDistributionStatus)) {
+			return false;
+		}
+		WatchdogComponentDistributionStatus castOther = (WatchdogComponentDistributionStatus) other;
+		return Objects.equals(getDistributionId(), castOther.getDistributionId())
+				&& Objects.equals(getComponentName(), castOther.getComponentName());
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(getDistributionId(), getComponentName());
+	}
+
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("distributionId", getDistributionId())
+				.append("componentName", getComponentName())
+				.append("componentDistributionStatus", getComponentDistributionStatus())
+				.append("createTime", getCreateTime()).append("modifyTime", getModifyTime()).toString();
+	}
+
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogComponentDistributionStatusId.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogComponentDistributionStatusId.java
new file mode 100644
index 0000000..79e6fba
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogComponentDistributionStatusId.java
@@ -0,0 +1,73 @@
+/*-
+ * ============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.onap.so.db.request.beans;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+import com.openpojo.business.annotation.BusinessKey;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+public class WatchdogComponentDistributionStatusId implements Serializable {
+
+	private static final long serialVersionUID = -4785382368168200031L;
+	
+	@BusinessKey
+	private String distributionId;
+	@BusinessKey
+	private String componentName;
+	
+	public String getDistributionId() {
+		return distributionId;
+	}
+	public void setDistributionId(String distributionId) {
+		this.distributionId = distributionId;
+	}
+	public String getComponentName() {
+		return componentName;
+	}
+	public void setComponentName(String componentName) {
+		this.componentName = componentName;
+	}
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof WatchdogComponentDistributionStatusId)) {
+			return false;
+		}
+		WatchdogComponentDistributionStatusId castOther = (WatchdogComponentDistributionStatusId) other;
+		return Objects.equals(this.getDistributionId(), castOther.getDistributionId())
+				&& Objects.equals(this.getComponentName(), castOther.getComponentName());
+	}
+	@Override
+	public int hashCode() {
+		return Objects.hash(this.getDistributionId(), this.getComponentName());
+	}
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("distributionId", getDistributionId())
+				.append("componentName", getComponentName()).toString();
+	}
+
+	
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogDistributionStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogDistributionStatus.java
new file mode 100644
index 0000000..40c81b9
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogDistributionStatus.java
@@ -0,0 +1,124 @@
+/*-
+ * ============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.onap.so.db.request.beans;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.PrePersist;
+import javax.persistence.PreUpdate;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import java.util.Objects;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+@Entity
+@Table(name = "watchdog_distributionid_status")
+public class WatchdogDistributionStatus implements Serializable {
+
+	/**
+	 * Serialization id.
+	 */
+	private static final long serialVersionUID = -4449711060885719079L;
+
+	@Id
+	@Column(name = "DISTRIBUTION_ID", length=45)
+	private String distributionId;
+	@Column(name = "DISTRIBUTION_ID_STATUS", length=45)
+	private String distributionIdStatus;
+	@Column(name = "CREATE_TIME", updatable=false)
+	@Temporal(TemporalType.TIMESTAMP)
+	private Date createTime;
+	@Column(name = "MODIFY_TIME")
+	@Temporal(TemporalType.TIMESTAMP)
+	private Date modifyTime;
+	
+	public WatchdogDistributionStatus() {
+		
+	}
+	
+	public WatchdogDistributionStatus(String distributionId) {
+		this.distributionId = distributionId;
+	}
+
+	public String getDistributionId() {
+		return distributionId;
+	}
+	
+	public void setDistributionId(String distributionId) {
+		this.distributionId = distributionId;
+	}
+	
+	public String getDistributionIdStatus() {
+		return distributionIdStatus;
+	}
+	
+	public void setDistributionIdStatus(String distributionIdStatus) {
+		this.distributionIdStatus = distributionIdStatus;
+	}
+	
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public Date getModifyTime() {
+		return modifyTime;
+	}
+	
+	@PrePersist
+	protected void onCreate() {
+		this.createTime = this.modifyTime = new Date();
+	}
+
+	@PreUpdate
+	protected void onUpdate() {
+		this.modifyTime = new Date();
+	}
+
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof WatchdogDistributionStatus)) {
+			return false;
+		}
+		WatchdogDistributionStatus castOther = (WatchdogDistributionStatus) other;
+		return Objects.equals(getDistributionId(), castOther.getDistributionId());
+	}
+
+	@Override
+	public int hashCode() {
+		return Objects.hash(getDistributionId());
+	}
+
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("distributionId", getDistributionId())
+				.append("distributionIdStatus", getDistributionIdStatus()).append("createTime", getCreateTime())
+				.append("modifyTime", getModifyTime()).toString();
+	}
+	
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogServiceModVerIdLookup.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogServiceModVerIdLookup.java
new file mode 100644
index 0000000..77089cb
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogServiceModVerIdLookup.java
@@ -0,0 +1,111 @@
+/*-
+ * ============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.onap.so.db.request.beans;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import java.util.Objects;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+@IdClass(WatchdogServiceModVerIdLookupId.class)
+@Entity
+@Table(name = "watchdog_service_mod_ver_id_lookup")
+public class WatchdogServiceModVerIdLookup implements Serializable {
+
+	/**
+	 * Serialization id.
+	 */
+	private static final long serialVersionUID = 7783869906430250355L;
+	
+	@Id
+	@Column(name = "DISTRIBUTION_ID", length=45)
+	private String distributionId;
+	@Id
+	@Column(name = "SERVICE_MODEL_VERSION_ID", length=45)
+	private String serviceModelVersionId;
+	@Column(name = "CREATE_TIME", updatable=false)
+	@Temporal(TemporalType.TIMESTAMP)
+	private Date createTime;
+	
+	public WatchdogServiceModVerIdLookup() {
+		
+	}
+	public WatchdogServiceModVerIdLookup(String distributionId, String serviceModelVersionId) {
+		this.distributionId = distributionId;
+		this.serviceModelVersionId = serviceModelVersionId;
+	}
+
+	public String getDistributionId() {
+		return distributionId;
+	}
+	
+	public void setDistributionId(String distributionId) {
+		this.distributionId = distributionId;
+	}
+	
+	public String getServiceModelVersionId() {
+		return serviceModelVersionId;
+	}
+
+	public void setServiceModelVersionId(String serviceModelVersionId) {
+		this.serviceModelVersionId = serviceModelVersionId;
+	}
+	
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	@PrePersist
+	protected void onCreate() {
+		this.createTime = new Date();
+	}
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof WatchdogServiceModVerIdLookup)) {
+			return false;
+		}
+		WatchdogServiceModVerIdLookup castOther = (WatchdogServiceModVerIdLookup) other;
+		return Objects.equals(getDistributionId(), castOther.getDistributionId())
+				&& Objects.equals(getServiceModelVersionId(), castOther.getServiceModelVersionId());
+	}
+	@Override
+	public int hashCode() {
+		return Objects.hash(getDistributionId(), getServiceModelVersionId());
+	}
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("distributionId", getDistributionId())
+				.append("serviceModelVersionId", getServiceModelVersionId()).append("createTime", getCreateTime())
+				.toString();
+	}
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogServiceModVerIdLookupId.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogServiceModVerIdLookupId.java
new file mode 100644
index 0000000..2c0b67b
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogServiceModVerIdLookupId.java
@@ -0,0 +1,74 @@
+/*-
+ * ============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.onap.so.db.request.beans;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+import com.openpojo.business.annotation.BusinessKey;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+public class WatchdogServiceModVerIdLookupId implements Serializable{
+
+	private static final long serialVersionUID = 9112709226209619993L;
+	
+	@BusinessKey
+	private String distributionId;
+	@BusinessKey
+	private String serviceModelVersionId;
+	public String getDistributionId() {
+		return distributionId;
+	}
+	public void setDistributionId(String distributionId) {
+		this.distributionId = distributionId;
+	}
+	public String getServiceModelVersionId() {
+		return serviceModelVersionId;
+	}
+	public void setServiceModelVersionId(String serviceModelVersionId) {
+		this.serviceModelVersionId = serviceModelVersionId;
+	}
+	@Override
+	public boolean equals(final Object other) {
+		if (this == other) {
+			return true;
+		}
+		if (!(other instanceof WatchdogServiceModVerIdLookupId)) {
+			return false;
+		}
+		WatchdogServiceModVerIdLookupId castOther = (WatchdogServiceModVerIdLookupId) other;
+		return Objects.equals(this.getDistributionId(), castOther.getDistributionId())
+				&& Objects.equals(getServiceModelVersionId(), castOther.getServiceModelVersionId());
+	}
+	@Override
+	public int hashCode() {
+		return Objects.hash(this.getDistributionId(), this.getServiceModelVersionId());
+	}
+	@Override
+	public String toString() {
+		return new ToStringBuilder(this).append("distributionId", getDistributionId())
+				.append("serviceModelVersionId", getServiceModelVersionId()).toString();
+	}
+
+
+	
+
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/ArchivedInfraRequestsRepository.java
similarity index 66%
copy from mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java
copy to mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/ArchivedInfraRequestsRepository.java
index 1d62efb..f3e92ed 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/ArchivedInfraRequestsRepository.java
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP - SO
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 - 2018 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.
@@ -18,24 +18,13 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.requestsdb;
+package org.onap.so.db.request.data.repository;
 
+import org.onap.so.db.request.beans.ArchivedInfraRequests;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
 
-/**
- * InfraActiveRequests
- */
-public class InfraActiveRequests extends InfraRequests {
+@Repository
+public interface ArchivedInfraRequestsRepository extends JpaRepository<ArchivedInfraRequests, String> {	
 
-	/**
-     * Serialization id.
-     */
-    private static final long serialVersionUID = 5003555140088137254L;
-
-	public InfraActiveRequests() {
-	    super ();
-	}
-
-	public InfraActiveRequests(String requestId, String action) {
-	    super (requestId, action);
-	}
 }
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepository.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepository.java
new file mode 100644
index 0000000..cd25b12
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepository.java
@@ -0,0 +1,41 @@
+/*-
+ * ============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.onap.so.db.request.data.repository;
+
+import java.util.Date;
+import java.util.List;
+
+import org.onap.so.db.request.beans.InfraActiveRequests;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.rest.core.annotation.RepositoryRestResource;
+
+
+@RepositoryRestResource(collectionResourceRel = "infraActiveRequests", path = "infraActiveRequests")
+public interface InfraActiveRequestsRepository extends JpaRepository<InfraActiveRequests, String>, InfraActiveRequestsRepositoryCustom {
+	
+	InfraActiveRequests findOneByRequestIdOrClientRequestId(String requestId, String clientRequestId);
+	InfraActiveRequests findOneByRequestIdOrClientRequestIdAndRequestType(String requestId,String clientRequestId, String requestType);
+	InfraActiveRequests findOneByRequestId(String string);
+	InfraActiveRequests findOneByRequestBody(String requestBody);
+	List<InfraActiveRequests> findByEndTimeLessThan(Date endTime, Pageable request);
+	List<InfraActiveRequests> findByStartTimeLessThanAndEndTime(Date startTime, Date endTime, Pageable request);
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryCustom.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryCustom.java
new file mode 100644
index 0000000..ba237bf
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryCustom.java
@@ -0,0 +1,57 @@
+/*-
+ * ============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.onap.so.db.request.data.repository;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.onap.so.db.request.beans.InfraActiveRequests;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface InfraActiveRequestsRepositoryCustom {
+
+	public boolean healthCheck();
+
+	public InfraActiveRequests getRequestFromInfraActive(String requestId);
+
+	public InfraActiveRequests checkInstanceNameDuplicate(HashMap<String, String> instanceIdMap, String instanceName,
+			String requestScope);
+
+	public List<InfraActiveRequests> getOrchestrationFiltersFromInfraActive(Map<String, List<String>> orchestrationMap);
+
+	// Added this method for Tenant Isolation project ( 1802-295491a) to query the mso_requests DB 
+	// (infra_active_requests table) for operationalEnvId and OperationalEnvName
+	public List<InfraActiveRequests> getCloudOrchestrationFiltersFromInfraActive(Map<String, String> orchestrationMap);
+
+	public List<InfraActiveRequests> getRequestListFromInfraActive(String queryAttributeName, String queryValue,
+			String requestType);
+
+	public InfraActiveRequests getRequestFromInfraActive(String requestId, String requestType);
+
+	public InfraActiveRequests checkDuplicateByVnfName(String vnfName, String action, String requestType);
+
+	public InfraActiveRequests checkDuplicateByVnfId(String vnfId, String action, String requestType);
+
+	public InfraActiveRequests checkVnfIdStatus(String operationalEnvironmentId);
+	
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java
new file mode 100644
index 0000000..3240972
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/InfraActiveRequestsRepositoryImpl.java
@@ -0,0 +1,566 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.onap.so.db.request.data.repository;
+
+import java.sql.Timestamp;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NonUniqueResultException;
+import javax.persistence.Query;
+import javax.persistence.TypedQuery;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Order;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+
+import org.onap.so.db.request.beans.InfraActiveRequests;
+import org.onap.so.db.request.beans.OperationStatus;
+import org.onap.so.db.request.beans.ResourceOperationStatus;
+import org.onap.so.logger.MsoLogger;
+import org.onap.so.requestsdb.RequestsDbConstant;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.data.domain.Example;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Repository
+@Transactional(readOnly = true)
+public class InfraActiveRequestsRepositoryImpl implements InfraActiveRequestsRepositoryCustom {
+
+	@Qualifier("requestEntityManagerFactory")
+	@Autowired	
+	private EntityManager entityManager;
+    
+    protected static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL, InfraActiveRequestsRepositoryImpl.class);
+    
+    protected static final String         SOURCE                     = "source";
+    protected static final String         START_TIME                 = "startTime";
+    protected static final String         REQUEST_TYPE               = "requestType";
+    protected static final String         SERVICE_INSTANCE_ID        = "serviceInstanceId";
+    protected static final String         SERVICE_INSTANCE_NAME      = "serviceInstanceName";
+    protected static final String         VNF_INSTANCE_NAME          = "vnfName";
+    protected static final String         VNF_INSTANCE_ID            = "vnfId";
+    protected static final String         VOLUME_GROUP_INSTANCE_NAME = "volumeGroupName";
+    protected static final String         VOLUME_GROUP_INSTANCE_ID   = "volumeGroupId";
+    protected static final String         VFMODULE_INSTANCE_NAME     = "vfModuleName";
+    protected static final String         VFMODULE_INSTANCE_ID       = "vfModuleId";
+    protected static final String         NETWORK_INSTANCE_NAME      = "networkName";
+    protected static final String		  CONFIGURATION_INSTANCE_ID  = "configurationId";
+    protected static final String		  CONFIGURATION_INSTANCE_NAME= "configurationName";
+    protected static final String		  OPERATIONAL_ENV_ID  		 = "operationalEnvId";
+    protected static final String		  OPERATIONAL_ENV_NAME		 = "operationalEnvName";
+    protected static final String         NETWORK_INSTANCE_ID        = "networkId";
+    protected static final String         GLOBAL_SUBSCRIBER_ID       = "globalSubscriberId";
+    protected static final String         SERVICE_NAME_VERSION_ID    = "serviceNameVersionId";
+    protected static final String         SERVICE_ID                 = "serviceId";
+    protected static final String         SERVICE_VERSION            = "serviceVersion";
+    protected static final String         REQUEST_ID                 = "requestId";
+    protected static final String         REQUESTOR_ID               = "requestorId";
+    
+    @Autowired
+    private OperationStatusRepository operationStatusRepository;
+
+
+    /* (non-Javadoc)
+	 * @see org.onap.so.requestsdb.InfraActiveRequestsRepositoryCustom#healthCheck()
+	 */
+    @Override
+	public boolean healthCheck () {
+       
+    	Query query = entityManager.createNativeQuery(" show tables ");
+
+        List<?> list = query.getResultList();
+
+        return true;
+    }
+
+    private List<InfraActiveRequests> executeInfraQuery (CriteriaQuery<InfraActiveRequests> crit, List <Predicate> predicates, Order order) {
+
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Execute query on infra active request table");
+        
+        List <InfraActiveRequests> results = new ArrayList<InfraActiveRequests>();
+
+        try {
+            CriteriaBuilder cb = entityManager.getCriteriaBuilder();
+			crit.where(cb.and(predicates.toArray(new Predicate[0])));
+            crit.orderBy(order);
+            results = entityManager.createQuery(crit).getResultList();
+
+        } finally {
+            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "getInfraActiveRequest", null);
+        }
+        return results;
+    }
+    
+    /* (non-Javadoc)
+	 * @see org.onap.so.requestsdb.InfraActiveRequestsRepositoryCustom#getRequestFromInfraActive(java.lang.String)
+	 */
+    @Override
+	public InfraActiveRequests getRequestFromInfraActive (String requestId) {
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Get request " + requestId + " from InfraActiveRequests DB");
+
+        InfraActiveRequests ar = null;
+        try {
+            Query query = entityManager.createQuery ("from InfraActiveRequests where requestId = :requestId OR clientRequestId = :requestId");
+            query.setParameter (REQUEST_ID, requestId);
+            ar = this.getSingleResult(query);
+        } finally {
+         
+            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "InfraRequestDB", "getRequestFromInfraActive", null);
+        }
+        return ar;
+    }
+    
+    /* (non-Javadoc)
+	 * @see org.onap.so.requestsdb.InfraActiveRequestsRepositoryCustom#checkInstanceNameDuplicate(java.util.HashMap, java.lang.String, java.lang.String)
+	 */
+    @Override
+	public InfraActiveRequests checkInstanceNameDuplicate (HashMap<String,String> instanceIdMap, String instanceName, String requestScope) {
+
+    	List <Predicate> predicates = new LinkedList <> ();
+    	CriteriaBuilder cb = entityManager.getCriteriaBuilder();
+		CriteriaQuery<InfraActiveRequests> crit = cb.createQuery(InfraActiveRequests.class);
+		Root<InfraActiveRequests> tableRoot = crit.from(InfraActiveRequests.class);
+		
+        if(instanceName != null && !instanceName.equals("")) {
+        	
+        	if("service".equals(requestScope)){
+        		predicates.add (cb.equal(tableRoot.get(SERVICE_INSTANCE_NAME), instanceName));
+        	} else if("vnf".equals(requestScope)){
+        		predicates.add (cb.equal(tableRoot.get(VNF_INSTANCE_NAME), instanceName));
+        	} else if("volumeGroup".equals(requestScope)){
+        		predicates.add (cb.equal(tableRoot.get(VOLUME_GROUP_INSTANCE_NAME), instanceName));
+        	} else if("vfModule".equals(requestScope)){
+        		predicates.add (cb.equal(tableRoot.get(VFMODULE_INSTANCE_NAME), instanceName));
+        	} else if("network".equals(requestScope)){
+        		predicates.add (cb.equal(tableRoot.get(NETWORK_INSTANCE_NAME), instanceName));
+        	} else if(requestScope.equals("configuration")) {
+        		predicates.add (cb.equal(tableRoot.get(CONFIGURATION_INSTANCE_NAME), instanceName));
+        	} else if(requestScope.equals("operationalEnvironment")) {
+        		predicates.add (cb.equal(tableRoot.get(OPERATIONAL_ENV_NAME), instanceName));
+        	}
+        
+        } else {
+            if(instanceIdMap != null){
+            	if("service".equals(requestScope) && instanceIdMap.get("serviceInstanceId") != null){
+            		predicates.add (cb.equal(tableRoot.get(SERVICE_INSTANCE_ID), instanceIdMap.get("serviceInstanceId")));
+             	}
+            
+            	if("vnf".equals(requestScope) && instanceIdMap.get("vnfInstanceId") != null){
+            		predicates.add (cb.equal(tableRoot.get(VNF_INSTANCE_ID), instanceIdMap.get("vnfInstanceId" )));
+             	}
+            
+            	if("vfModule".equals(requestScope) && instanceIdMap.get("vfModuleInstanceId") != null){
+            		predicates.add (cb.equal(tableRoot.get(VFMODULE_INSTANCE_ID), instanceIdMap.get("vfModuleInstanceId")));
+             	}
+            
+            	if("volumeGroup".equals(requestScope) && instanceIdMap.get("volumeGroupInstanceId") != null){
+            		predicates.add (cb.equal(tableRoot.get(VOLUME_GROUP_INSTANCE_ID), instanceIdMap.get("volumeGroupInstanceId")));
+             	}
+            
+            	if("network".equals(requestScope) && instanceIdMap.get("networkInstanceId") != null){
+            		predicates.add (cb.equal(tableRoot.get(NETWORK_INSTANCE_ID), instanceIdMap.get("networkInstanceId")));
+            	}
+            	
+            	if(requestScope.equals("configuration") && instanceIdMap.get("configurationInstanceId") != null){
+            		predicates.add (cb.equal(tableRoot.get(CONFIGURATION_INSTANCE_ID), instanceIdMap.get("configurationInstanceId")));
+            	}
+            	
+            	if(requestScope.equals("operationalEnvironment") && instanceIdMap.get("operationalEnvironmentId") != null) {
+            		predicates.add (cb.equal(tableRoot.get(OPERATIONAL_ENV_ID), instanceIdMap.get("operationalEnvironmentId")));
+            	}
+            }
+        }
+        
+        predicates.add (tableRoot.get("requestStatus").in(Arrays.asList("PENDING", "IN_PROGRESS", "TIMEOUT", "PENDING_MANUAL_TASK")));
+        
+        Order order = cb.desc(tableRoot.get(START_TIME));
+        
+        List<InfraActiveRequests> dupList = executeInfraQuery(crit, predicates, order);
+        
+        InfraActiveRequests infraActiveRequests = null;
+        
+        if(dupList != null && !dupList.isEmpty()){
+        	infraActiveRequests = dupList.get(0);
+        }
+         	
+        return infraActiveRequests; 
+    }
+      
+    /* (non-Javadoc)
+	 * @see org.onap.so.requestsdb.InfraActiveRequestsRepositoryCustom#getOrchestrationFiltersFromInfraActive(java.util.Map)
+	 */
+    @Override
+	public List<InfraActiveRequests> getOrchestrationFiltersFromInfraActive (Map<String, List<String>> orchestrationMap) {
+        
+    	
+    	List <Predicate> predicates = new LinkedList <> ();
+    	CriteriaBuilder cb = entityManager.getCriteriaBuilder();
+		CriteriaQuery<InfraActiveRequests> crit = cb.createQuery(InfraActiveRequests.class);
+		Root<InfraActiveRequests> tableRoot = crit.from(InfraActiveRequests.class);
+    	for (Map.Entry<String, List<String>> entry : orchestrationMap.entrySet())
+    	{
+    		String mapKey = entry.getKey();
+    		if("serviceInstanceId".equalsIgnoreCase(mapKey)) {
+    			mapKey = "serviceInstanceId";
+    		} else if("serviceInstanceName".equalsIgnoreCase(mapKey)) {
+    			mapKey = "serviceInstanceName";
+    		} else if("vnfInstanceId".equalsIgnoreCase(mapKey)){
+    	    	mapKey = "vnfId";
+     	    } else if("vnfInstanceName".equalsIgnoreCase(mapKey)) {
+    	    	mapKey = "vnfName";
+    	    } else if("vfModuleInstanceId".equalsIgnoreCase(mapKey)) {
+    	    	mapKey = "vfModuleId";
+    	    } else if("vfModuleInstanceName".equalsIgnoreCase(mapKey)) {
+    	    	mapKey = "vfModuleName";
+    	    } else if("volumeGroupInstanceId".equalsIgnoreCase(mapKey)) {
+    	    	mapKey = "volumeGroupId";
+    	    } else if("volumeGroupInstanceName".equalsIgnoreCase(mapKey)) {
+    	    	mapKey = "volumeGroupName";
+    	    } else if("networkInstanceId".equalsIgnoreCase(mapKey)) {
+    	    	mapKey = "networkId";
+    	    } else if("networkInstanceName".equalsIgnoreCase(mapKey)) {
+    	    	mapKey = "networkName";
+    	    } else if(mapKey.equalsIgnoreCase("configurationInstanceId")) {    	    	
+    	    	mapKey = "configurationId";
+    	    } else if(mapKey.equalsIgnoreCase("configurationInstanceName")) {    	    	
+    	    	mapKey = "configurationName";
+    	    } else if("lcpCloudRegionId".equalsIgnoreCase(mapKey)) {
+    	    	mapKey = "aicCloudRegion";
+    	    } else if("tenantId".equalsIgnoreCase(mapKey)) {
+    	    	mapKey = "tenantId";
+    	    } else if("modelType".equalsIgnoreCase(mapKey)) {
+    	    	mapKey = "requestScope";
+    	    } else if("requestorId".equalsIgnoreCase(mapKey)) {
+    	    	mapKey = "requestorId";
+    	    } else if("requestExecutionDate".equalsIgnoreCase(mapKey)) {
+    	    	mapKey = "startTime";
+    	    }
+    	    
+    		String propertyValue = entry.getValue().get(1);
+    		if ("startTime".equals(mapKey)) {
+    			SimpleDateFormat format = new SimpleDateFormat("MM-dd-yyyy");    	        
+    			try {
+	    	        Date thisDate = format.parse(propertyValue);
+	    	        Timestamp minTime = new Timestamp(thisDate.getTime());	    	        
+	    	        Timestamp maxTime = new Timestamp(thisDate.getTime() + TimeUnit.DAYS.toMillis(1));
+	    	        
+	    	        if("DOES_NOT_EQUAL".equalsIgnoreCase(entry.getValue().get(0))) {
+	    	        	predicates.add(cb.or(cb.lessThan(tableRoot.get(mapKey), minTime), cb.greaterThanOrEqualTo(tableRoot.get(mapKey), maxTime)));	
+	        		} else {	        			
+	        			predicates.add(cb.between(tableRoot.get(mapKey), minTime, maxTime));        		       			
+	        		}    
+    			}
+    			catch (Exception e){
+    				msoLogger.debug("Exception in getOrchestrationFiltersFromInfraActive(): + " + e.getMessage(), e);
+    				return null;
+    			}
+    		}
+    		else if("DOES_NOT_EQUAL".equalsIgnoreCase(entry.getValue().get(0))) {
+    			predicates.add(cb.notEqual(tableRoot.get(mapKey), propertyValue));
+    		} else {
+    			predicates.add(cb.equal(tableRoot.get(mapKey), propertyValue));
+    		}
+    	    
+    	}
+    	
+         Order order = cb.asc(tableRoot.get(START_TIME));
+
+        return executeInfraQuery (crit, predicates, order);
+    }
+
+    // Added this method for Tenant Isolation project ( 1802-295491a) to query the mso_requests DB 
+    // (infra_active_requests table) for operationalEnvId and OperationalEnvName
+    /* (non-Javadoc)
+	 * @see org.onap.so.requestsdb.InfraActiveRequestsRepositoryCustom#getCloudOrchestrationFiltersFromInfraActive(java.util.Map)
+	 */
+    @Override
+	public List<InfraActiveRequests> getCloudOrchestrationFiltersFromInfraActive (Map<String, String> orchestrationMap) {
+    	List <Predicate> predicates = new LinkedList <> ();
+    	CriteriaBuilder cb = entityManager.getCriteriaBuilder();
+		CriteriaQuery<InfraActiveRequests> crit = cb.createQuery(InfraActiveRequests.class);
+		Root<InfraActiveRequests> tableRoot = crit.from(InfraActiveRequests.class);
+    	
+    	// Add criteria on OperationalEnvironment RequestScope when requestorId is only specified in the filter
+    	// as the same requestorId can also match on different API methods
+    	String resourceType = orchestrationMap.get("resourceType");
+    	if(resourceType == null) {
+    		predicates.add(cb.equal(tableRoot.get("requestScope"), "operationalEnvironment"));
+    	}
+    	
+    	for (Map.Entry<String, String> entry : orchestrationMap.entrySet()) {
+    		String mapKey = entry.getKey();
+    		if(mapKey.equalsIgnoreCase("requestorId")) {
+    	    	mapKey = "requestorId";
+    	    } else if(mapKey.equalsIgnoreCase("requestExecutionDate")) {    	    	
+    	    	mapKey = "startTime";
+    	    } else if(mapKey.equalsIgnoreCase("operationalEnvironmentId")) {    	    	
+    	    	mapKey = "operationalEnvId";
+    	    } else if(mapKey.equalsIgnoreCase("operationalEnvironmentName")) {    	    	
+    	    	mapKey = "operationalEnvName";
+    	    } else if(mapKey.equalsIgnoreCase("resourceType")) {    	    	
+    	    	mapKey = "requestScope";
+    	    }
+    	    
+    		String propertyValue = entry.getValue();
+    		if (mapKey.equals("startTime")) {    			
+    			SimpleDateFormat format = new SimpleDateFormat("MM-dd-yyyy");    	        
+    			try {
+	    	        Date thisDate = format.parse(propertyValue);
+	    	        Timestamp minTime = new Timestamp(thisDate.getTime());	    	        
+	    	        Timestamp maxTime = new Timestamp(thisDate.getTime() + TimeUnit.DAYS.toMillis(1));
+	    	        
+	        		predicates.add(cb.between(tableRoot.get(mapKey), minTime, maxTime));        		       			
+    			}
+    			catch (Exception e){
+    				msoLogger.debug("Exception in getCloudOrchestrationFiltersFromInfraActive(): + " + e.getMessage());
+    				return null;
+    			}
+    		} else {
+    			predicates.add(cb.equal(tableRoot.get(mapKey), propertyValue));
+    		}
+    	}
+    	
+         Order order = cb.asc(tableRoot.get(START_TIME));
+         return executeInfraQuery (crit, predicates, order);
+    }
+
+    /* (non-Javadoc)
+	 * @see org.onap.so.requestsdb.InfraActiveRequestsRepositoryCustom#getRequestListFromInfraActive(java.lang.String, java.lang.String, java.lang.String)
+	 */
+    @Override
+	public List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName,
+                                                                            String queryValue,
+                                                                            String requestType) {
+        msoLogger.debug ("Get list of infra requests from DB with " + queryAttributeName + " = " + queryValue);
+
+        
+        try {
+			CriteriaBuilder cb = entityManager.getCriteriaBuilder();
+            CriteriaQuery<InfraActiveRequests> crit = cb.createQuery(InfraActiveRequests.class);
+			Root<InfraActiveRequests> candidateRoot = crit.from(InfraActiveRequests.class);
+			Predicate isEqual = cb.equal(candidateRoot.get(queryAttributeName), queryValue);
+			Predicate equalRequestType = cb.equal(candidateRoot.get(REQUEST_TYPE), requestType);
+			Predicate isNull = cb.isNull(candidateRoot.get(REQUEST_TYPE));
+			Predicate orClause = cb.or(equalRequestType, isNull);
+			Order orderDesc = cb.desc(candidateRoot.get(START_TIME));
+			Order orderAsc = cb.asc(candidateRoot.get(SOURCE));
+			crit.where(cb.and(isEqual, orClause)).orderBy(orderDesc, orderAsc);
+			
+            @SuppressWarnings("unchecked")
+            List <InfraActiveRequests> arList = entityManager.createQuery(crit).getResultList();
+            if (arList != null && !arList.isEmpty ()) {
+                return arList;
+            }
+        } finally {
+           // msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "getRequestListFromInfraActive", null);
+        }
+        return null;
+    }
+
+
+    /* (non-Javadoc)
+	 * @see org.onap.so.requestsdb.InfraActiveRequestsRepositoryCustom#getRequestFromInfraActive(java.lang.String, java.lang.String)
+	 */
+    @Override
+	public InfraActiveRequests getRequestFromInfraActive (String requestId, String requestType) {
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Get infra request from DB with id " + requestId);
+
+        InfraActiveRequests ar = null;
+        try {
+            Query query = entityManager.createQuery ("from InfraActiveRequests where (requestId = :requestId OR clientRequestId = :requestId) and requestType = :requestType");
+            query.setParameter (REQUEST_ID, requestId);
+            query.setParameter (REQUEST_TYPE, requestType);
+            ar = this.getSingleResult(query);
+        } finally {
+            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "getRequestFromInfraActive", null);
+        }
+        return ar;
+    }
+    
+
+    /* (non-Javadoc)
+	 * @see org.onap.so.requestsdb.InfraActiveRequestsRepositoryCustom#checkDuplicateByVnfName(java.lang.String, java.lang.String, java.lang.String)
+	 */
+    @Override
+	public InfraActiveRequests checkDuplicateByVnfName (String vnfName, String action, String requestType) {
+
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Get infra request from DB for VNF " + vnfName + " and action " + action + " and requestType " + requestType);
+
+        InfraActiveRequests ar = null;
+        try {
+            Query query = entityManager.createQuery ("from InfraActiveRequests where vnfName = :vnfName and action = :action and (requestStatus = 'PENDING' or requestStatus = 'IN_PROGRESS' or requestStatus = 'TIMEOUT' or requestStatus = 'PENDING_MANUAL_TASK') and requestType = :requestType ORDER BY startTime DESC");
+            query.setParameter ("vnfName", vnfName);
+            query.setParameter ("action", action);
+            query.setParameter (REQUEST_TYPE, requestType);
+            @SuppressWarnings("unchecked")
+            List <InfraActiveRequests> results = query.getResultList();
+            if (!results.isEmpty ()) {
+                ar = results.get (0);
+            }
+        } finally {
+            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "checkDuplicateByVnfName", null);
+        }
+
+        return ar;
+    }
+
+    /* (non-Javadoc)
+	 * @see org.onap.so.requestsdb.InfraActiveRequestsRepositoryCustom#checkDuplicateByVnfId(java.lang.String, java.lang.String, java.lang.String)
+	 */
+    @Override
+	public InfraActiveRequests checkDuplicateByVnfId (String vnfId, String action, String requestType) {
+
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Get list of infra requests from DB for VNF " + vnfId + " and action " + action);
+
+        InfraActiveRequests ar = null;
+        try {
+            Query query = entityManager.createQuery ("from InfraActiveRequests where vnfId = :vnfId and action = :action and (requestStatus = 'PENDING' or requestStatus = 'IN_PROGRESS' or requestStatus = 'TIMEOUT' or requestStatus = 'PENDING_MANUAL_TASK') and requestType = :requestType ORDER BY startTime DESC");
+            query.setParameter ("vnfId", vnfId);
+            query.setParameter ("action", action);
+            query.setParameter (REQUEST_TYPE, requestType);
+            @SuppressWarnings("unchecked")
+            List <InfraActiveRequests> results = query.getResultList();
+            if (!results.isEmpty ()) {
+                ar = results.get (0);
+            }
+        } finally {
+            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "checkDuplicateByVnfId", null);
+        }
+
+        return ar;
+    }
+    
+    /**
+     * update service operation status when a operation resource status updated
+     * <br>
+     * 
+     * @param operStatus the resource operation status
+     * @since ONAP Amsterdam Release
+     */
+    private void updateOperationStatusBasedOnResourceStatus(ResourceOperationStatus operStatus) {
+        long startTime = System.currentTimeMillis();
+        msoLogger.debug("Request database - query Resource Operation Status with service Id:"
+                + operStatus.getServiceId() + ", operationId:" + operStatus.getOperationId());
+        try {
+            // query all resources of the service
+            String hql = "FROM ResourceOperationStatus WHERE SERVICE_ID = :service_id and OPERATION_ID = :operation_id";
+            Query query = entityManager.createQuery(hql);
+            query.setParameter("service_id", operStatus.getServiceId());
+            query.setParameter("operation_id", operStatus.getOperationId());
+            @SuppressWarnings("unchecked")
+            List<ResourceOperationStatus> lstResourceStatus = (List<ResourceOperationStatus>)query.getResultList();
+            // count the total progress
+            int resourceCount = lstResourceStatus.size();
+            int progress = 0;
+            boolean isFinished = true;
+            for(int i = 0; i < resourceCount; i++) {
+                progress = progress + Integer.valueOf(lstResourceStatus.get(i).getProgress()) / resourceCount;
+                if(RequestsDbConstant.Status.PROCESSING.equals(lstResourceStatus.get(i).getStatus())) {
+                    isFinished = false;
+                }
+            }
+            
+            OperationStatus serviceOperStatus = new OperationStatus(operStatus.getServiceId(), operStatus.getOperationId());
+            serviceOperStatus = operationStatusRepository.findOne(Example.of(serviceOperStatus));
+            progress = progress > 100 ? 100 : progress;
+            serviceOperStatus.setProgress(String.valueOf(progress));
+            serviceOperStatus.setOperationContent(operStatus.getStatusDescription());
+            // if current resource failed. service failed.
+            if(RequestsDbConstant.Status.ERROR.equals(operStatus.getStatus())) {
+                serviceOperStatus.setResult(RequestsDbConstant.Status.ERROR);
+                serviceOperStatus.setReason(operStatus.getStatusDescription());
+            } else if(isFinished) {
+                // if finished
+                serviceOperStatus.setResult(RequestsDbConstant.Status.FINISHED);
+                serviceOperStatus.setProgress(RequestsDbConstant.Progress.ONE_HUNDRED);
+            }
+            operationStatusRepository.save(serviceOperStatus);
+        } finally {
+            msoLogger.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
+                    "Successfully", "RequestDB", "updateResOperStatus", null);
+        }
+    }
+
+	/* (non-Javadoc)
+	 * @see org.onap.so.requestsdb.InfraActiveRequestsRepositoryCustom#checkVnfIdStatus(java.lang.String)
+	 */
+	@Override
+	public InfraActiveRequests checkVnfIdStatus(String operationalEnvironmentId) {
+		long startTime = System.currentTimeMillis ();
+		msoLogger.debug ("Get Infra request from DB for OperationalEnvironmentId " + operationalEnvironmentId);
+
+		InfraActiveRequests ar = null;
+		try {
+			CriteriaBuilder cb = entityManager.getCriteriaBuilder();
+			CriteriaQuery<InfraActiveRequests> crit = cb.createQuery(InfraActiveRequests.class);
+			Root<InfraActiveRequests> candidateRoot = crit.from(InfraActiveRequests.class);
+			Predicate operationalEnvEq = cb.equal(candidateRoot.get("operationalEnvId"), operationalEnvironmentId);
+			Predicate requestStatusNotEq = cb.notEqual(candidateRoot.get("requestStatus"), "COMPLETE");
+			Predicate actionEq = cb.equal(candidateRoot.get("action"), "create");
+			Order startTimeOrder = cb.desc(candidateRoot.get("startTime"));
+			crit.select(candidateRoot);
+			crit.where(cb.and(operationalEnvEq, requestStatusNotEq, actionEq));
+			crit.orderBy(startTimeOrder);
+			TypedQuery<InfraActiveRequests> query = entityManager.createQuery(crit);
+			@SuppressWarnings("unchecked")
+			List <InfraActiveRequests> results = query.getResultList();
+			if (!results.isEmpty ()) {
+				ar = results.get (0);
+			}
+		} finally {
+			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "checkDuplicateByVnfName", null);
+		}
+
+		return ar;
+	}
+	
+	protected <T> T getSingleResult(Query query) {
+	    query.setMaxResults(1);
+	    List<T> list = query.getResultList();
+	    if (list == null || list.isEmpty()) {
+	        return null;
+	    } else if (list.size() == 1) {
+		    return list.get(0);
+	    } else {
+	    	throw new NonUniqueResultException();
+	    }
+
+	}
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/OperationStatusRepository.java
similarity index 61%
copy from mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java
copy to mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/OperationStatusRepository.java
index 37ea292..c51e4ed 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/OperationStatusRepository.java
@@ -18,25 +18,17 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.requestsdb.adapter;
+package org.onap.so.db.request.data.repository;
 
+import org.onap.so.db.request.beans.OperationStatus;
+import org.onap.so.db.request.beans.OperationStatusId;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
 
-import java.sql.Timestamp;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
-public class TimestampXMLAdapter extends XmlAdapter <Long, Timestamp> {
-
-    @Override
-    public Long marshal (Timestamp v) throws Exception {
-        return v.getTime ();
-    }
-
-    @Override
-    public Timestamp unmarshal (Long v) throws Exception {
-        if (v == null) {
-            return new Timestamp(0);
-        }
-        return new Timestamp (v);
-    }
+@Repository
+public interface OperationStatusRepository extends JpaRepository<OperationStatus, OperationStatusId> {
+	
+	OperationStatus findOneByServiceIdAndOperationId(String serviceId, String operationId);
+	public OperationStatus findOneByServiceName(String serviceName);
+	public OperationStatus findOneByServiceId(String serviceId);
 }
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvDistributionStatusRepository.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvDistributionStatusRepository.java
new file mode 100644
index 0000000..799e5ad
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvDistributionStatusRepository.java
@@ -0,0 +1,42 @@
+/*-
+ * ============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.onap.so.db.request.data.repository;
+
+import org.onap.so.db.request.beans.OperationalEnvDistributionStatus;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+@Repository
+public interface OperationalEnvDistributionStatusRepository extends JpaRepository<OperationalEnvDistributionStatus, String> {
+
+	@Modifying
+	@Transactional
+	@Query("update OperationalEnvDistributionStatus set distributionIdStatus = :distributionIdStatus where "
+					+ "distributionId = :distributionId and operationalEnvId = :operationalEnvId and serviceModelVersionId = :serviceModelVersionId")
+	public int setDistributionIdStatus(@Param("distributionIdStatus") String distributionIdStatus,
+										@Param("distributionId") String distributionId,
+										@Param("operationalEnvId") String operationalEnvId,
+										@Param("serviceModelVersionId") String serviceModelVersionId);
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvServiceModelStatusRepository.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvServiceModelStatusRepository.java
new file mode 100644
index 0000000..ee2baed
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/OperationalEnvServiceModelStatusRepository.java
@@ -0,0 +1,59 @@
+/*-
+ * ============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.onap.so.db.request.data.repository;
+
+import java.util.List;
+
+import org.onap.so.db.request.beans.OperationalEnvServiceModelStatus;
+import org.onap.so.db.request.beans.OperationalEnvServiceModelStatusId;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+import org.springframework.stereotype.Repository;
+import org.springframework.transaction.annotation.Transactional;
+
+@Repository
+public interface OperationalEnvServiceModelStatusRepository extends JpaRepository<OperationalEnvServiceModelStatus, OperationalEnvServiceModelStatusId>{
+
+	public OperationalEnvServiceModelStatus findOneByOperationalEnvIdAndRequestId(String operationalEnvId, String requestId);
+	public List<OperationalEnvServiceModelStatus> findAllByOperationalEnvIdAndRequestId(String operationalEnvId, String requestId);
+	public OperationalEnvServiceModelStatus findOneByOperationalEnvIdAndServiceModelVersionId(String operationalEnvId, String serviceModelVersionId);
+	
+	@Modifying
+	@Transactional
+	@Query("update OperationalEnvServiceModelStatus set serviceModelVersionDistrStatus = :asdcStatus, retryCount = :retryCount where "
+					+ "operationalEnvId = :operationalEnvId and serviceModelVersionId = :serviceModelVersionId")
+	public int setServiceModelVersionDistrStatusAndRetryCountFor(@Param("asdcStatus") String serviceModelVersionDistrStatus,
+																 @Param("retryCount") int retryCount,
+																 @Param("operationalEnvId") String operationalEnvId,
+																 @Param("serviceModelVersionId") String serviceModelVersionId);
+	
+	@Modifying
+	@Transactional
+	@Query("update OperationalEnvServiceModelStatus set serviceModelVersionDistrStatus = :asdcStatus, retryCount = :retryCount where "
+					+ "operationalEnvId = :operationalEnvId and serviceModelVersionId = :serviceModelVersionId and requestId = :requestId")
+	public int setServiceModelVersionDistrStatusAndRetryCountFor(@Param("asdcStatus") String serviceModelVersionDistrStatus,
+																 @Param("retryCount") int retryCount,
+																 @Param("operationalEnvId") String operationalEnvId,
+																 @Param("serviceModelVersionId") String serviceModelVersionId,
+																 @Param("requestId") String requestId);
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/ResourceOperationStatusRepository.java
similarity index 64%
copy from mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java
copy to mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/ResourceOperationStatusRepository.java
index 37ea292..2d77f75 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/ResourceOperationStatusRepository.java
@@ -18,25 +18,17 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.requestsdb.adapter;
+package org.onap.so.db.request.data.repository;
 
+import java.util.List;
 
-import java.sql.Timestamp;
+import org.onap.so.db.request.beans.ResourceOperationStatus;
+import org.onap.so.db.request.beans.ResourceOperationStatusId;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
 
-import javax.xml.bind.annotation.adapters.XmlAdapter;
+@Repository
+public interface ResourceOperationStatusRepository extends JpaRepository<ResourceOperationStatus, ResourceOperationStatusId> {
 
-public class TimestampXMLAdapter extends XmlAdapter <Long, Timestamp> {
-
-    @Override
-    public Long marshal (Timestamp v) throws Exception {
-        return v.getTime ();
-    }
-
-    @Override
-    public Timestamp unmarshal (Long v) throws Exception {
-        if (v == null) {
-            return new Timestamp(0);
-        }
-        return new Timestamp (v);
-    }
+	List<ResourceOperationStatus> findByServiceIdAndOperationId(String serviceId, String operationId);
 }
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/SiteStatusRepository.java
similarity index 71%
rename from mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java
rename to mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/SiteStatusRepository.java
index 1d62efb..1192351 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/SiteStatusRepository.java
@@ -18,24 +18,14 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.requestsdb;
+package org.onap.so.db.request.data.repository;
 
+import org.onap.so.db.request.beans.SiteStatus;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
 
-/**
- * InfraActiveRequests
- */
-public class InfraActiveRequests extends InfraRequests {
+@Repository
+public interface SiteStatusRepository extends JpaRepository<SiteStatus, String> {	
+	SiteStatus findOneBySiteName(String siteName);
 
-	/**
-     * Serialization id.
-     */
-    private static final long serialVersionUID = 5003555140088137254L;
-
-	public InfraActiveRequests() {
-	    super ();
-	}
-
-	public InfraActiveRequests(String requestId, String action) {
-	    super (requestId, action);
-	}
 }
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/WatchdogComponentDistributionStatusRepository.java
similarity index 61%
copy from mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java
copy to mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/WatchdogComponentDistributionStatusRepository.java
index 37ea292..8310d79 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/WatchdogComponentDistributionStatusRepository.java
@@ -18,25 +18,17 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.requestsdb.adapter;
+package org.onap.so.db.request.data.repository;
 
+import java.util.List;
 
-import java.sql.Timestamp;
+import org.onap.so.db.request.beans.WatchdogComponentDistributionStatus;
+import org.onap.so.db.request.beans.WatchdogComponentDistributionStatusId;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
 
-import javax.xml.bind.annotation.adapters.XmlAdapter;
+@Repository
+public interface WatchdogComponentDistributionStatusRepository extends JpaRepository<WatchdogComponentDistributionStatus, WatchdogComponentDistributionStatusId> {
 
-public class TimestampXMLAdapter extends XmlAdapter <Long, Timestamp> {
-
-    @Override
-    public Long marshal (Timestamp v) throws Exception {
-        return v.getTime ();
-    }
-
-    @Override
-    public Timestamp unmarshal (Long v) throws Exception {
-        if (v == null) {
-            return new Timestamp(0);
-        }
-        return new Timestamp (v);
-    }
+	public List<WatchdogComponentDistributionStatus> findByDistributionId(String distributionId);
 }
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/WatchdogDistributionStatusRepository.java
similarity index 71%
copy from mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java
copy to mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/WatchdogDistributionStatusRepository.java
index 1d62efb..6e37181 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/WatchdogDistributionStatusRepository.java
@@ -18,24 +18,13 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.requestsdb;
+package org.onap.so.db.request.data.repository;
 
+import org.onap.so.db.request.beans.WatchdogDistributionStatus;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
 
-/**
- * InfraActiveRequests
- */
-public class InfraActiveRequests extends InfraRequests {
+@Repository
+public interface WatchdogDistributionStatusRepository extends JpaRepository<WatchdogDistributionStatus, String> {
 
-	/**
-     * Serialization id.
-     */
-    private static final long serialVersionUID = 5003555140088137254L;
-
-	public InfraActiveRequests() {
-	    super ();
-	}
-
-	public InfraActiveRequests(String requestId, String action) {
-	    super (requestId, action);
-	}
 }
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/WatchdogServiceModVerIdLookupRepository.java
similarity index 64%
copy from mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java
copy to mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/WatchdogServiceModVerIdLookupRepository.java
index 37ea292..b83481b 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/data/repository/WatchdogServiceModVerIdLookupRepository.java
@@ -18,25 +18,16 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.requestsdb.adapter;
+package org.onap.so.db.request.data.repository;
 
+import org.onap.so.db.request.beans.WatchdogServiceModVerIdLookup;
+import org.onap.so.db.request.beans.WatchdogServiceModVerIdLookupId;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
 
-import java.sql.Timestamp;
+@Repository
+public interface WatchdogServiceModVerIdLookupRepository extends JpaRepository<WatchdogServiceModVerIdLookup, WatchdogServiceModVerIdLookupId> {
 
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
-public class TimestampXMLAdapter extends XmlAdapter <Long, Timestamp> {
-
-    @Override
-    public Long marshal (Timestamp v) throws Exception {
-        return v.getTime ();
-    }
-
-    @Override
-    public Timestamp unmarshal (Long v) throws Exception {
-        if (v == null) {
-            return new Timestamp(0);
-        }
-        return new Timestamp (v);
-    }
+	public WatchdogServiceModVerIdLookup findOneByDistributionId(String distributionId);
+	
 }
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDBHelper.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDBHelper.java
new file mode 100644
index 0000000..6eb00ea
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDBHelper.java
@@ -0,0 +1,107 @@
+/*-
+ * ============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.onap.so.requestsdb;
+
+import java.sql.Timestamp;
+
+import org.onap.so.db.request.beans.InfraActiveRequests;
+import org.onap.so.db.request.data.repository.InfraActiveRequestsRepository;
+import org.onap.so.logger.MsoLogger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class RequestsDBHelper {
+		
+	private static final String UNKNOWN = "UNKNOWN";
+	private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.APIH, RequestsDBHelper.class);
+	private String className = this.getClass().getSimpleName() +" class\'s ";
+	private String methodName = "";
+	private String classMethodMessage = "";
+	@Autowired
+	private InfraActiveRequestsRepository infraActiveRequestsRepository;
+	/**
+	 * This util method is to update the InfraRequest table to Complete
+	 * @param msg - string, unique message for each caller
+	 * @param requestId - string
+	 * @param operationalEnvironmentId - string   
+	 * @return void - nothing 
+	 * @throws Exception 
+	 */	
+	public void updateInfraSuccessCompletion(String msg, String requestId, String operationalEnvironmentId) {
+		methodName = "updateInfraSuccessCompletion() method.";
+		classMethodMessage = className + " " + methodName;
+		msoLogger.debug("Begin of " + classMethodMessage);
+			
+		InfraActiveRequests request = infraActiveRequestsRepository.findOneByRequestId(requestId);
+	
+		request.setRequestStatus("COMPLETE");
+		request.setStatusMessage("SUCCESSFUL, operationalEnvironmentId - " + operationalEnvironmentId + "; Success Message: " + msg);
+		request.setProgress(100L);
+		request.setLastModifiedBy("APIH");
+		request.setOperationalEnvId(operationalEnvironmentId);
+		if(request.getAction() == null){
+			request.setRequestAction(UNKNOWN);
+		}
+		if(request.getRequestScope() == null){
+			request.setRequestScope(UNKNOWN);
+		}
+		Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());
+        request.setEndTime(endTimeStamp);
+		infraActiveRequestsRepository.save(request);
+		
+		msoLogger.debug("End of " + classMethodMessage);
+		
+	}
+	
+	/**
+	 * This util method is to update the InfraRequest table to Failure
+	 * @param msg - string, unique message for each caller
+	 * @param requestId - string
+	 * @param operationalEnvironmentId - string   
+	 * @return void - nothing 
+	 * @throws Exception 
+	 */	
+	public void updateInfraFailureCompletion(String msg, String requestId, String operationalEnvironmentId) {
+		methodName = "updateInfraFailureCompletion() method.";
+		classMethodMessage = className + " " + methodName;
+		msoLogger.debug("Begin of " + classMethodMessage);
+		
+		InfraActiveRequests request = infraActiveRequestsRepository.findOneByRequestId(requestId);
+		request.setRequestStatus("FAILED");
+		request.setStatusMessage("FAILURE, operationalEnvironmentId - " + operationalEnvironmentId + "; Error message: " + msg);
+		request.setProgress(100L);
+		request.setLastModifiedBy("APIH");
+		request.setOperationalEnvId(operationalEnvironmentId);
+		if(request.getAction() == null){
+			request.setRequestAction(UNKNOWN);
+		}
+		if(request.getRequestScope() == null){
+			request.setRequestScope(UNKNOWN);
+		}
+		Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());
+        request.setEndTime(endTimeStamp);
+		infraActiveRequestsRepository.save(request);
+		
+		msoLogger.debug("End of " + classMethodMessage);
+		
+	}	
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDbConstant.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDbConstant.java
similarity index 97%
rename from mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDbConstant.java
rename to mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDbConstant.java
index 18e51ce..60bad37 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDbConstant.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/RequestsDbConstant.java
@@ -1,65 +1,66 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.requestsdb;
-
-/**
- * The constants of the request db
- * <br>
- * <p>
- * </p>
- * 
- * @author
- * @version     ONAP Amsterdam Release  2017-08-28
- */
-public class RequestsDbConstant {
-
-    public static class Progress {
-
-        public static final String ONE_HUNDRED = "100";
-
-        private Progress() {
-
-        }
-    }
-
-    public static class Status {
-
-        public static final String FINISHED = "finished";
-
-        public static final String PROCESSING = "processing";
-
-        public static final String ERROR = "error";
-
-        private Status() {
-
-        }
-    }
-
-    public static class OperationType {
-
-        public static final String CREATE = "create";
-
-        public static final String DELETE = "delete";
-
-        private OperationType() {
-
-        }
-    }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.onap.so.requestsdb;
+
+/**
+ * The constants of the request db
+ * <br>
+ * <p>
+ * </p>
+ * 
+ * @author
+ * @version     ONAP Amsterdam Release  2017-08-28
+ */
+public class RequestsDbConstant {
+
+    public static class Progress {
+
+        public static final String ONE_HUNDRED = "100";
+
+        private Progress() {
+
+        }
+    }
+
+    public static class Status {
+
+        public static final String FINISHED = "finished";
+
+        public static final String PROCESSING = "processing";
+
+        public static final String ERROR = "error";
+
+        private Status() {
+
+        }
+    }
+
+    public static class OperationType {
+
+        public static final String CREATE = "create";
+
+        public static final String DELETE = "delete";
+
+        private OperationType() {
+
+        }
+    }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/adapter/TimestampXMLAdapter.java
similarity index 96%
rename from mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java
rename to mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/adapter/TimestampXMLAdapter.java
index 37ea292..1cde1aa 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/requestsdb/adapter/TimestampXMLAdapter.java
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.requestsdb.adapter;
+package org.onap.so.requestsdb.adapter;
 
 
 import java.sql.Timestamp;
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraRequests.java
deleted file mode 100644
index d2db8fb..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraRequests.java
+++ /dev/null
@@ -1,448 +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.requestsdb;
-
-// Generated Jul 27, 2015 3:05:00 PM by Hibernate Tools 3.4.0.CR1
-
-import java.sql.Timestamp;
-
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.openecomp.mso.requestsdb.adapter.TimestampXMLAdapter;
-
-/**
- * InfraActiveRequests generated by hbm2java
- */
-public class InfraRequests implements java.io.Serializable {
-
-    /**
-     * Serialization id.
-     */
-    private static final long serialVersionUID = -661307666798018192L;
-
-    private String requestId = null;
-	private String clientRequestId = null;
-	private String action = null;
-	private String requestStatus = null;
-	private String statusMessage = null;
-	private Long progress;
-	private Timestamp startTime = null;
-	private Timestamp endTime = null;
-	private String source = null;
-	private String vnfId = null;
-	private String vnfName = null;
-	private String vnfType = null;
-	private String serviceType = null;
-	private String aicNodeClli = null;
-	private String tenantId = null;
-	private String provStatus = null;
-	private String vnfParams = null;
-	private String vnfOutputs = null;
-	private String requestBody = null;
-	private String responseBody = null;
-	private String lastModifiedBy = null;
-	private Timestamp modifyTime = null;
-	private String requestType = null;
-	private String volumeGroupId = null;
-	private String volumeGroupName = null;
-	private String vfModuleId = null;
-	private String vfModuleName = null;
-	private String vfModuleModelName = null;
-	private String aaiServiceId = null;
-	private String aicCloudRegion = null;
-	private String callBackUrl = null;
-	private String correlator = null;
-	private String serviceInstanceId = null;
-	private String serviceInstanceName = null;
-	private String requestScope = null;
-	private String requestAction = null;
-	private String networkId = null;
-	private String networkName = null;
-	private String networkType = null;
-	private String requestorId = null;
-	private String configurationId = null;
-	private String configurationName = null;
-	private String operationalEnvId = null;
-	private String operationalEnvName = null;
-
-	public InfraRequests() {
-	}
-
-	public InfraRequests(String requestId, String action) {
-		this.requestId = requestId;
-		this.action = action;
-	}
-
-	public String getRequestId() {
-		return this.requestId;
-	}
-
-	public void setRequestId(String requestId) {
-		this.requestId = requestId;
-	}
-
-	public String getClientRequestId() {
-		return clientRequestId;
-	}
-
-	public void setClientRequestId(String clientRequestId) {
-		this.clientRequestId = clientRequestId;
-	}
-
-	public String getAction() {
-		return this.action;
-	}
-
-	public void setAction(String action) {
-		this.action = action;
-	}
-
-	public String getRequestStatus() {
-		return this.requestStatus;
-	}
-
-	public void setRequestStatus(String requestStatus) {
-		this.requestStatus = requestStatus;
-	}
-
-	public String getStatusMessage() {
-		return this.statusMessage;
-	}
-
-	public void setStatusMessage(String statusMessage) {
-		this.statusMessage = statusMessage;
-	}
-
-	public Long getProgress() {
-		return this.progress;
-	}
-
-	public void setProgress(Long progress) {
-		this.progress = progress;
-	}
-
-    @XmlJavaTypeAdapter(TimestampXMLAdapter.class)
-	public Timestamp getStartTime() {
-		return this.startTime;
-	}
-
-	public void setStartTime(Timestamp startTime) {
-		this.startTime = startTime;
-	}
-
-    @XmlJavaTypeAdapter(TimestampXMLAdapter.class)
-	public Timestamp getEndTime() {
-		return this.endTime;
-	}
-
-	public void setEndTime(Timestamp endTime) {
-		this.endTime = endTime;
-	}
-
-	public String getSource() {
-		return this.source;
-	}
-
-	public void setSource(String source) {
-		this.source = source;
-	}
-
-	public String getVnfId() {
-		return this.vnfId;
-	}
-
-	public void setVnfId(String vnfId) {
-		this.vnfId = vnfId;
-	}
-
-	public String getVnfName() {
-		return this.vnfName;
-	}
-
-	public void setVnfName(String vnfName) {
-		this.vnfName = vnfName;
-	}
-
-	public String getVnfType() {
-		return this.vnfType;
-	}
-
-	public void setVnfType(String vnfType) {
-		this.vnfType = vnfType;
-	}
-
-	public String getServiceType() {
-		return this.serviceType;
-	}
-
-	public void setServiceType(String serviceType) {
-		this.serviceType = serviceType;
-	}
-
-	public String getAicNodeClli() {
-		return this.aicNodeClli;
-	}
-
-	public void setAicNodeClli(String aicNodeClli) {
-		this.aicNodeClli = aicNodeClli;
-	}
-
-	public String getTenantId() {
-		return this.tenantId;
-	}
-
-	public void setTenantId(String tenantId) {
-		this.tenantId = tenantId;
-	}
-
-	public String getProvStatus() {
-		return this.provStatus;
-	}
-
-	public void setProvStatus(String provStatus) {
-		this.provStatus = provStatus;
-	}
-
-	public String getVnfParams() {
-		return this.vnfParams;
-	}
-
-	public void setVnfParams(String vnfParams) {
-		this.vnfParams = vnfParams;
-	}
-
-	public String getVnfOutputs() {
-		return this.vnfOutputs;
-	}
-
-	public void setVnfOutputs(String vnfOutputs) {
-		this.vnfOutputs = vnfOutputs;
-	}
-
-	public String getRequestBody() {
-		return this.requestBody;
-	}
-
-	public void setRequestBody(String requestBody) {
-		this.requestBody = requestBody;
-	}
-
-	public String getResponseBody() {
-		return this.responseBody;
-	}
-
-	public void setResponseBody(String responseBody) {
-		this.responseBody = responseBody;
-	}
-
-	public String getLastModifiedBy() {
-		return this.lastModifiedBy;
-	}
-
-	public void setLastModifiedBy(String lastModifiedBy) {
-		this.lastModifiedBy = lastModifiedBy;
-	}
-
-    @XmlJavaTypeAdapter(TimestampXMLAdapter.class)
-	public Timestamp getModifyTime() {
-		return this.modifyTime;
-	}
-
-	public void setModifyTime(Timestamp modifyTime) {
-		this.modifyTime = modifyTime;
-	}
-
-	public String getRequestType() {
-		return this.requestType;
-	}
-
-	public void setRequestType(String requestType) {
-		this.requestType = requestType;
-	}
-
-	public String getVolumeGroupId() {
-		return this.volumeGroupId;
-	}
-
-	public void setVolumeGroupId(String volumeGroupId) {
-		this.volumeGroupId = volumeGroupId;
-	}
-
-	public String getVolumeGroupName() {
-		return this.volumeGroupName;
-	}
-
-	public void setVolumeGroupName(String volumeGroupName) {
-		this.volumeGroupName = volumeGroupName;
-	}
-
-	public String getVfModuleId() {
-		return this.vfModuleId;
-	}
-
-	public void setVfModuleId(String vfModuleId) {
-		this.vfModuleId = vfModuleId;
-	}
-
-	public String getVfModuleName() {
-		return this.vfModuleName;
-	}
-
-	public void setVfModuleName(String vfModuleName) {
-		this.vfModuleName = vfModuleName;
-	}
-
-	public String getVfModuleModelName() {
-		return this.vfModuleModelName;
-	}
-
-	public void setVfModuleModelName(String vfModuleModelName) {
-		this.vfModuleModelName = vfModuleModelName;
-	}
-
-	public String getAaiServiceId() {
-		return this.aaiServiceId;
-	}
-
-	public void setAaiServiceId(String aaiServiceId) {
-		this.aaiServiceId = aaiServiceId;
-	}
-
-	public String getAicCloudRegion() {
-		return this.aicCloudRegion;
-	}
-
-	public void setAicCloudRegion(String aicCloudRegion) {
-		this.aicCloudRegion = aicCloudRegion;
-	}
-
-	public String getCallBackUrl() {
-		return callBackUrl;
-	}
-
-	public void setCallBackUrl(String callBackUrl) {
-		this.callBackUrl = callBackUrl;
-	}
-
-	public String getCorrelator() {
-		return correlator;
-	}
-
-	public void setCorrelator(String correlator) {
-		this.correlator = correlator;
-	}
-
-	public String getServiceInstanceId() {
-		return serviceInstanceId;
-	}
-
-	public void setServiceInstanceId(String serviceInstanceId) {
-		this.serviceInstanceId = serviceInstanceId;
-	}
-
-	public String getServiceInstanceName() {
-		return serviceInstanceName;
-	}
-
-	public void setServiceInstanceName(String serviceInstanceName) {
-		this.serviceInstanceName = serviceInstanceName;
-	}
-
-	public String getRequestScope() {
-		return requestScope;
-	}
-
-	public void setRequestScope(String requestScope) {
-		this.requestScope = requestScope;
-	}
-
-	public String getRequestAction() {
-		return requestAction;
-	}
-
-	public void setRequestAction(String requestAction) {
-		this.requestAction = requestAction;
-	}
-
-	public String getNetworkId() {
-		return networkId;
-	}
-
-	public void setNetworkId(String networkId) {
-		this.networkId = networkId;
-	}
-
-	public String getNetworkName() {
-		return networkName;
-	}
-
-	public void setNetworkName(String networkName) {
-		this.networkName = networkName;
-	}
-
-	public String getNetworkType() {
-		return networkType;
-	}
-
-	public void setNetworkType(String networkType) {
-		this.networkType = networkType;
-	}
-
-	public String getRequestorId() {
-		return requestorId;
-	}
-
-	public void setRequestorId(String requestorId) {
-		this.requestorId = requestorId;
-	}
-
-	public String getConfigurationId() {
-		return configurationId;
-	}
-
-	public void setConfigurationId(String configurationId) {
-		this.configurationId = configurationId;
-	}
-
-	public String getConfigurationName() {
-		return configurationName;
-	}
-
-	public void setConfigurationName(String configurationName) {
-		this.configurationName = configurationName;
-	}
-
-	public String getOperationalEnvId() {
-		return operationalEnvId;
-	}
-
-	public void setOperationalEnvId(String operationalEnvId) {
-		this.operationalEnvId = operationalEnvId;
-	}
-
-	public String getOperationalEnvName() {
-		return operationalEnvName;
-	}
-
-	public void setOperationalEnvName(String operationalEnvName) {
-		this.operationalEnvName = operationalEnvName;
-	}
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java
deleted file mode 100644
index c88f31c..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java
+++ /dev/null
@@ -1,72 +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.requestsdb;
-
-
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class MockRequestsDatabase {
-	
-	private Map<String, InfraActiveRequests> activeRequests;
-	
-	public MockRequestsDatabase() {
-		activeRequests = new HashMap<>();
-	}
-	
-	public void addRecord(InfraActiveRequests record) {
-		String serviceType = record.getServiceType();
-		String serviceInstanceId = record.getServiceInstanceId();
-		String key = serviceType + "::" + serviceInstanceId;
-		activeRequests.put(key, record);
-	}
-	
-	public void deleteRecord(String serviceType, String serviceInstanceId) {
-		String key = serviceType + "::" + serviceInstanceId;
-		activeRequests.remove(key);
-	}
-	
-	public InfraActiveRequests getRecord(String serviceType, String serviceInstanceId) {
-		String key = serviceType + "::" + serviceInstanceId;
-		InfraActiveRequests record = activeRequests.get(key);
-		return record;
-	}
-	
-	public InfraActiveRequests checkDuplicate(String serviceType, String serviceInstanceId) {
-		return getRecord(serviceType, serviceInstanceId);
-	}
-	
-	public InfraActiveRequests checkRetry(String serviceType, String serviceInstanceId) {
-		InfraActiveRequests record = getRecord(serviceType, serviceInstanceId);
-		InfraActiveRequests returnRecord = null;
-		if (record != null) {
-			String requestAction = record.getRequestAction();
-			if (!"GetLayer3ServiceDetailsRequest".equals(requestAction)) {
-				String status = record.getRequestStatus();
-				if ("COMPLETED".equals(status)) {
-					returnRecord = record;
-				}
-			}
-		}
-		return returnRecord;
-	}
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationStatus.java
deleted file mode 100644
index f61b272..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationStatus.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.requestsdb;
-
-import java.io.Serializable;
-import java.sql.Timestamp;
-
-/**
- * The service operation status 
- * <br>
- * <p>
- * </p>
- * 
- * @author
- * @version     ONAP Amsterdam Release  2017-08-28
- */
-public class OperationStatus implements Serializable{
-    
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-
-    private String serviceId = null;
-    
-    private String operationId = null;
-    
-    private String serviceName = null;
-    
-    private String operation = null;
-    
-    private String userId = null;
-    
-    private String result = null;
-    
-    private String operationContent = null;
-    
-    private String progress = "0";
-    
-    private String reason = null;
-
-    private Timestamp operateAt = null;
-    
-    private Timestamp finishedAt = null;
-
-    
-    public String getServiceId() {
-        return serviceId;
-    }
-
-    
-    public void setServiceId(String serviceId) {
-        this.serviceId = serviceId;
-    }
-
-    
-    public String getOperationId() {
-        return operationId;
-    }
-
-    
-    public void setOperationId(String operationId) {
-        this.operationId = operationId;
-    }
-
-    
-    public String getOperation() {
-        return operation;
-    }
-
-    
-    public void setOperation(String operation) {
-        this.operation = operation;
-    }
-
-    
-    public String getUserId() {
-        return userId;
-    }
-
-    
-    public void setUserId(String userId) {
-        this.userId = userId;
-    }
-
-    
-    public String getResult() {
-        return result;
-    }
-
-    
-    public void setResult(String result) {
-        this.result = result;
-    }
-
-    
-    public String getOperationContent() {
-        return operationContent;
-    }
-
-    
-    public void setOperationContent(String operationContent) {
-        this.operationContent = operationContent;
-    }
-
-    
-    public String getProgress() {
-        return progress;
-    }
-
-    
-    public void setProgress(String progress) {
-        this.progress = progress;
-    }
-
-    
-    public String getReason() {
-        return reason;
-    }
-
-    
-    public void setReason(String reason) {
-        this.reason = reason;
-    }
-
-    
-    public Timestamp getOperateAt() {
-        return operateAt;
-    }
-
-    
-    public void setOperateAt(Timestamp operateAt) {
-        this.operateAt = operateAt;
-    }
-
-    
-    public Timestamp getFinishedAt() {
-        return finishedAt;
-    }
-
-    
-    public void setFinishedAt(Timestamp finishedAt) {
-        this.finishedAt = finishedAt;
-    }
-
-
-    
-    /**
-     * @return Returns the serviceName.
-     */
-    public String getServiceName() {
-        return serviceName;
-    }
-
-
-    
-    /**
-     * @param serviceName The serviceName to set.
-     */
-    public void setServiceName(String serviceName) {
-        this.serviceName = serviceName;
-    }
-
-
-    /**
-     * <br>
-     * 
-     * @return
-     * @since   ONAP Amsterdam Release 
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((operationId == null) ? 0 : operationId.hashCode());
-        result = prime * result + ((serviceId == null) ? 0 : serviceId.hashCode());
-        return result;
-    }
-
-
-    /**
-     * <br>
-     * 
-     * @param obj
-     * @return
-     * @since   ONAP Amsterdam Release 
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if(this == obj)
-            return true;
-        if(obj == null)
-            return false;
-        if(getClass() != obj.getClass())
-            return false;
-        OperationStatus other = (OperationStatus)obj;
-        if(operationId == null) {
-            if(other.operationId != null)
-                return false;
-        } else if(!operationId.equals(other.operationId))
-            return false;
-        if(serviceId == null) {
-            if(other.serviceId != null)
-                return false;
-        } else if(!serviceId.equals(other.serviceId))
-            return false;
-        return true;
-    }
-
-
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationalEnvDistributionStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationalEnvDistributionStatus.java
deleted file mode 100644
index c5df122..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationalEnvDistributionStatus.java
+++ /dev/null
@@ -1,106 +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.requestsdb;
-
-import java.io.Serializable;
-import java.sql.Timestamp;
-
-public class OperationalEnvDistributionStatus implements Serializable {
-
-	/**
-	 * Serialization id.
-	 */
-	private static final long serialVersionUID = 7398393659281364650L;
-
-	private String distributionId = null;
-	private String operationalEnvId = null;
-	private String serviceModelVersionId = null;
-	private String requestId = null;
-	private String distributionIdStatus = null;
-	private String distributionIdErrorReason = null;
-	private Timestamp createTime = null;
-	private Timestamp modifyTime = null;
-	
-	public String getDistributionId() {
-		return distributionId;
-	}
-	
-	public void setDistributionId(String distributionId) {
-		this.distributionId = distributionId;
-	}
-	
-	public String getOperationalEnvId() {
-		return operationalEnvId;
-	}
-	
-	public void setOperationalEnvId(String operationalEnvId) {
-		this.operationalEnvId = operationalEnvId;
-	}
-	
-	public String getServiceModelVersionId() {
-		return serviceModelVersionId;
-	}
-	
-	public void setServiceModelVersionId(String serviceModelVersionId) {
-		this.serviceModelVersionId = serviceModelVersionId;
-	}
-
-	public String getRequestId() {
-		return requestId;
-	}
-
-	public void setRequestId(String requestId) {
-		this.requestId = requestId;
-	}
-	
-	public String getDistributionIdStatus() {
-		return distributionIdStatus;
-	}
-	
-	public void setDistributionIdStatus(String distributionIdStatus) {
-		this.distributionIdStatus = distributionIdStatus;
-	}
-	
-	public String getDistributionIdErrorReason() {
-		return distributionIdErrorReason;
-	}
-
-	public void setDistributionIdErrorReason(String distributionIdErrorReason) {
-		this.distributionIdErrorReason = distributionIdErrorReason;
-	}
-
-	public Timestamp getCreateTime() {
-		return createTime;
-	}
-	
-	public void setCreateTime(Timestamp createTime) {
-		this.createTime = createTime;
-	}
-	
-	public Timestamp getModifyTime() {
-		return modifyTime;
-	}
-	
-	public void setModifyTime(Timestamp modifyTime) {
-		this.modifyTime = modifyTime;
-	}
-	
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationalEnvDistributionStatusDb.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationalEnvDistributionStatusDb.java
deleted file mode 100644
index ce2e1f6..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationalEnvDistributionStatusDb.java
+++ /dev/null
@@ -1,196 +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.requestsdb;
-
-
-import java.sql.Timestamp;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-import org.openecomp.mso.logger.MessageEnum;
-import org.openecomp.mso.logger.MsoLogger;
-
-public class OperationalEnvDistributionStatusDb {
-
-    protected final AbstractSessionFactoryManager sessionFactoryRequestDB;
-    
-    protected static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
-
-    
-    protected static final String         DISTRIBUTION_ID               = "distributionId";
-    protected static final String		  OPERATIONAL_ENV_ID  		 	= "operationalEnvId";
-    protected static final String         REQUEST_ID               		= "requestId";
-    protected static final String         SERVICE_MODEL_VERSION_ID      = "serviceModelVersionId";
-    protected static final String         DISTRIBUTION_ID_STATUS  		= "distributionIdStatus";
-    protected static final String         CREATE_TIME                 	= "startTime";
-    protected static final String         MODIFY_TIME                 	= "modifyTime";
-    
-
-    public static OperationalEnvDistributionStatusDb getInstance() {
-        return new OperationalEnvDistributionStatusDb(new RequestsDbSessionFactoryManager ());
-    }
-
-    protected OperationalEnvDistributionStatusDb (AbstractSessionFactoryManager sessionFactoryRequest) {
-        sessionFactoryRequestDB = sessionFactoryRequest;
-    }
-
-
-    /**
-     * Retrieve OperationalEnvDistributionStatus from getSecgiven distributionId
-     * @param distributionId
-     * @return
-     */
-	public OperationalEnvDistributionStatus getOperationalEnvDistributionStatus(String distributionId) {
-		long startTime = System.currentTimeMillis ();
-		msoLogger.debug ("Retrieve Operational Environment Distribution Status with distributionId: " + distributionId);
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		OperationalEnvDistributionStatus request = null;
-		try {
-			session.beginTransaction ();
-			Query query = session.createQuery ("from OperationalEnvDistributionStatus where distributionId = :distributionId");
-			query.setParameter (DISTRIBUTION_ID, distributionId);
-			request = (OperationalEnvDistributionStatus) query.uniqueResult ();
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-			}
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, 
-										"Successfully", "OperationalEnvDistributionStatus", "getOperationalEnvDistributionStatus", null);
-		}
-		return request;
-	}
-	
-    /**
-     * Retrieve OperationalEnvDistributionStatus from given distributionId and requestId
-     * @param distributionId
-     * @param requestId
-     * @return OperationalEnvDistributionStatus
-     */
-	public OperationalEnvDistributionStatus getOperationalEnvDistributionStatusPerReqId(String distributionId, String requestId) {
-		long startTime = System.currentTimeMillis ();
-		msoLogger.debug ("Retrieve Operational Environment Distribution Status with distributionId: " + distributionId + ", requestId: " + requestId);
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		OperationalEnvDistributionStatus request = null;
-		try {
-			session.beginTransaction ();
-			Query query = session.createQuery ("from OperationalEnvDistributionStatus where distributionId = :distributionId AND requestId = :requestId");
-			query.setParameter (DISTRIBUTION_ID, distributionId);
-			query.setParameter (REQUEST_ID, requestId);
-			request = (OperationalEnvDistributionStatus) query.uniqueResult ();
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-			}
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, 
-										"Successfully", "OperationalEnvDistributionStatus", "getOperationalEnvDistributionStatusPerReqId", null);
-		}
-		return request;
-	}
-	
-    /**
-     * Update OperationalEnvDistributionStatus with distributionIdStatus for given distributionId, serviceModelVersionId, serviceModelVersionId
-     * @param asdcStatus
-     * @param distributionId
-     * @param operationalEnvId
-     * @param serviceModelVersionId
-     */
-	public int updateOperationalEnvDistributionStatus(String asdcStatus, String distributionId, 
-											String operationalEnvId, String serviceModelVersionId) {
-		long startTime = System.currentTimeMillis ();
-		msoLogger.debug ("Update OperationalEnvDistributionStatus DISTRIBUTION_ID_STATUS with asdcStatus: " + asdcStatus);
-		 
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		int result = 0;
-        try {
-            session.beginTransaction ();
-            Query query = session.createQuery ("update OperationalEnvDistributionStatus set distributionIdStatus = :distributionIdStatus, modifyTime = :modifyTime where distributionId = :distributionId and "
-            		+ "operationalEnvId = :operationalEnvId and serviceModelVersionId = :serviceModelVersionId ");
-            query.setParameter (DISTRIBUTION_ID_STATUS, asdcStatus);
-            query.setParameter ("distributionId", distributionId);
-            query.setParameter ("operationalEnvId", operationalEnvId);
-            query.setParameter ("serviceModelVersionId", serviceModelVersionId);
-            Timestamp modifyTimeStamp = new Timestamp (System.currentTimeMillis());
-            query.setParameter ("modifyTime", modifyTimeStamp);
-            result = query.executeUpdate ();
-            session.getTransaction ().commit ();
-        } finally {
-            if (session != null && session.isOpen ()) {
-                session.close ();
-            }
-            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "updateOperationalEnvDistributionStatus", null);
-        }
-		return result;
-	}
-	
-    /**
-     * Insert into OperationalEnvDistributionStatus with distributionId, operationalEnvId, serviceModelVersionId, distributionIdStatus
-     * @param distributionId
-     * @param operationalEnvId
-     * @param serviceModelVersionId
-     * @param distributionIdStatus
-     */
-	public void insertOperationalEnvDistributionStatus(String distributionId, String operationalEnvId, String serviceModelVersionId, 
-				String distributionIdStatus, String requestId) {
-		long startTime = System.currentTimeMillis ();
-		Timestamp startTimeStamp = new Timestamp (System.currentTimeMillis());
-		msoLogger.debug ("Insert into OperationalEnvDistributionStatus " );
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		OperationalEnvDistributionStatus oed = new OperationalEnvDistributionStatus ();
-		
-		try {
-			session.beginTransaction ();
-			
-			oed.setDistributionId (distributionId);
-			oed.setOperationalEnvId (operationalEnvId);
-			oed.setServiceModelVersionId (serviceModelVersionId);
-			oed.setDistributionIdStatus (distributionIdStatus);
-			oed.setRequestId(requestId);
-			oed.setCreateTime (startTimeStamp);
-			Timestamp modifyTimeStamp = new Timestamp (System.currentTimeMillis());
-			oed.setModifyTime (modifyTimeStamp);
-			
-			msoLogger.debug ("About to insert a record into OperationalEnvDistributionStatus");
-			
-            session.save (oed);
-			session.getTransaction ().commit ();
-		} 		catch (Exception e) {
-        	msoLogger.error (MessageEnum.APIH_DB_INSERT_EXC, "", "", MsoLogger.ErrorCode.SchemaError, "Exception in insertOperationalEnvDistributionStatus", e);
-            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, e.getMessage (), "OperationalEnvDistributionStatusDB", "saveRequest", null);
-            if (session != null) {
-                session.close ();
-            }
-            // throw an Exception in the event of a DB insert failure so that the calling routine can exit
-            throw e;
-        }
-		finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-			}
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "OperationalEnvDistributionStatusDB", "insertOperationalEnvDistributionStatus", null);
-		}
-	}
-	
-	
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationalEnvServiceModelStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationalEnvServiceModelStatus.java
deleted file mode 100644
index fe581de..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationalEnvServiceModelStatus.java
+++ /dev/null
@@ -1,121 +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.requestsdb;
-
-import java.io.Serializable;
-import java.sql.Timestamp;
-
-/**
- * @author PB6115
- *
- */
-public class OperationalEnvServiceModelStatus implements Serializable {
-
-    /**
-	 * Serialization id.
-	 */
-	private static final long serialVersionUID = 8197084996598869656L;
-	
-	private String requestId = null;
-	private String operationalEnvId = null;
-	private String serviceModelVersionId = null;
-	private String serviceModelVersionDistrStatus = null;
-	private String recoveryAction = null;
-	private int retryCount;
-	private String workloadContext = null;
-	private Timestamp createTime = null;
-	private Timestamp modifyTime = null;
-	
-	public String getRequestId() {
-		return requestId;
-	}
-	
-	public void setRequestId(String requestId) {
-		this.requestId = requestId;
-	}
-	
-	public String getOperationalEnvId() {
-		return operationalEnvId;
-	}
-	
-	public void setOperationalEnvId(String operationalEnvId) {
-		this.operationalEnvId = operationalEnvId;
-	}
-	
-	public String getServiceModelVersionId() {
-		return serviceModelVersionId;
-	}
-	
-	public void setServiceModelVersionId(String serviceModelVersionId) {
-		this.serviceModelVersionId = serviceModelVersionId;
-	}
-	
-	public String getServiceModelVersionDistrStatus() {
-		return serviceModelVersionDistrStatus;
-	}
-	
-	public void setServiceModelVersionDistrStatus(String serviceModelVersionDistrStatus) {
-		this.serviceModelVersionDistrStatus = serviceModelVersionDistrStatus;
-	}
-	
-	public String getRecoveryAction() {
-		return recoveryAction;
-	}
-	
-	public void setRecoveryAction(String recoveryAction) {
-		this.recoveryAction = recoveryAction;
-	}
-	
-	public int getRetryCount() {
-		return retryCount;
-	}
-	
-	public void setRetryCount(int retryCount) {
-		this.retryCount = retryCount;
-	}
-
-	public String getWorkloadContext() {
-		return workloadContext;
-	}
-
-	public void setWorkloadContext(String workloadContext) {
-		this.workloadContext = workloadContext;
-	}
-
-	public Timestamp getCreateTime() {
-		return createTime;
-	}
-	public void setCreateTime(Timestamp createTime) {
-		this.createTime = createTime;
-	}
-	
-	public Timestamp getModifyTime() {
-		return modifyTime;
-	}
-	
-	public void setModifyTime(Timestamp modifyTime) {
-		this.modifyTime = modifyTime;
-	}
-
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationalEnvServiceModelStatusDb.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationalEnvServiceModelStatusDb.java
deleted file mode 100644
index 1c2055e..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationalEnvServiceModelStatusDb.java
+++ /dev/null
@@ -1,243 +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.requestsdb;
-
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-import org.openecomp.mso.logger.MessageEnum;
-import org.openecomp.mso.logger.MsoLogger;
-
-public class OperationalEnvServiceModelStatusDb {
-
-    protected final AbstractSessionFactoryManager sessionFactoryRequestDB;
-    
-    protected static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
-
-    
-    protected static final String			REQUEST_ID               		= "requestId";
-    protected static final String			OPERATIONAL_ENV_ID  		 	= "operationalEnvId";
-    protected static final String			SERVICE_MODEL_VERSION_ID      	= "serviceModelVersionId";
-    protected static final String			SERVICE_MOD_VER_DISTR_STATUS  	= "serviceModelVersionDistrStatus";
-    protected static final String			RECOVERY_ACTION         		= "recoveryAction";
-    protected static final int				RETRY_COUNT_LEFT          		= 0;
-    protected static final String			CREATE_TIME                 	= "startTime";
-    protected static final String 			MODIFY_TIME                 	= "modifyTime";
-    
-
-    public static OperationalEnvServiceModelStatusDb getInstance() {
-        return new OperationalEnvServiceModelStatusDb(new RequestsDbSessionFactoryManager ());
-    }
-
-    protected OperationalEnvServiceModelStatusDb (AbstractSessionFactoryManager sessionFactoryRequest) {
-        sessionFactoryRequestDB = sessionFactoryRequest;
-    }
-    
-
-    /**
-     * Retrieve OperationalEnvServiceModelStatus from given OperationalEnvironmentId and serviceModelVersionId
-     * @param operationalEnvId
-     * @param serviceModelVersionId
-     * @return
-     */
-	public OperationalEnvServiceModelStatus getOperationalEnvServiceModelStatus(String operationalEnvId, String serviceModelVersionId) {
-		long startTime = System.currentTimeMillis ();
-		msoLogger.debug ("Retrieve OperationalEnvironmentServiceModel with operationalEnvironmentId: " + operationalEnvId + ", serviceModelVersionId: " + serviceModelVersionId);
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		OperationalEnvServiceModelStatus request = null;
-		try {
-			session.beginTransaction ();
-			Query query = session.createQuery ("FROM OperationalEnvServiceModelStatus WHERE operationalEnvId = :operationalEnvId AND serviceModelVersionId = :serviceModelVersionId");
-			query.setParameter ("operationalEnvId", operationalEnvId);
-			query.setParameter ("serviceModelVersionId", serviceModelVersionId);
-			request = (OperationalEnvServiceModelStatus) query.uniqueResult ();
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-			}
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, 
-										"Successfully", "OperationalEnvServiceModelStatus", "getOperationalEnvServiceModelStatus", null);
-		}
-		return request;
-	}
-	
-	
-    /**
-     * Retrieve OperationalEnvServiceModelStatus from given OperationalEnvironmentId and serviceModelVersionId
-     * @param operationalEnvId
-     * @param serviceModelVersionId
-     * @return
-     */
-	@SuppressWarnings("unchecked")
-	public List<OperationalEnvServiceModelStatus> getOperationalEnvIdStatus(String operationalEnvId, String requestId) {
-		long startTime = System.currentTimeMillis ();
-		msoLogger.debug ("Retrieve OperationalEnvironmentServiceModel with operationalEnvironmentId: " + operationalEnvId + ", requestId: " + requestId);
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		List<OperationalEnvServiceModelStatus> requests = new ArrayList<OperationalEnvServiceModelStatus>();
-		
-		try {
-			session.beginTransaction ();
-			Query query = session.createQuery ("FROM OperationalEnvServiceModelStatus WHERE operationalEnvId = :operationalEnvId AND requestId = :requestId");
-			query.setParameter ("operationalEnvId", operationalEnvId);
-			query.setParameter ("requestId", requestId);
-			requests = query.list();
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-			}
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, 
-										"Successfully", "OperationalEnvServiceModelStatus", "getOperationalEnvIdStatus", null);
-		}
-		return requests;
-	}
-	
-	
-    /**
-     * Update OperationalEnvServiceModelStatus serviceModelVersionDistrStatus with asdcStatus and retryCount for given operationalEnvId, serviceModelVersionId
-     * @param operationalEnvId
-     * @param serviceModelVersionId
-     * @param asdcStatus
-     * @param retryCount
-     */
-	public int updateOperationalEnvRetryCountStatus(String operationalEnvId, String serviceModelVersionId, String asdcStatus, int retryCount) {
-		long startTime = System.currentTimeMillis ();
-		msoLogger.debug ("Update OperationalEnvServiceModelStatus retryCount: " + retryCount + " and serviceModelVersionDistrStatus :" + asdcStatus);
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		int result = 0;
-		try {
-			session.beginTransaction ();
-			Query query = session.createQuery ("update OperationalEnvServiceModelStatus set serviceModelVersionDistrStatus = :serviceModelVersionDistrStatus, retryCount = :retryCount, modifyTime = :modifyTime where "
-					+ "operationalEnvId = :operationalEnvId and serviceModelVersionId = :serviceModelVersionId ");
-			query.setParameter ("retryCount", retryCount);
-			query.setParameter (SERVICE_MOD_VER_DISTR_STATUS, asdcStatus);
-			query.setParameter ("operationalEnvId", operationalEnvId);
-			query.setParameter ("serviceModelVersionId", serviceModelVersionId);
-			Timestamp modifyTimeStamp = new Timestamp (System.currentTimeMillis());
-			query.setParameter ("modifyTime", modifyTimeStamp);
-			result = query.executeUpdate ();
-			session.getTransaction ().commit ();
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-			}
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "OperationalEnvServiceModelDB", "updateOperationalEnvRetryCountStatus", null);
-		}
-		return result;
-	}
-	
-    /**
-     * Update OperationalEnvServiceModelStatus serviceModelVersionDistrStatus with asdcStatus and retryCount for given operationalEnvId, serviceModelVersionId, requestId
-     * @param operationalEnvId
-     * @param serviceModelVersionId
-     * @param asdcStatus
-     * @param retryCount
-     * @param requestId
-     */
-	public int updateOperationalEnvRetryCountStatusPerReqId(String operationalEnvId, String serviceModelVersionId, String asdcStatus, int retryCount, String requestId) {
-		long startTime = System.currentTimeMillis ();
-		msoLogger.debug ("Update OperationalEnvServiceModelStatus retryCount: " + retryCount + " and serviceModelVersionDistrStatus :" + asdcStatus);
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		int result = 0;
-		try {
-			session.beginTransaction ();
-			Query query = session.createQuery ("update OperationalEnvServiceModelStatus set serviceModelVersionDistrStatus = :asdcStatus, retryCount = :retryCount, modifyTime = :modifyTime where "
-					+ "operationalEnvId = :operationalEnvId and serviceModelVersionId = :serviceModelVersionId and requestId = :requestId ");
-			query.setParameter ("retryCount", retryCount);
-			query.setParameter (SERVICE_MOD_VER_DISTR_STATUS, asdcStatus);
-			query.setParameter ("operationalEnvId", operationalEnvId);
-			query.setParameter ("serviceModelVersionId", serviceModelVersionId);
-			query.setParameter ("requestId", requestId);
-			Timestamp modifyTimeStamp = new Timestamp (System.currentTimeMillis());
-			query.setParameter ("modifyTime", modifyTimeStamp);
-			result = query.executeUpdate ();
-			session.getTransaction ().commit ();
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-			}
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "OperationalEnvServiceModelDB", "updateOperationalEnvRetryCountStatusPerReqId", null);
-		}
-		return result;
-	}
-	
-	
-    /**
-     * Insert into OperationalEnvServiceModelStatus with operationalEnvId, serviceModelVersionId, distributionIdStatus, recoveryAction, retryCount 
-     * @param operationalEnvId
-     * @param serviceModelVersionId
-     * @param distributionIdStatus
-     * @param distributionId
-     * @param recoveryAction
-     * @param retryCount
-     */
-	public void insertOperationalEnvServiceModelStatus(String requestId, String operationalEnvId, String serviceModelVersionId, 
-			String distributionIdStatus, String recoveryAction, int retryCount, String workloadContext) {
-		long startTime = System.currentTimeMillis ();
-		Timestamp startTimeStamp = new Timestamp (System.currentTimeMillis());
-		msoLogger.debug ("Insert into OperationalEnvServiceModelStatus " );
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		OperationalEnvServiceModelStatus oesm = new OperationalEnvServiceModelStatus ();
-	
-		try {
-			session.beginTransaction ();
-		
-			oesm.setRequestId (requestId);
-			oesm.setOperationalEnvId (operationalEnvId);
-			oesm.setServiceModelVersionId (serviceModelVersionId);
-			oesm.setServiceModelVersionDistrStatus (distributionIdStatus);
-			oesm.setRecoveryAction (recoveryAction);
-			oesm.setRetryCount (retryCount);
-			oesm.setWorkloadContext(workloadContext);
-			oesm.setCreateTime (startTimeStamp);
-			Timestamp modifyTimeStamp = new Timestamp (System.currentTimeMillis());
-			oesm.setModifyTime (modifyTimeStamp);
-		
-			msoLogger.debug ("About to insert a record into OperationalEnvServiceModelStatus");
-		
-			session.save (oesm);
-			session.getTransaction ().commit ();
-		} catch (Exception e) {
-			msoLogger.error (MessageEnum.APIH_DB_INSERT_EXC, "", "", MsoLogger.ErrorCode.SchemaError, "Exception in insertOperationalEnvServiceModelStatus", e);
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, e.getMessage (), "OperationalEnvServiceModelStatusDB", "saveRequest", null);
-			if (session != null) {
-				session.close ();
-			}
-			// throw an Exception in the event of a DB insert failure so that the calling routine can exit
-			throw e;
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-		}
-		msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "OperationalEnvServiceModelStatusDB", "insertOperationalEnvServiceModelStatus", null);
-	}
-		
-  }
-
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDBHelper.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDBHelper.java
deleted file mode 100644
index 29e55b8..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDBHelper.java
+++ /dev/null
@@ -1,71 +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.requestsdb;
-
-import org.openecomp.mso.logger.MsoLogger;
-
-public class RequestsDBHelper {
-		
-	private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.APIH);	
-	private String className = this.getClass().getSimpleName() +" class\'s ";
-	private String methodName = ""; 
-	private String classMethodMessage = "";
-	
-	/**
-	 * This util method is to update the InfraRequest table to Complete
-	 * @param msg - string, unique message for each caller
-	 * @param requestId - string
-	 * @param operationalEnvironmentId - string   
-	 * @return void - nothing 
-	 * @throws Exception 
-	 */	
-	public void updateInfraSuccessCompletion(String msg, String requestId, String operationalEnvironmentId) {
-		methodName = "updateInfraSuccessCompletion() method.";
-		classMethodMessage = className + " " + methodName;		
-		msoLogger.debug("Begin of " + classMethodMessage);
-			
-		RequestsDatabase requestDB = RequestsDatabase.getInstance();
-		requestDB.updateInfraFinalStatus(requestId, "COMPLETE", "SUCCESSFUL, operationalEnvironmentId - " + operationalEnvironmentId + "; Success Message: " + msg,
-										100L, null, "APIH");
-		msoLogger.debug("End of " + classMethodMessage);		
-		
-	}
-	
-	/**
-	 * This util method is to update the InfraRequest table to Failure
-	 * @param msg - string, unique message for each caller
-	 * @param requestId - string
-	 * @param operationalEnvironmentId - string   
-	 * @return void - nothing 
-	 * @throws Exception 
-	 */	
-	public void updateInfraFailureCompletion(String msg, String requestId, String operationalEnvironmentId) {
-		methodName = "updateInfraFailureCompletion() method.";
-		classMethodMessage = className + " " + methodName;		
-		msoLogger.debug("Begin of " + classMethodMessage);
-		
-		RequestsDatabase requestDB = RequestsDatabase.getInstance();
-		requestDB.updateInfraFinalStatus(requestId, "FAILED", "FAILURE, operationalEnvironmentId - " + operationalEnvironmentId + "; Error message: " + msg,
-											100L, null, "APIH");
-		msoLogger.debug("End of " + classMethodMessage);		
-		
-	}	
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java
deleted file mode 100644
index 9964b93..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java
+++ /dev/null
@@ -1,888 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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.requestsdb;
-
-import java.sql.Timestamp;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.hibernate.Criteria;
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.criterion.Criterion;
-import org.hibernate.criterion.Order;
-import org.hibernate.criterion.Restrictions;
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-import org.openecomp.mso.requestsdb.RequestsDbConstant.Status;
-import org.openecomp.mso.requestsdb.RequestsDbSessionFactoryManager;
-import org.openecomp.mso.logger.MsoLogger;
-
-public class RequestsDatabase {
-
-    protected final AbstractSessionFactoryManager sessionFactoryRequestDB;
-    
-    protected static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
-    
-    protected static final String         SOURCE                     = "source";
-    protected static final String         START_TIME                 = "startTime";
-    protected static final String         REQUEST_TYPE               = "requestType";
-    protected static final String         SERVICE_INSTANCE_ID        = "serviceInstanceId";
-    protected static final String         SERVICE_INSTANCE_NAME      = "serviceInstanceName";
-    protected static final String         VNF_INSTANCE_NAME          = "vnfName";
-    protected static final String         VNF_INSTANCE_ID            = "vnfId";
-    protected static final String         VOLUME_GROUP_INSTANCE_NAME = "volumeGroupName";
-    protected static final String         VOLUME_GROUP_INSTANCE_ID   = "volumeGroupId";
-    protected static final String         VFMODULE_INSTANCE_NAME     = "vfModuleName";
-    protected static final String         VFMODULE_INSTANCE_ID       = "vfModuleId";
-    protected static final String         NETWORK_INSTANCE_NAME      = "networkName";
-    protected static final String		  CONFIGURATION_INSTANCE_ID  = "configurationId";
-    protected static final String		  CONFIGURATION_INSTANCE_NAME= "configurationName";
-    protected static final String		  OPERATIONAL_ENV_ID  		 = "operationalEnvId";
-    protected static final String		  OPERATIONAL_ENV_NAME		 = "operationalEnvName";
-    protected static final String         NETWORK_INSTANCE_ID        = "networkId";
-    protected static final String         GLOBAL_SUBSCRIBER_ID       = "globalSubscriberId";
-    protected static final String         SERVICE_NAME_VERSION_ID    = "serviceNameVersionId";
-    protected static final String         SERVICE_ID                 = "serviceId";
-    protected static final String         SERVICE_VERSION            = "serviceVersion";
-    protected static final String         REQUEST_ID                 = "requestId";
-    protected static final String         REQUESTOR_ID               = "requestorId";
-    
-    protected static MockRequestsDatabase mockDB                     = null;
-
-    public static RequestsDatabase getInstance() {
-        return new RequestsDatabase(new RequestsDbSessionFactoryManager ());
-    }
-
-    protected RequestsDatabase (AbstractSessionFactoryManager sessionFactoryRequest) {
-        sessionFactoryRequestDB = sessionFactoryRequest;
-    }
-
-    public boolean healthCheck () {
-        Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-        try {
-            Query query = session.createSQLQuery (" show tables ");
-
-            List<?> list = query.list();
-
-        } finally {
-            if (session != null && session.isOpen ()) {
-                session.close ();
-            }
-        }
-        return true;
-    }
-
-
-    public int updateInfraStatus (String requestId, String requestStatus, String lastModifiedBy) {
-        long startTime = System.currentTimeMillis ();
-        msoLogger.debug ("Update infra request record " + requestId + " with status " + requestStatus);
-        Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-
-        int result = 0;
-        try {
-            session.beginTransaction ();
-            Query query = session.createQuery ("update InfraActiveRequests set requestStatus = :requestStatus, modifyTime = :modifyTime, lastModifiedBy = :lastModifiedBy where requestId = :requestId ");
-            query.setParameter ("requestStatus", requestStatus);
-            query.setParameter (REQUEST_ID, requestId);
-            query.setParameter ("lastModifiedBy", lastModifiedBy);
-            Timestamp modifyTimeStamp = new Timestamp (System.currentTimeMillis());
-            query.setParameter ("modifyTime", modifyTimeStamp);
-            result = query.executeUpdate ();
-            session.getTransaction ().commit ();
-        } finally {
-            if (session != null && session.isOpen ()) {
-                session.close ();
-            }
-            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "updateInfraStatus", null);
-        }
-        return result;
-    }
-
-    public int updateInfraStatus (String requestId, String requestStatus, long progress, String lastModifiedBy) {
-        long startTime = System.currentTimeMillis ();
-        msoLogger.debug ("Update infra request record " + requestId + " with status " + requestStatus);
-        Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-
-        int result = 0;
-        try {
-            session.beginTransaction ();
-            Query query = session.createQuery ("update InfraActiveRequests set requestStatus = :requestStatus, modifyTime = :modifyTime, progress = :progress, lastModifiedBy = :lastModifiedBy where requestId = :requestId ");
-            query.setParameter ("requestStatus", requestStatus);
-            query.setParameter (REQUEST_ID, requestId);
-            query.setParameter ("progress", progress);
-            query.setParameter ("lastModifiedBy", lastModifiedBy);
-            Timestamp modifyTimeStamp = new Timestamp (System.currentTimeMillis());
-            query.setParameter ("modifyTime", modifyTimeStamp);
-            result = query.executeUpdate ();
-            session.getTransaction ().commit ();
-        } finally {
-            if (session != null && session.isOpen ()) {
-                session.close ();
-            }
-            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "updateInfraStatus", null);
-        }
-        return result;
-    }
-
-    public int updateInfraFinalStatus (String requestId, String requestStatus, String statusMessage, long progress, String responseBody, String lastModifiedBy) {
-        long startTime = System.currentTimeMillis ();
-        msoLogger.debug ("Update infra request record " + requestId + " with status " + requestStatus);
-        Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-
-        int result = 0;
-        try {
-            session.beginTransaction ();
-            Query query = session.createQuery ("update InfraActiveRequests set requestStatus = :requestStatus, statusMessage = :statusMessage, progress = :progress, endTime = :endTime, responseBody = :responseBody, lastModifiedBy = :lastModifiedBy where id.requestId = :requestId ");
-            query.setParameter ("requestStatus", requestStatus);
-            query.setParameter ("requestId", requestId);
-            Timestamp endTimeStamp = new Timestamp (System.currentTimeMillis());
-            query.setParameter ("endTime", endTimeStamp);
-            query.setParameter ("statusMessage", statusMessage);
-            query.setParameter ("progress", progress);
-            query.setParameter ("responseBody", responseBody);
-            query.setParameter ("lastModifiedBy", lastModifiedBy);
-            result = query.executeUpdate ();
-            session.getTransaction ().commit ();
-        } finally {
-            if (session != null && session.isOpen ()) {
-                session.close ();
-            }
-            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "updateInfraFinalStatus", null);
-        }
-        return result;
-    }
-
-    
-    private List<InfraActiveRequests> executeInfraQuery (List <Criterion> criteria, Order order) {
-
-        long startTime = System.currentTimeMillis ();
-        msoLogger.debug ("Execute query on infra active request table");
-        
-        List <InfraActiveRequests> results = new ArrayList<>();
-
-        Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-        try {
-            session.beginTransaction ();
-            Criteria crit = session.createCriteria (InfraActiveRequests.class);
-            for (Criterion criterion : criteria) {
-                crit.add (criterion);
-            }
-            crit.addOrder (order);
-
-           // @SuppressWarnings("unchecked")
-            results = crit.list ();
-
-        } finally {
-            if (session != null && session.isOpen ()) {
-                session.close ();
-            }
-            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "getInfraActiveRequest", null);
-        }
-        return results;
-    }
-    
-    public InfraActiveRequests getRequestFromInfraActive (String requestId) {
-        long startTime = System.currentTimeMillis ();
-        msoLogger.debug ("Get request " + requestId + " from InfraActiveRequests DB");
-
-        Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-        InfraActiveRequests ar = null;
-        try {
-            session.beginTransaction ();
-            Query query = session.createQuery ("from InfraActiveRequests where requestId = :requestId OR clientRequestId = :requestId");
-            query.setParameter (REQUEST_ID, requestId);
-            ar = (InfraActiveRequests) query.uniqueResult ();
-        } finally {
-            if (session != null && session.isOpen ()) {
-                session.close ();
-            }
-            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "InfraRequestDB", "getRequestFromInfraActive", null);
-        }
-        return ar;
-    }
-    
-    public InfraActiveRequests checkInstanceNameDuplicate (HashMap<String,String> instanceIdMap, String instanceName, String requestScope) {
-
-        List <Criterion> criteria = new LinkedList <> ();
-       
-        if(instanceName != null && !instanceName.equals("")) {
-        	
-        	if("service".equals(requestScope)){
-        		criteria.add (Restrictions.eq (SERVICE_INSTANCE_NAME, instanceName));
-        	} else if("vnf".equals(requestScope)){
-        		criteria.add (Restrictions.eq (VNF_INSTANCE_NAME, instanceName));
-        	} else if("volumeGroup".equals(requestScope)){
-        		criteria.add (Restrictions.eq (VOLUME_GROUP_INSTANCE_NAME, instanceName));
-        	} else if("vfModule".equals(requestScope)){
-        		criteria.add (Restrictions.eq (VFMODULE_INSTANCE_NAME, instanceName));
-        	} else if("network".equals(requestScope)){
-        		criteria.add (Restrictions.eq (NETWORK_INSTANCE_NAME, instanceName));
-        	} else if(requestScope.equals("configuration")) {
-        		criteria.add (Restrictions.eq (CONFIGURATION_INSTANCE_NAME, instanceName));
-        	} else if(requestScope.equals("operationalEnvironment")) {
-        		criteria.add (Restrictions.eq (OPERATIONAL_ENV_NAME, instanceName));
-        	}
-        
-        } else {
-            if(instanceIdMap != null){
-            	if("service".equals(requestScope) && instanceIdMap.get("serviceInstanceId") != null){
-            		criteria.add (Restrictions.eq (SERVICE_INSTANCE_ID, instanceIdMap.get("serviceInstanceId")));
-             	}
-            
-            	if("vnf".equals(requestScope) && instanceIdMap.get("vnfInstanceId") != null){
-            		criteria.add (Restrictions.eq (VNF_INSTANCE_ID, instanceIdMap.get("vnfInstanceId")));
-             	}
-            
-            	if("vfModule".equals(requestScope) && instanceIdMap.get("vfModuleInstanceId") != null){
-            		criteria.add (Restrictions.eq (VFMODULE_INSTANCE_ID, instanceIdMap.get("vfModuleInstanceId")));
-             	}
-            
-            	if("volumeGroup".equals(requestScope) && instanceIdMap.get("volumeGroupInstanceId") != null){
-            		criteria.add (Restrictions.eq (VOLUME_GROUP_INSTANCE_ID, instanceIdMap.get("volumeGroupInstanceId")));
-             	}
-            
-            	if("network".equals(requestScope) && instanceIdMap.get("networkInstanceId") != null){
-            		criteria.add (Restrictions.eq (NETWORK_INSTANCE_ID, instanceIdMap.get("networkInstanceId")));
-            	}
-            	
-            	if(requestScope.equals("configuration") && instanceIdMap.get("configurationInstanceId") != null){
-            		criteria.add (Restrictions.eq (CONFIGURATION_INSTANCE_ID, instanceIdMap.get("configurationInstanceId")));
-            	}
-            	
-            	if(requestScope.equals("operationalEnvironment") && instanceIdMap.get("operationalEnvironmentId") != null) {
-            		criteria.add (Restrictions.eq (OPERATIONAL_ENV_ID, instanceIdMap.get("operationalEnvironmentId")));
-            	}
-            }
-        }
-        
-        criteria.add (Restrictions.in ("requestStatus", new String[] { "PENDING", "IN_PROGRESS", "TIMEOUT", "PENDING_MANUAL_TASK" }));
-        
-        Order order = Order.desc (START_TIME);
-        
-        List<InfraActiveRequests> dupList = executeInfraQuery(criteria, order);
-        
-        InfraActiveRequests infraActiveRequests = null;
-        
-        if(dupList != null && !dupList.isEmpty()){
-        	infraActiveRequests = dupList.get(0);
-        }
-         	
-        return infraActiveRequests; 
-    }
-      
-    public List<InfraActiveRequests> getOrchestrationFiltersFromInfraActive (Map<String, List<String>> orchestrationMap) {
-        
-    	
-    	List <Criterion> criteria = new LinkedList <> ();
-    	for (Map.Entry<String, List<String>> entry : orchestrationMap.entrySet())
-    	{
-    		String mapKey = entry.getKey();
-    		if("serviceInstanceId".equalsIgnoreCase(mapKey)) {
-    			mapKey = "serviceInstanceId";
-    		} else if("serviceInstanceName".equalsIgnoreCase(mapKey)) {
-    			mapKey = "serviceInstanceName";
-    		} else if("vnfInstanceId".equalsIgnoreCase(mapKey)){
-    	    	mapKey = "vnfId";
-     	    } else if("vnfInstanceName".equalsIgnoreCase(mapKey)) {
-    	    	mapKey = "vnfName";
-    	    } else if("vfModuleInstanceId".equalsIgnoreCase(mapKey)) {
-    	    	mapKey = "vfModuleId";
-    	    } else if("vfModuleInstanceName".equalsIgnoreCase(mapKey)) {
-    	    	mapKey = "vfModuleName";
-    	    } else if("volumeGroupInstanceId".equalsIgnoreCase(mapKey)) {
-    	    	mapKey = "volumeGroupId";
-    	    } else if("volumeGroupInstanceName".equalsIgnoreCase(mapKey)) {
-    	    	mapKey = "volumeGroupName";
-    	    } else if("networkInstanceId".equalsIgnoreCase(mapKey)) {
-    	    	mapKey = "networkId";
-    	    } else if("networkInstanceName".equalsIgnoreCase(mapKey)) {
-    	    	mapKey = "networkName";
-    	    } else if(mapKey.equalsIgnoreCase("configurationInstanceId")) {    	    	
-    	    	mapKey = "configurationId";
-    	    } else if(mapKey.equalsIgnoreCase("configurationInstanceName")) {    	    	
-    	    	mapKey = "configurationName";
-    	    } else if("lcpCloudRegionId".equalsIgnoreCase(mapKey)) {
-    	    	mapKey = "aicCloudRegion";
-    	    } else if("tenantId".equalsIgnoreCase(mapKey)) {
-    	    	mapKey = "tenantId";
-    	    } else if("modelType".equalsIgnoreCase(mapKey)) {
-    	    	mapKey = "requestScope";
-    	    } else if("requestorId".equalsIgnoreCase(mapKey)) {
-    	    	mapKey = "requestorId";
-    	    } else if("requestExecutionDate".equalsIgnoreCase(mapKey)) {
-    	    	mapKey = "startTime";
-    	    }
-    	    
-    		String propertyValue = entry.getValue().get(1);
-    		if ("startTime".equals(mapKey)) {
-    			SimpleDateFormat format = new SimpleDateFormat("MM-dd-yyyy");    	        
-    			try {
-	    	        Date thisDate = format.parse(propertyValue);
-	    	        Timestamp minTime = new Timestamp(thisDate.getTime());	    	        
-	    	        Timestamp maxTime = new Timestamp(thisDate.getTime() + TimeUnit.DAYS.toMillis(1));
-	    	        
-	    	        if("DOES_NOT_EQUAL".equalsIgnoreCase(entry.getValue().get(0))) {
-	    	        	criteria.add(Restrictions.or(Restrictions.lt(mapKey, minTime),
-	    	        			Restrictions.ge(mapKey, maxTime)));	        			
-	        		} else {	        			
-	        			criteria.add(Restrictions.between(mapKey, minTime, maxTime));        		       			
-	        		}    
-    			}
-    			catch (Exception e){
-    				msoLogger.debug("Exception in getOrchestrationFiltersFromInfraActive(): + " + e.getMessage(), e);
-    				return null;
-    			}
-    		}
-    		else if("DOES_NOT_EQUAL".equalsIgnoreCase(entry.getValue().get(0))) {
-    			criteria.add(Restrictions.ne(mapKey, propertyValue));
-    		} else {
-    			criteria.add(Restrictions.eq(mapKey, propertyValue));
-    		}
-    	    
-    	}
-    	
-         Order order = Order.asc (START_TIME);
-
-        return executeInfraQuery (criteria, order);
-    }
-
-    // Added this method for Tenant Isolation project ( 1802-295491a) to query the mso_requests DB 
-    // (infra_active_requests table) for operationalEnvId and OperationalEnvName
-    public List<InfraActiveRequests> getCloudOrchestrationFiltersFromInfraActive (Map<String, String> orchestrationMap) {
-    	List <Criterion> criteria = new LinkedList <> ();
-    	
-    	// Add criteria on OperationalEnvironment RequestScope when requestorId is only specified in the filter
-    	// as the same requestorId can also match on different API methods
-    	String resourceType = orchestrationMap.get("resourceType");
-    	if(resourceType == null) {
-    		criteria.add(Restrictions.eq("requestScope", "operationalEnvironment"));
-    	}
-    	
-    	for (Map.Entry<String, String> entry : orchestrationMap.entrySet()) {
-    		String mapKey = entry.getKey();
-    		if(mapKey.equalsIgnoreCase("requestorId")) {
-    	    	mapKey = "requestorId";
-    	    } else if(mapKey.equalsIgnoreCase("requestExecutionDate")) {    	    	
-    	    	mapKey = "startTime";
-    	    } else if(mapKey.equalsIgnoreCase("operationalEnvironmentId")) {    	    	
-    	    	mapKey = "operationalEnvId";
-    	    } else if(mapKey.equalsIgnoreCase("operationalEnvironmentName")) {    	    	
-    	    	mapKey = "operationalEnvName";
-    	    } else if(mapKey.equalsIgnoreCase("resourceType")) {    	    	
-    	    	mapKey = "requestScope";
-    	    }
-    	    
-    		String propertyValue = entry.getValue();
-    		if (mapKey.equals("startTime")) {    			
-    			SimpleDateFormat format = new SimpleDateFormat("MM-dd-yyyy");    	        
-    			try {
-	    	        Date thisDate = format.parse(propertyValue);
-	    	        Timestamp minTime = new Timestamp(thisDate.getTime());	    	        
-	    	        Timestamp maxTime = new Timestamp(thisDate.getTime() + TimeUnit.DAYS.toMillis(1));
-	    	        
-	        		criteria.add(Restrictions.between(mapKey, minTime, maxTime));        		       			
-    			}
-    			catch (Exception e){
-    				msoLogger.debug("Exception in getCloudOrchestrationFiltersFromInfraActive(): + " + e.getMessage());
-    				return null;
-    			}
-    		} else {
-    			criteria.add(Restrictions.eq(mapKey, propertyValue));
-    		}
-    	}
-    	
-         Order order = Order.asc (START_TIME);
-         return executeInfraQuery (criteria, order);
-    }
-
-    public List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName,
-                                                                            String queryValue,
-                                                                            String requestType) {
-        msoLogger.debug ("Get list of infra requests from DB with " + queryAttributeName + " = " + queryValue);
-
-        Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-        try {
-            session.beginTransaction ();
-            Criteria crit = session.createCriteria (InfraActiveRequests.class)
-                    .add (Restrictions.eq (queryAttributeName, queryValue));
-            crit.add (Restrictions.eqOrIsNull (REQUEST_TYPE, requestType));
-            crit.addOrder (Order.desc (START_TIME));
-            crit.addOrder (Order.asc (SOURCE));
-
-            @SuppressWarnings("unchecked")
-            List <InfraActiveRequests> arList = crit.list ();
-            if (arList != null && !arList.isEmpty ()) {
-                return arList;
-            }
-        } finally {
-            if (session != null && session.isOpen ()) {
-                session.close ();
-            }
-           // msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "getRequestListFromInfraActive", null);
-        }
-        return null;
-    }
-
-
-    public InfraActiveRequests getRequestFromInfraActive (String requestId, String requestType) {
-        long startTime = System.currentTimeMillis ();
-        msoLogger.debug ("Get infra request from DB with id " + requestId);
-
-        Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-        InfraActiveRequests ar = null;
-        try {
-            session.beginTransaction ();
-            Query query = session.createQuery ("from InfraActiveRequests where (requestId = :requestId OR clientRequestId = :requestId) and requestType = :requestType");
-            query.setParameter (REQUEST_ID, requestId);
-            query.setParameter (REQUEST_TYPE, requestType);
-            ar = (InfraActiveRequests) query.uniqueResult ();
-        } finally {
-            if (session != null && session.isOpen ()) {
-                session.close ();
-            }
-            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "getRequestFromInfraActive", null);
-        }
-        return ar;
-    }
-
-
-    public InfraActiveRequests checkDuplicateByVnfName (String vnfName, String action, String requestType) {
-
-        long startTime = System.currentTimeMillis ();
-        msoLogger.debug ("Get infra request from DB for VNF " + vnfName + " and action " + action + " and requestType " + requestType);
-
-        InfraActiveRequests ar = null;
-        Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-
-        try {
-            session.beginTransaction ();
-            Query query = session.createQuery ("from InfraActiveRequests where vnfName = :vnfName and action = :action and (requestStatus = 'PENDING' or requestStatus = 'IN_PROGRESS' or requestStatus = 'TIMEOUT' or requestStatus = 'PENDING_MANUAL_TASK') and requestType = :requestType ORDER BY startTime DESC");
-            query.setParameter ("vnfName", vnfName);
-            query.setParameter ("action", action);
-            query.setParameter (REQUEST_TYPE, requestType);
-            @SuppressWarnings("unchecked")
-            List <InfraActiveRequests> results = query.list ();
-            if (!results.isEmpty ()) {
-                ar = results.get (0);
-            }
-        } finally {
-            if (session != null && session.isOpen ()) {
-                session.close ();
-            }
-            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "checkDuplicateByVnfName", null);
-        }
-
-        return ar;
-    }
-
-    public InfraActiveRequests checkDuplicateByVnfId (String vnfId, String action, String requestType) {
-
-        long startTime = System.currentTimeMillis ();
-        msoLogger.debug ("Get list of infra requests from DB for VNF " + vnfId + " and action " + action);
-
-        InfraActiveRequests ar = null;
-        Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-
-        try {
-            session.beginTransaction ();
-            Query query = session.createQuery ("from InfraActiveRequests where vnfId = :vnfId and action = :action and (requestStatus = 'PENDING' or requestStatus = 'IN_PROGRESS' or requestStatus = 'TIMEOUT' or requestStatus = 'PENDING_MANUAL_TASK') and requestType = :requestType ORDER BY startTime DESC");
-            query.setParameter ("vnfId", vnfId);
-            query.setParameter ("action", action);
-            query.setParameter (REQUEST_TYPE, requestType);
-            @SuppressWarnings("unchecked")
-            List <InfraActiveRequests> results = query.list ();
-            if (!results.isEmpty ()) {
-                ar = results.get (0);
-            }
-        } finally {
-            if (session != null && session.isOpen ()) {
-                session.close ();
-            }
-            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "checkDuplicateByVnfId", null);
-        }
-
-        return ar;
-    }
-
-    public void setMockDB(MockRequestsDatabase mockDB) {
-        RequestsDatabase.mockDB = mockDB;
-    }
-
-    /**
-     * Fetch a specific SiteStatus by SiteName.
-     *
-     * @param siteName The unique name of the site
-     * @return SiteStatus object or null if none found
-     */
-    public SiteStatus getSiteStatus (String siteName) {
-        Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-
-        SiteStatus siteStatus = null;
-        msoLogger.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 ();
-            }
-            msoLogger.debug ("getSiteStatus - Successfully: " + siteStatus);
-        }
-        return siteStatus;
-    }
-
-    /**
-     * Fetch a specific SiteStatus by SiteName.
-     *
-     * @param siteName The unique name of the site
-     * @param status The updated status of the Site
-     */
-    public void updateSiteStatus (String siteName, boolean status) {
-        Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-        session.beginTransaction ();
-
-        long startTime = System.currentTimeMillis ();
-        msoLogger.debug ("Request database - save 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 = (SiteStatus) query.uniqueResult ();
-            if (siteStatus == null) {
-                siteStatus = new SiteStatus ();
-                siteStatus.setSiteName (siteName);
-                siteStatus.setStatus (status);
-                //siteStatus.setCreated(new Timestamp(new Date().getTime()));
-                session.save (siteStatus);
-            } else {
-                siteStatus.setStatus(status);
-                //siteStatus.setCreated(new Timestamp(new Date().getTime()));
-                session.merge (siteStatus);
-            }
-            session.getTransaction ().commit ();
-        } finally {
-            session.close ();
-            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "updateSiteStatus", null);
-        }
-    }
-
-    /**
-     * get the operation progress
-     * <br>
-     * 
-     * @param serviceId the serviceId
-     * @param operationId the operation id 
-     * @return current progress of the operation
-     * @since ONAP Amsterdam Release
-     */
-    public OperationStatus getOperationStatus(String serviceId, String operationId) {
-
-        long startTime = System.currentTimeMillis();
-        msoLogger.debug("Execute query on infra active request table");
-
-        OperationStatus operStatus = null;
-        Session session = sessionFactoryRequestDB.getSessionFactory().openSession();
-        try {
-            session.beginTransaction();
-            String hql = "FROM OperationStatus WHERE SERVICE_ID = :service_id and OPERATION_ID = :operation_id";
-            Query query = session.createQuery(hql);
-            query.setParameter("service_id", serviceId);
-            query.setParameter("operation_id", operationId);
-            operStatus = (OperationStatus)query.uniqueResult();
-
-        } finally {
-            if(session != null && session.isOpen()) {
-                session.close();
-            }
-            msoLogger.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
-                    "Successfully", "RequestDB", "getOperationStatus", null);
-        }
-        return operStatus;
-    }
-    
-    /**
-     * get the operation progress
-     * <br>
-     * 
-     * @param serviceId the serviceId
-     * @return current progress of the operation
-     * @since ONAP Amsterdam Release
-     */
-    public OperationStatus getOperationStatusByServiceId(String serviceId) {
-
-        long startTime = System.currentTimeMillis();
-        msoLogger.debug("Execute query on infra active request table");
-
-        OperationStatus operStatus = null;
-        List<Object> list = null;
-        Session session = sessionFactoryRequestDB.getSessionFactory().openSession();
-        try {
-            session.beginTransaction();
-            String hql = "FROM OperationStatus WHERE SERVICE_ID = :service_id order by OPERATE_AT desc";
-            Query query = session.createQuery(hql);
-            query.setParameter("service_id", serviceId);
-            list = query.list();
-            if(list != null && list.size() >= 1) {
-            	operStatus = (OperationStatus) list.get(0);
-            }
-
-        } finally {
-            if(session != null && session.isOpen()) {
-                session.close();
-            }
-            msoLogger.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
-                    "Successfully", "RequestDB", "getOperationStatus", null);
-        }
-        return operStatus;
-    }
-    
-    /**
-     * get the operation progress
-     * <br>
-     * 
-     * @param serviceName the serviceName
-     * @return current progress of the operation
-     * @since ONAP Amsterdam Release
-     */
-    public OperationStatus getOperationStatusByServiceName(String serviceName) {
-
-        long startTime = System.currentTimeMillis();
-        msoLogger.debug("Execute query on infra active request table");
-
-        OperationStatus operStatus = null;
-        Session session = sessionFactoryRequestDB.getSessionFactory().openSession();
-        try {
-            session.beginTransaction();
-            String hql = "FROM OperationStatus WHERE SERVICE_NAME = :service_name";
-            Query query = session.createQuery(hql);
-            query.setParameter("service_name", serviceName);
-            operStatus = (OperationStatus)query.uniqueResult();
-
-        } finally {
-            if(session != null && session.isOpen()) {
-                session.close();
-            }
-            msoLogger.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
-                    "Successfully", "RequestDB", "getOperationStatus", null);
-        }
-        return operStatus;
-    }
-    
-    /**
-     * update the operation status
-     * <br>
-     * 
-     * @param operstatus the operation object
-     * @since ONAP Amsterdam Release
-     */
-    public void updateOperationStatus(OperationStatus operstatus) {
-        Session session = sessionFactoryRequestDB.getSessionFactory().openSession();
-        session.beginTransaction();
-
-        long startTime = System.currentTimeMillis();
-        msoLogger.debug("Request database - save Operation Status with service Id:" + operstatus.getServiceId()
-                + ", operationId:" + operstatus.getOperationId());
-        try {
-            String hql =
-                    "FROM OperationStatus WHERE SERVICE_ID = :service_id and OPERATION_ID = :operation_id";
-            Query query = session.createQuery(hql);
-            query.setParameter("service_id", operstatus.getServiceId());
-            query.setParameter("operation_id", operstatus.getOperationId());
-            OperationStatus exsitingStatus = (OperationStatus)query.uniqueResult();
-            if(exsitingStatus == null) {
-                session.save(operstatus);
-            } else {
-                session.merge(operstatus);
-            }
-            session.getTransaction().commit();
-        } finally {
-            session.close();
-            msoLogger.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
-                    "Successfully", "RequestDB", "updateOperationStatus", null);
-        }
-    }
-
-    /**
-     * get a operation status of a resource
-     * <br>
-     * 
-     * @param serviceId the service Id
-     * @param operationId the operation id
-     * @param resourceTemplateUUID the resource template uuid
-     * @return the progress status of a resource
-     * @since ONAP Amsterdam Release
-     */
-    public ResourceOperationStatus getResourceOperationStatus(String serviceId, String operationId,
-            String resourceTemplateUUID) {
-        long startTime = System.currentTimeMillis();
-        msoLogger.debug("Execute query on infra active request table");
-
-        ResourceOperationStatus operStatus = null;
-        Session session = sessionFactoryRequestDB.getSessionFactory().openSession();
-        try {
-            session.beginTransaction();
-            String hql =
-                    "FROM ResourceOperationStatus WHERE serviceId = :service_id and operationId = :operation_id and resourceTemplateUUID= :uuid";
-            Query query = session.createQuery(hql);
-            query.setParameter("service_id", serviceId);
-            query.setParameter("operation_id", operationId);
-            query.setParameter("uuid", resourceTemplateUUID);
-            operStatus = (ResourceOperationStatus)query.uniqueResult();
-
-        } finally {
-            if (session != null && session.isOpen ()) {
-                session.close ();
-            }
-            msoLogger.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
-                    "Successfully", "RequestDB", "getOperationStatus", null);
-        }
-        return operStatus;
-    }
-
-    /**
-     * update the resource operation
-     * <br>
-     * 
-     * @param operStatus the resource operation object
-     * @since ONAP Amsterdam Release
-     */
-    public void updateResOperStatus(ResourceOperationStatus operStatus) {
-        Session session = sessionFactoryRequestDB.getSessionFactory().openSession();
-        session.beginTransaction();
-
-        long startTime = System.currentTimeMillis();
-        msoLogger.debug("Request database - save Resource Operation Status with service Id:" + operStatus.getServiceId()
-                + ", operationId:" + operStatus.getOperationId() + ", resourceUUId:"
-                + operStatus.getResourceTemplateUUID());
-        try {
-            String hql =
-                    "FROM ResourceOperationStatus WHERE SERVICE_ID = :service_id and OPERATION_ID = :operation_id and RESOURCE_TEMPLATE_UUID = :res_uuid";
-            Query query = session.createQuery(hql);
-            query.setParameter("service_id", operStatus.getServiceId());
-            query.setParameter("operation_id", operStatus.getOperationId());
-            query.setParameter("res_uuid", operStatus.getResourceTemplateUUID());
-            ResourceOperationStatus exsitingStatus = (ResourceOperationStatus)query.uniqueResult();
-            if(exsitingStatus == null) {
-                session.save(operStatus);
-            } else {
-                session.merge(operStatus);
-            }
-            session.getTransaction().commit();
-        } finally {
-            session.close();
-            msoLogger.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
-                    "Successfully", "RequestDB", "updateResOperStatus", null);
-        }
-        updateOperationStatusBasedOnResourceStatus(operStatus);
-    }
-
-    /**
-     * update service operation status when a operation resource status updated
-     * <br>
-     * 
-     * @param operStatus the resource operation status
-     * @since ONAP Amsterdam Release
-     */
-    private void updateOperationStatusBasedOnResourceStatus(ResourceOperationStatus operStatus) {
-        Session session = sessionFactoryRequestDB.getSessionFactory().openSession();
-        session.beginTransaction();
-
-        long startTime = System.currentTimeMillis();
-        msoLogger.debug("Request database - query Resource Operation Status with service Id:"
-                + operStatus.getServiceId() + ", operationId:" + operStatus.getOperationId());
-        try {
-            // query all resources of the service
-            String hql = "FROM ResourceOperationStatus WHERE SERVICE_ID = :service_id and OPERATION_ID = :operation_id";
-            Query query = session.createQuery(hql);
-            query.setParameter("service_id", operStatus.getServiceId());
-            query.setParameter("operation_id", operStatus.getOperationId());
-            @SuppressWarnings("unchecked")
-            List<ResourceOperationStatus> lstResourceStatus = (List<ResourceOperationStatus>)query.list();
-            // count the total progress
-            int resourceCount = lstResourceStatus.size();
-            int progress = 0;
-            boolean isFinished = true;
-            for (ResourceOperationStatus lstResourceStatu : lstResourceStatus) {
-                progress = progress + Integer.valueOf(lstResourceStatu.getProgress()) / resourceCount;
-                if (Status.PROCESSING.equals(lstResourceStatu.getStatus())) {
-                    isFinished = false;
-                }
-            }
-            OperationStatus serviceOperStatus =
-                    getOperationStatus(operStatus.getServiceId(), operStatus.getOperationId());
-            progress = progress > 100 ? 100 : progress;
-            serviceOperStatus.setProgress(String.valueOf(progress));
-            serviceOperStatus.setOperationContent(operStatus.getStatusDescription());
-            // if current resource failed. service failed.
-            if(RequestsDbConstant.Status.ERROR.equals(operStatus.getStatus())) {
-                serviceOperStatus.setResult(RequestsDbConstant.Status.ERROR);
-                serviceOperStatus.setReason(operStatus.getStatusDescription());
-            } else if(isFinished) {
-                // if finished
-                serviceOperStatus.setResult(RequestsDbConstant.Status.FINISHED);
-                serviceOperStatus.setProgress(RequestsDbConstant.Progress.ONE_HUNDRED);
-            }
-            updateOperationStatus(serviceOperStatus);
-        } finally {
-            session.close();
-            msoLogger.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc,
-                    "Successfully", "RequestDB", "updateResOperStatus", null);
-        }
-    }
-
-	public InfraActiveRequests checkVnfIdStatus(String operationalEnvironmentId) {
-		long startTime = System.currentTimeMillis ();
-		msoLogger.debug ("Get Infra request from DB for OperationalEnvironmentId " + operationalEnvironmentId);
-
-		InfraActiveRequests ar = null;
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-
-		try {
-			session.beginTransaction ();
-			Query query = session.createQuery ("FROM InfraActiveRequests WHERE operationalEnvId = :operationalEnvId AND requestStatus != 'COMPLETE' AND action = 'create' ORDER BY startTime DESC");
-			query.setParameter ("operationalEnvId", operationalEnvironmentId);
-	            
-			@SuppressWarnings("unchecked")
-			List <InfraActiveRequests> results = query.list ();
-			if (!results.isEmpty ()) {
-				ar = results.get (0);
-			}
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-			}
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "checkDuplicateByVnfName", null);
-		}
-
-		return ar;
-	}
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDbSessionFactoryManager.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDbSessionFactoryManager.java
deleted file mode 100644
index 674867a..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDbSessionFactoryManager.java
+++ /dev/null
@@ -1,47 +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.requestsdb;
-
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-import org.openecomp.mso.logger.MessageEnum;
-import org.openecomp.mso.logger.MsoLogger;
-import java.net.URL;
-
-public class RequestsDbSessionFactoryManager extends AbstractSessionFactoryManager {
-
-    private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.APIH);
-
-    @Override
-    protected URL getHibernateConfigFile() {
-        try {
-
-            if ("MYSQL".equals (System.getProperty ("mso.db")) || "MARIADB".equals(System.getProperty("mso.db"))) {
-                return this.getClass().getClassLoader().getResource("hibernate-requests-core-mysql.cfg.xml");
-            } else {
-                   LOGGER.error (MessageEnum.APIH_DB_ACCESS_EXC_REASON, "DB Connection not specified to the JVM,choose either:-Dmso.db=MARIADB, -Dmso.db=MYSQL or -Dmso.container=AJSC", "", "", MsoLogger.ErrorCode.DataError , "DB Connection not specified to the JVM,choose either:-Dmso.db=MARIADB, -Dmso.db=MYSQL or -Dmso.container=AJSC");
-                   return null;
-               }
-           } catch (Exception ex) {
-               LOGGER.error (MessageEnum.APIH_DB_ACCESS_EXC_REASON, ex.getMessage (), "", "", MsoLogger.ErrorCode.DataError , "Problem in getting DB connection type", ex);
-               return null;
-           }
-
-    }
-}
\ No newline at end of file
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/SiteStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/SiteStatus.java
deleted file mode 100644
index 3685093..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/SiteStatus.java
+++ /dev/null
@@ -1,72 +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.requestsdb;
-
-
-import org.openecomp.mso.logger.MsoLogger;
-
-import java.sql.Timestamp;
-
-
-public class SiteStatus {
-
-    private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL);
-
-    private boolean status;
-    private String siteName = null;
-    private Timestamp created = null;
-
-    public SiteStatus() {
-    }
-
-    public Timestamp getCreated() {
-        return created;
-    }
-
-    public void setCreated(Timestamp created) {
-        this.created = created;
-    }
-
-    public String getSiteName() {
-        return siteName;
-    }
-
-    public void setSiteName(String siteName) {
-        this.siteName = siteName;
-    }
-
-    public void setStatus(boolean status) {
-        this.status = status;
-    }
-
-    public boolean getStatus() {
-        return status;
-    }
-
-    @Override
-    public String toString() {
-        return "SiteStatus{" +
-                "status=" + status +
-                ", siteName='" + siteName + '\'' +
-                ", created=" + created +
-                '}';
-    }
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogComponentDistributionStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogComponentDistributionStatus.java
deleted file mode 100644
index 8f2bda3..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogComponentDistributionStatus.java
+++ /dev/null
@@ -1,80 +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.requestsdb;
-
-import java.io.Serializable;
-import java.sql.Timestamp;
-
-public class WatchdogComponentDistributionStatus implements Serializable {
-
-
-	/**
-	 * Serialization id.
-	 */
-	private static final long serialVersionUID = -4344508954204488669L;
-	
-	private String distributionId = null;
-	private String componentName = null;
-	private String componentDistributionStatus = null;
-	private Timestamp createTime = null;
-	private Timestamp modifyTime = null;
-	
-	
-	public String getDistributionId() {
-		return distributionId;
-	}
-	
-	public void setDistributionId(String distributionId) {
-		this.distributionId = distributionId;
-	}
-	
-	public String getComponentName() {
-		return componentName;
-	}
-
-	public void setComponentName(String componentName) {
-		this.componentName = componentName;
-	}
-
-	public String getComponentDistributionStatus() {
-		return componentDistributionStatus;
-	}
-
-	public void setComponentDistributionStatus(String componentDistributionStatus) {
-		this.componentDistributionStatus = componentDistributionStatus;
-	}
-	
-	public Timestamp getCreateTime() {
-		return createTime;
-	}
-	public void setCreateTime(Timestamp createTime) {
-		this.createTime = createTime;
-	}
-	
-	public Timestamp getModifyTime() {
-		return modifyTime;
-	}
-	
-	public void setModifyTime(Timestamp modifyTime) {
-		this.modifyTime = modifyTime;
-	}
-
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogComponentDistributionStatusDb.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogComponentDistributionStatusDb.java
deleted file mode 100644
index 1011434..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogComponentDistributionStatusDb.java
+++ /dev/null
@@ -1,194 +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.requestsdb;
-
-
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-import org.openecomp.mso.requestsdb.RequestsDbSessionFactoryManager;
-import org.openecomp.mso.logger.MessageEnum;
-import org.openecomp.mso.logger.MsoLogger;
-
-public class WatchdogComponentDistributionStatusDb {
-
-    protected final AbstractSessionFactoryManager sessionFactoryRequestDB;
-    
-    protected static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
-
-    
-    protected static final String         DISTRIBUTION_ID				= "distributionId";
-    protected static final String         COMPONENT_NAME      			= "componentName";
-    protected static final String         COMPONENT_DISTRIBUTION_STATUS = "componentDistributionIdStatus";
-    protected static final String         CREATE_TIME         			= "startTime";
-    protected static final String         MODIFY_TIME         			= "modifyTime";
-    
-
-    public static WatchdogComponentDistributionStatusDb getInstance() {
-        return new WatchdogComponentDistributionStatusDb(new RequestsDbSessionFactoryManager ());
-    }
-
-    protected WatchdogComponentDistributionStatusDb (AbstractSessionFactoryManager sessionFactoryRequest) {
-        sessionFactoryRequestDB = sessionFactoryRequest;
-    }
-
-
-    /**
-     * Insert into watchdog_per_component_distribution_status.
-     *
-     * @param distributionId
-     * @param componentName
-     * @param componentDistributionStatus
-     * @return void
-     */
-	public void insertWatchdogComponentDistributionStatus(String distributionId, String componentName, String componentDistributionStatus ) {
-		long startTime = System.currentTimeMillis ();
-		Timestamp startTimeStamp = new Timestamp (System.currentTimeMillis());
-		msoLogger.debug ("Insert into WatchdogPerComponentDistributionStatus for DistributionId: " + distributionId + " ComponentName: " + componentName + " and ComponentDistributionStatus: " + componentDistributionStatus);
-		
-		List<WatchdogComponentDistributionStatus> componentList = getWatchdogComponentDistributionStatus(distributionId, componentName);
-		
-		if((componentList == null) || componentList.isEmpty())
-		{
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		WatchdogComponentDistributionStatus wdcds = new WatchdogComponentDistributionStatus ();
-	
-		try {
-			session.beginTransaction ();
-		
-			wdcds.setDistributionId (distributionId);
-			wdcds.setComponentName (componentName);
-			wdcds.setComponentDistributionStatus (componentDistributionStatus);
-			wdcds.setCreateTime (startTimeStamp);
-			Timestamp modifyTimeStamp = new Timestamp (System.currentTimeMillis());
-			wdcds.setModifyTime (modifyTimeStamp);
-		
-			msoLogger.debug ("About to insert a record into WatchdogPerComponentDistributionStatus");
-		
-			session.save (wdcds);
-			session.getTransaction ().commit ();
-		} catch (Exception e) {
-			msoLogger.error (MessageEnum.APIH_DB_INSERT_EXC, "", "", MsoLogger.ErrorCode.SchemaError, "Exception in insertWatchdogComponentDistributionStatus", e);
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, e.getMessage (), "WatchdogComponentDistributionStatusDB", "saveRequest", null);
-			if (session != null) {
-				session.close ();
-			}
-			// throw an Exception in the event of a DB insert failure so that the calling routine can exit
-			throw e;
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-		}
-		msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "WatchdogComponentDistributionStatusDB", "insertWatchdogComponentDistributionStatus", null);
-	}
-	}
-		
-  }
-	
-    /**
-     * Retrieve records from WatchdogComponentDistributionStatus.
-     *
-     * @param distributionId
-     * @return WatchdogComponentDistributionStatus
-     */
-	 @SuppressWarnings("unchecked")
-	 public List<WatchdogComponentDistributionStatus> getWatchdogComponentDistributionStatus(String distributionId) {
-		 Session session = sessionFactoryRequestDB.getSessionFactory().openSession();
-		 session.beginTransaction();
-
-		 List<WatchdogComponentDistributionStatus> results = new ArrayList<WatchdogComponentDistributionStatus>();
-		 msoLogger.debug("Request database - getWatchdogComponentDistributionStatus:" + distributionId);
-		 try {
-			 String hql = "FROM WatchdogComponentDistributionStatus WHERE distributionId = :distributionId";
-			 Query query = session.createQuery(hql);
-			 query.setParameter("distributionId", distributionId);
-			 results = query.list();
-		 } finally {
-			 if (session != null && session.isOpen ()) {
-				 session.close ();
-			 }
-			 msoLogger.debug ("getWatchdogComponentDistributionStatus - Successfully");
-		 }
-		 return results;
-	 }
-	 
-	    /**
-	     * Retrieve records from WatchdogComponentDistributionStatus.
-	     *
-	     * @param distributionId
-	     * @param componentName
-	     * @return WatchdogComponentDistributionStatus
-	     */
-		 @SuppressWarnings("unchecked")
-		 public List<WatchdogComponentDistributionStatus> getWatchdogComponentDistributionStatus(String distributionId, String componentName) {
-			 Session session = sessionFactoryRequestDB.getSessionFactory().openSession();
-			 session.beginTransaction();
-
-			 List<WatchdogComponentDistributionStatus> results = new ArrayList<WatchdogComponentDistributionStatus>();
-			 msoLogger.debug("Request database - getWatchdogComponentDistributionStatus:" + distributionId + " and componentName:" + componentName);
-			 try {
-				 String hql = "FROM WatchdogComponentDistributionStatus WHERE distributionId = :distributionId AND componentName = :componentName";
-				 Query query = session.createQuery(hql);
-				 query.setParameter("distributionId", distributionId);
-				 query.setParameter("componentName", componentName);
-				 results = query.list();
-			 } finally {
-				 if (session != null && session.isOpen ()) {
-					 session.close ();
-				 }
-				 msoLogger.debug ("getWatchdogComponentDistributionStatus by ComponentName - Successfully");
-			 }
-			 return results;
-		 }
-		 
-		   /**
-		     * Retrieve records from getWatchdogComponentNames.
-		     *
-		     * @param distributionId
-		     * @return String
-		     */
-		 	@SuppressWarnings("unchecked")
-		 	public List<String> getWatchdogComponentNames(String distributionId) {
-				 Session session = sessionFactoryRequestDB.getSessionFactory().openSession();
-				 session.beginTransaction();
-
-				 List<String> results = new ArrayList<String>();
-				 msoLogger.debug("Request database - getWatchdogComponentNames:" + distributionId);
-				 try {
-					 String hql = "Select componentName FROM WatchdogComponentDistributionStatus WHERE distributionId = :distributionId";
-					 Query query = session.createQuery(hql);
-					 query.setParameter("distributionId", distributionId);
-					 results = query.list();
-				 } finally {
-					 if (session != null && session.isOpen ()) {
-						 session.close ();
-					 }
-					 msoLogger.debug ("getWatchdogComponentNames - Successfully");
-				 }
-				 return results;
-			 }
-	
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogDistributionStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogDistributionStatus.java
deleted file mode 100644
index deb2b68..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogDistributionStatus.java
+++ /dev/null
@@ -1,71 +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.requestsdb;
-
-import java.io.Serializable;
-import java.sql.Timestamp;
-
-public class WatchdogDistributionStatus implements Serializable {
-
-	/**
-	 * Serialization id.
-	 */
-	private static final long serialVersionUID = -4449711060885719079L;
-
-
-	private String distributionId = null;
-	private String distributionIdStatus = null;
-	private Timestamp createTime = null;
-	private Timestamp modifyTime = null;
-	
-	
-	public String getDistributionId() {
-		return distributionId;
-	}
-	
-	public void setDistributionId(String distributionId) {
-		this.distributionId = distributionId;
-	}
-	
-	public String getDistributionIdStatus() {
-		return distributionIdStatus;
-	}
-	
-	public void setDistributionIdStatus(String distributionIdStatus) {
-		this.distributionIdStatus = distributionIdStatus;
-	}
-	
-	public Timestamp getCreateTime() {
-		return createTime;
-	}
-	public void setCreateTime(Timestamp createTime) {
-		this.createTime = createTime;
-	}
-	
-	public Timestamp getModifyTime() {
-		return modifyTime;
-	}
-	
-	public void setModifyTime(Timestamp modifyTime) {
-		this.modifyTime = modifyTime;
-	}
-	
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogDistributionStatusDb.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogDistributionStatusDb.java
deleted file mode 100644
index f1fab18..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogDistributionStatusDb.java
+++ /dev/null
@@ -1,197 +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.requestsdb;
-
-
-import java.sql.Timestamp;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-import org.openecomp.mso.logger.MessageEnum;
-import org.openecomp.mso.logger.MsoLogger;
-
-public class WatchdogDistributionStatusDb {
-
-    protected final AbstractSessionFactoryManager sessionFactoryRequestDB;
-    
-    protected static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
-
-    
-    protected static final String         DISTRIBUTION_ID               = "distributionId";
-    protected static final String         DISTRIBUTION_ID_STATUS  		= "distributionIdStatus";
-    protected static final String         CREATE_TIME                 	= "startTime";
-    protected static final String         MODIFY_TIME                 	= "modifyTime";
-    
-
-    public static WatchdogDistributionStatusDb getInstance() {
-        return new WatchdogDistributionStatusDb(new RequestsDbSessionFactoryManager ());
-    }
-
-    protected WatchdogDistributionStatusDb (AbstractSessionFactoryManager sessionFactoryRequest) {
-        sessionFactoryRequestDB = sessionFactoryRequest;
-    }
-
-
-    /**
-     * Insert into WATCHDOG_DISTRIBUTIONID_STATUS.
-     *
-     * @param distributionId
-     * @return void
-     */
-	public void insertWatchdogDistributionId(String distributionId ) {
-		long startTime = System.currentTimeMillis ();
-		Timestamp startTimeStamp = new Timestamp (System.currentTimeMillis());
-		msoLogger.debug ("Insert into WatchdogDistributionStatus - DistributionId: " + distributionId);
-		
-		if(getWatchdogDistributionId(distributionId) == null){
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		WatchdogDistributionStatus wds = new WatchdogDistributionStatus ();
-	
-		try {
-			session.beginTransaction ();
-		
-			wds.setDistributionId (distributionId);
-			wds.setCreateTime (startTimeStamp);
-			Timestamp modifyTimeStamp = new Timestamp (System.currentTimeMillis());
-			wds.setModifyTime (modifyTimeStamp);
-		
-			msoLogger.debug ("About to insert a record into WatchdogDistributionStatus ");
-		
-			session.save (wds);
-			session.getTransaction ().commit ();
-		} catch (Exception e) {
-			msoLogger.error (MessageEnum.APIH_DB_INSERT_EXC, "", "", MsoLogger.ErrorCode.SchemaError, "Exception in insertWatchdogDistributionId", e);
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, e.getMessage (), "WatchdogDistributionStatusDB", "saveRequest", null);
-			if (session != null) {
-				session.close ();
-			}
-			// throw an Exception in the event of a DB insert failure so that the calling routine can exit
-			throw e;
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-			}
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "WatchdogDistributionStatusDB", "insertWatchdogDistributionId", null);
-		}
-		
-		}
-		
-	}
-	
-	
-    /**
-     * Update WATCHDOG_DISTRIBUTIONID_STATUS with new status for a given distributionid.
-     *
-     * @param distributionId
-     * @param distributionStatus
-     * @return void
-     */
-	public void updateWatchdogDistributionIdStatus(String distributionId, String distributionIdStatus ) {
-		long startTime = System.currentTimeMillis ();
-		msoLogger.debug ("Update WatchdogDistributionStatus status with distributionId: " + distributionId + " and distributionStatus: " + distributionIdStatus );
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-	
-		try {
-			session.beginTransaction ();
-			Query query = session.createQuery ("update WatchdogDistributionStatus set distributionIdStatus = :distributionIdStatus where "
-					+ "distributionId = :distributionId ");
-
-			query.setParameter ("distributionId", distributionId);
-			query.setParameter ("distributionIdStatus", distributionIdStatus);
-
-			//Timestamp modifyTimeStamp = new Timestamp (System.currentTimeMillis());
-			//query.setParameter ("modifyTime", modifyTimeStamp);
-			query.executeUpdate ();
-			session.getTransaction ().commit ();			
-			
-		} catch (Exception e) {
-			msoLogger.error (MessageEnum.APIH_DB_INSERT_EXC, "", "", MsoLogger.ErrorCode.SchemaError, "Exception in updateWatchdogDistributionStatus", e);
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, e.getMessage (), "WatchdogDistributionStatusDB", "saveRequest", null);
-			if (session != null) {
-				session.close ();
-			}
-			// throw an Exception in the event of a DB insert failure so that the calling routine can exit
-			throw e;
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-			}
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "WatchdogDistributionStatusDB", "insertWatchdogDistributionStatus", null);
-		}
-	}
-	
-    /**
-     * Retrieve records from WatchdogDistributionIdStatus.
-     *
-     * @param distributionId
-     * @return WatchdogDistributionIdStatus
-     */
-	public String getWatchdogDistributionIdStatus(String distributionId) {
-		long startTime = System.currentTimeMillis ();
-		msoLogger.debug ("Retrieve records from WatchdogDistributionStatus for distributionId : " + distributionId );
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		String distributionStatus = null;
-		try {
-			session.beginTransaction ();
-			Query query = session.createQuery ("SELECT distributionIdStatus FROM WatchdogDistributionStatus WHERE distributionId = :distributionId ");
-			query.setParameter ("distributionId", distributionId);
-			distributionStatus = (String) query.uniqueResult();
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-			}
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, 
-										"Successfully", "WatchdogDistributionStatusDB", "getWatchdogDistributionIdStatus", null);
-		}
-		return distributionStatus;
-	}
-	
-    /**
-     * Retrieve records from WatchdogDistributionId.
-     *
-     * @param distributionId
-     * @return WatchdogDistributionIdStatus
-     */
-	public String getWatchdogDistributionId(String distributionId) {
-		long startTime = System.currentTimeMillis ();
-		msoLogger.debug ("Retrieve distributionId from WatchdogDistributionStatus for distributionId : " + distributionId );
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		String existingDistributionId = null;
-		try {
-			session.beginTransaction ();
-			Query query = session.createQuery ("SELECT distributionId FROM WatchdogDistributionStatus WHERE distributionId = :distributionId ");
-			query.setParameter ("distributionId", distributionId);
-			existingDistributionId = (String) query.uniqueResult();
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-			}
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, 
-										"Successfully", "WatchdogDistributionStatusDB", "getWatchdogDistributionIdStatus", null);
-		}
-		return existingDistributionId;
-	}
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogServiceModVerIdLookup.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogServiceModVerIdLookup.java
deleted file mode 100644
index ced4f4f..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogServiceModVerIdLookup.java
+++ /dev/null
@@ -1,61 +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.requestsdb;
-
-import java.io.Serializable;
-import java.sql.Timestamp;
-
-public class WatchdogServiceModVerIdLookup implements Serializable {
-
-	/**
-	 * Serialization id.
-	 */
-	private static final long serialVersionUID = 7783869906430250355L;
-	
-	private String distributionId = null;
-	private String serviceModelVersionId = null;
-	private Timestamp createTime = null;
-	
-	
-	public String getDistributionId() {
-		return distributionId;
-	}
-	
-	public void setDistributionId(String distributionId) {
-		this.distributionId = distributionId;
-	}
-	
-	public String getServiceModelVersionId() {
-		return serviceModelVersionId;
-	}
-
-	public void setServiceModelVersionId(String serviceModelVersionId) {
-		this.serviceModelVersionId = serviceModelVersionId;
-	}
-	
-	public Timestamp getCreateTime() {
-		return createTime;
-	}
-	public void setCreateTime(Timestamp createTime) {
-		this.createTime = createTime;
-	}
-
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogServiceModVerIdLookupDb.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogServiceModVerIdLookupDb.java
deleted file mode 100644
index f081bbf..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/WatchdogServiceModVerIdLookupDb.java
+++ /dev/null
@@ -1,124 +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.requestsdb;
-
-
-import java.sql.Timestamp;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-import org.openecomp.mso.logger.MessageEnum;
-import org.openecomp.mso.logger.MsoLogger;
-
-public class WatchdogServiceModVerIdLookupDb {
-
-    protected final AbstractSessionFactoryManager sessionFactoryRequestDB;
-    
-    protected static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
-
-    protected static final String         DISTRIBUTION_ID               = "distributionId";
-    protected static final String         SERVICE_MODEL_VERSION_ID  	= "serviceModelVersionId";
-    protected static final String         CREATE_TIME                 	= "startTime";
-    
-
-    public static WatchdogServiceModVerIdLookupDb getInstance() {
-        return new WatchdogServiceModVerIdLookupDb(new RequestsDbSessionFactoryManager ());
-    }
-
-    protected WatchdogServiceModVerIdLookupDb (AbstractSessionFactoryManager sessionFactoryRequest) {
-        sessionFactoryRequestDB = sessionFactoryRequest;
-    }
-
-
-    /**
-     * Insert into WATCHDOG_SERVICE_MOD_VER_ID_LOOKUP.
-     *
-     * @param distributionId
-     * @param serviceModelVersionId
-     * @return void
-     */
-	public void insertWatchdogServiceModVerIdLookup(String distributionId, String serviceModelVersionId ) {
-		long startTime = System.currentTimeMillis ();
-		Timestamp startTimeStamp = new Timestamp (System.currentTimeMillis());
-		msoLogger.debug ("Insert into WatchdogServiceModVerIdLookup for DistributionId: " + distributionId + " and ServiceModelVersionId: " + serviceModelVersionId  );
-		
-		if(getWatchdogServiceModVerId(distributionId) == null){
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		WatchdogServiceModVerIdLookup wdsm = new WatchdogServiceModVerIdLookup ();
-	
-		try {
-			session.beginTransaction ();
-		
-			wdsm.setDistributionId (distributionId);
-			wdsm.setServiceModelVersionId (serviceModelVersionId);
-			wdsm.setCreateTime (startTimeStamp);
-		
-			msoLogger.debug ("About to insert a record into WatchdogServiceModVerIdLookup");
-		
-			session.save (wdsm);
-			session.getTransaction ().commit ();
-		} catch (Exception e) {
-			msoLogger.error (MessageEnum.APIH_DB_INSERT_EXC, "", "", MsoLogger.ErrorCode.SchemaError, "Exception in insertWatchdogServiceModVerIdLookup", e);
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, e.getMessage (), "WatchdogServiceModVerIdLookupDB", "saveRequest", null);
-			if (session != null) {
-				session.close ();
-			}
-			// throw an Exception in the event of a DB insert failure so that the calling routine can exit
-			throw e;
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-		}
-		msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "WatchdogServiceModVerIdLookupDB", "insertWatchdogServiceModVerIdLookup", null);
-		}
-	}
-		
-  }
-	
-    /**
-     * Retrieve from WATCHDOG_SERVICE_MOD_VER_ID_LOOKUP.
-     *
-     * @param distributionId
-     * @return WatchdogServiceModVerIdLookup
-     */
-	public String getWatchdogServiceModVerId(String distributionId) {
-		long startTime = System.currentTimeMillis ();
-		msoLogger.debug ("Retrieve WatchdogServiceModVerIdLookup with distributionId: " + distributionId );
-
-		Session session = sessionFactoryRequestDB.getSessionFactory ().openSession ();
-		String serviceModelVersionId = null;
-		try {
-			session.beginTransaction ();
-			Query query = session.createQuery ("Select serviceModelVersionId FROM WatchdogServiceModVerIdLookup WHERE distributionId = :distributionId ");
-			query.setParameter ("distributionId", distributionId);
-			serviceModelVersionId = (String) query.uniqueResult();
-		} finally {
-			if (session != null && session.isOpen ()) {
-				session.close ();
-			}
-			msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, 
-										"Successfully", "WatchdogServiceModVerIdLookupDB", "getWatchdogServiceModVerId", null);
-		}
-		return serviceModelVersionId;
-	}
-}
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/InfraActiveRequests.hbm.xml b/mso-api-handlers/mso-requests-db/src/main/resources/InfraActiveRequests.hbm.xml
deleted file mode 100644
index 79ead1d..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/resources/InfraActiveRequests.hbm.xml
+++ /dev/null
@@ -1,161 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  ============LICENSE_START=======================================================
-  ECOMP MSO
-  ================================================================================
-  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=========================================================
-  -->
-
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
-<!-- Generated Jul 27, 2015 3:05:00 PM by Hibernate Tools 3.4.0.CR1 -->
-<hibernate-mapping>
-    <class name="org.openecomp.mso.requestsdb.InfraActiveRequests" table="INFRA_ACTIVE_REQUESTS">
-        <id name="requestId" type="string">
-            <column name="REQUEST_ID" length="45"/>
-            <generator class="assigned"/>
-        </id>
-        <property name="clientRequestId" type="string" unique="true">
-            <column name="CLIENT_REQUEST_ID" length="45" unique="true"/>
-        </property>
-        <property name="action" type="string">
-            <column name="ACTION" length="45" not-null="true"/>
-        </property>
-        <property name="requestStatus" type="string">
-            <column name="REQUEST_STATUS" length="20"/>
-        </property>
-        <property name="statusMessage" type="string">
-            <column name="STATUS_MESSAGE" length="2000"/>
-        </property>
-        <property name="progress" type="java.lang.Long">
-            <column name="PROGRESS" precision="11" scale="0"/>
-        </property>
-        <property name="startTime" type="timestamp">
-            <column name="START_TIME"/>
-        </property>
-        <property name="endTime" type="timestamp">
-            <column name="END_TIME"/>
-        </property>
-        <property name="source" type="string">
-            <column name="SOURCE" length="45"/>
-        </property>
-        <property name="vnfId" type="string">
-            <column name="VNF_ID" length="45"/>
-        </property>
-        <property name="vnfName" type="string">
-            <column name="VNF_NAME" length="80"/>
-        </property>
-        <property name="vnfType" type="string">
-            <column name="VNF_TYPE" length="200"/>
-        </property>
-        <property name="serviceType" type="string">
-            <column name="SERVICE_TYPE" length="45"/>
-        </property>
-        <property name="aicNodeClli" type="string">
-            <column name="AIC_NODE_CLLI" length="11"/>
-        </property>
-        <property name="tenantId" type="string">
-            <column name="TENANT_ID" length="45"/>
-        </property>
-        <property name="provStatus" type="string">
-            <column name="PROV_STATUS" length="20"/>
-        </property>
-        <property name="vnfParams" type="text">
-            <column name="VNF_PARAMS"/>
-        </property>
-        <property name="vnfOutputs" type="text">
-            <column name="VNF_OUTPUTS"/>
-        </property>
-        <property name="requestBody" type="text">
-            <column name="REQUEST_BODY"/>
-        </property>
-        <property name="responseBody" type="text">
-            <column name="RESPONSE_BODY"/>
-        </property>
-        <property name="lastModifiedBy" type="string">
-            <column name="LAST_MODIFIED_BY" length="50"/>
-        </property>
-        <property name="modifyTime" type="timestamp">
-            <column name="MODIFY_TIME"/>
-        </property>
-        <property name="requestType" type="string">
-            <column name="REQUEST_TYPE" length="20"/>
-        </property>
-        <property name="volumeGroupId" type="string">
-            <column name="VOLUME_GROUP_ID" length="45"/>
-        </property>
-        <property name="volumeGroupName" type="string">
-            <column name="VOLUME_GROUP_NAME" length="45"/>
-        </property>
-        <property name="vfModuleId" type="string">
-            <column name="VF_MODULE_ID" length="45"/>
-        </property>
-        <property name="vfModuleName" type="string">
-            <column name="VF_MODULE_NAME" length="200"/>
-        </property>
-        <property name="vfModuleModelName" type="string">
-            <column name="VF_MODULE_MODEL_NAME" length="200"/>
-        </property>
-         <property name="aaiServiceId" type="string">
-            <column name="AAI_SERVICE_ID" length="50"/>
-        </property>
-        <property name="aicCloudRegion" type="string">
-            <column name="AIC_CLOUD_REGION" length="200"/>
-        </property>
-        <property name="callBackUrl" type="string">
-            <column name="CALLBACK_URL" length="200"/>
-        </property>
-        <property name="correlator" type="string">
-            <column name="CORRELATOR" length="80"/>
-        </property>
-        <property name="serviceInstanceId" type="string">
-            <column name="SERVICE_INSTANCE_ID" length="45"/>
-        </property>
-        <property name="serviceInstanceName" type="string">
-            <column name="SERVICE_INSTANCE_NAME" length="80"/>
-        </property>
-        <property name="requestScope" type="string">
-            <column name="REQUEST_SCOPE" length="45"/>
-        </property>
-        <property name="requestAction" type="string">
-            <column name="REQUEST_ACTION" length="45" not-null="true"/>
-        </property>
-        <property name="networkId" type="string">
-            <column name="NETWORK_ID" length="45"/>
-        </property>
-        <property name="networkName" type="string">
-            <column name="NETWORK_NAME" length="80"/>
-        </property>
-        <property name="networkType" type="string">
-            <column name="NETWORK_TYPE" length="80"/>
-        </property>
-        <property name="requestorId" type="string">
-            <column name="REQUESTOR_ID" length="80"/>
-        </property>
-        <property name="configurationId" type="string">
-            <column name="CONFIGURATION_ID" length="45"/>
-        </property>
-        <property name="configurationName" type="string">
-            <column name="CONFIGURATION_NAME" length="200"/>
-        </property>
-         <property name="operationalEnvId" type="string">
-            <column name="OPERATIONAL_ENV_ID" length="45"/>
-        </property>
-        <property name="operationalEnvName" type="string">
-            <column name="OPERATIONAL_ENV_NAME" length="200"/>
-        </property>
-    </class>
-</hibernate-mapping>
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/OperationStatus.hbm.xml b/mso-api-handlers/mso-requests-db/src/main/resources/OperationStatus.hbm.xml
deleted file mode 100644
index 44094a1..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/resources/OperationStatus.hbm.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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=========================================================
- */
-  -->
-
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping package="org.openecomp.mso.requestsdb">
-	<class name="OperationStatus" table="OPERATION_STATUS">
-		<meta attribute="class-description">
-			This class describes a operation status
-		</meta>
-        <composite-id>  
-             <key-property name="serviceId" type="string" column="SERVICE_ID"/>  
-             <key-property name="operationId" column="OPERATION_ID" type="string" length="256"/>  
-        </composite-id> 
-		<property name="serviceName" column="SERVICE_NAME" type="string" length="256"/>
-		<property name="operation" column="OPERATION_TYPE" type="string" length="256"/>		
-		<property name="userId" column="USER_ID" type="string" length="256"/>		
-		<property name="result" column="RESULT" type="string" length="256"/>
-		<property name="operationContent" column="OPERATION_CONTENT" type="string" length="256"/>
-		<property name="progress" column="PROGRESS" type="string" length="256"/>
-		<property name="reason" column="REASON" type="string" length="256"/>
-		<property name="operateAt" type="timestamp" generated="insert" insert="false" update="false" not-null="true">
-          <column name="OPERATE_AT" default="CURRENT_TIMESTAMP"/>
-        </property>
-		<property name="finishedAt" column="FINISHED_AT" type="timestamp" generated="always" insert="false" update="false"/>	
-	</class>
-</hibernate-mapping>
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/OperationalEnvDistributionStatus.hbm.xml b/mso-api-handlers/mso-requests-db/src/main/resources/OperationalEnvDistributionStatus.hbm.xml
deleted file mode 100644
index 08e60b2..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/resources/OperationalEnvDistributionStatus.hbm.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  ============LICENSE_START=======================================================
-  ECOMP MSO
-  ================================================================================
-  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=========================================================
-  -->
-
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<!-- Generated Jul 27, 2015 3:05:00 PM by Hibernate Tools 3.4.0.CR1 -->
-<hibernate-mapping>
-    <class name="org.openecomp.mso.requestsdb.OperationalEnvDistributionStatus" table="ACTIVATE_OPERATIONAL_ENV_PER_DISTRIBUTIONID_STATUS">
-      
-        <id name="distributionId" type="string">
-        	<column name="DISTRIBUTION_ID" length="45"/>
-        	<generator class="assigned"/>
-		</id>
-        
-		<property name="operationalEnvId" type="string">
-            <column name="OPERATIONAL_ENV_ID" length="45"/>
-        </property>
-        <property name="serviceModelVersionId" type="string">
-            <column name="SERVICE_MODEL_VERSION_ID" length="45"/>
-        </property>
-        <property name="distributionIdStatus" type="string">
-            <column name="DISTRIBUTION_ID_STATUS" length="45" />
-        </property>
-        <property name="distributionIdErrorReason" type="string">
-            <column name="DISTRIBUTION_ID_ERROR_REASON" length="250" />
-        </property>
-        <property name="requestId" type="string">
-            <column name="REQUEST_ID" length="45" />
-        </property>
-        <property name="createTime" type="timestamp">
-            <column name="CREATE_TIME"/>
-        </property>
-        <property name="modifyTime" type="timestamp">
-            <column name="MODIFY_TIME"/>
-        </property>
-
-    </class>
-</hibernate-mapping>
\ No newline at end of file
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/OperationalEnvServiceModelStatus.hbm.xml b/mso-api-handlers/mso-requests-db/src/main/resources/OperationalEnvServiceModelStatus.hbm.xml
deleted file mode 100644
index 99a6232..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/resources/OperationalEnvServiceModelStatus.hbm.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  ============LICENSE_START=======================================================
-  ECOMP MSO
-  ================================================================================
-  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=========================================================
-  -->
-
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<!-- Generated Jul 27, 2015 3:05:00 PM by Hibernate Tools 3.4.0.CR1 -->
-<hibernate-mapping>
-    <class name="org.openecomp.mso.requestsdb.OperationalEnvServiceModelStatus" table="ACTIVATE_OPERATIONAL_ENV_SERVICE_MODEL_DISTRIBUTION_STATUS">
-      
-        <composite-id>
-			<key-property name="operationalEnvId" 	column="OPERATIONAL_ENV_ID" 		type="string" 	length="45" />
-			<key-property name="serviceModelVersionId" 	column="SERVICE_MODEL_VERSION_ID" 	type="string" 	length="45"/>
-			<key-property name="requestId" 	column="REQUEST_ID" 	type="string" 	length="45"/>
-		</composite-id> 
-		
-        <property name="serviceModelVersionDistrStatus" type="string">
-            <column name="SERVICE_MOD_VER_FINAL_DISTR_STATUS" length="45"/>
-        </property>
-        <property name="recoveryAction" type="string">
-            <column name="RECOVERY_ACTION" length="30" />
-        </property>
-        <property name="retryCount" type="integer">
-            <column name="RETRY_COUNT_LEFT"/>
-        </property>
-        <property name="workloadContext" type="string">
-            <column name="WORKLOAD_CONTEXT" length="80" />
-        </property>
-        <property name="createTime" type="timestamp">
-            <column name="CREATE_TIME"/>
-        </property>
-        <property name="modifyTime" type="timestamp">
-            <column name="MODIFY_TIME"/>
-        </property>
-
-    </class>
-</hibernate-mapping>
\ No newline at end of file
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/ResourceOperationStatus.hbm.xml b/mso-api-handlers/mso-requests-db/src/main/resources/ResourceOperationStatus.hbm.xml
deleted file mode 100644
index 22d1474..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/resources/ResourceOperationStatus.hbm.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 Huawei Technologies Co., Ltd. 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=========================================================
- */
-  -->
-
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping package="org.openecomp.mso.requestsdb">
-	<class name="ResourceOperationStatus" table="RESOURCE_OPERATION_STATUS">
-		<meta attribute="class-description">
-			This class describes a progress status
-		</meta>
-        <composite-id>  
-             <key-property name="serviceId" type="string" column="SERVICE_ID"/>  
-             <key-property name="operationId" type="string" column="OPERATION_ID" length="256"/> 
-             <key-property name="resourceTemplateUUID" type="string" column="RESOURCE_TEMPLATE_UUID"/>   
-        </composite-id>         
-        <property name="operType" column="OPER_TYPE" type="string" length="256"/>
-        <property name="resourceInstanceID" column="RESOURCE_INSTANCE_ID" type="string" length="256"/>
-		<property name="jobId" column="JOB_ID" type="string" length="256"/>
-		<property name="status" column="STATUS" type="string" length="256"/>
-		<property name="progress" column="PROGRESS" type="string" length="256"/>
-		<property name="errorCode" column="ERROR_CODE" type="string" length="256"/>
-		<property name="statusDescription" column="STATUS_DESCRIPOTION" type="string" length="256"/>	
-	</class>
-</hibernate-mapping>
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/SiteStatus.hbm.xml b/mso-api-handlers/mso-requests-db/src/main/resources/SiteStatus.hbm.xml
deleted file mode 100644
index f755ad0..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/resources/SiteStatus.hbm.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ============LICENSE_START=======================================================
-  ECOMP MSO
-  ================================================================================
-  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=========================================================
-  -->
-
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping package="org.openecomp.mso.requestsdb">
-	<class name="SiteStatus" table="SITE_STATUS">
-		<meta attribute="class-description">
-			This class describes a Site Status
-		</meta>
-		
-		<id name="siteName" type="string" column="SITE_NAME"/>
-
-		<property name="status" column="STATUS" type="boolean" length="256"/>
-		<property name="created" type="timestamp" generated="insert" insert="false" update="false" not-null="true">
-          <column name="CREATION_TIMESTAMP" default="CURRENT_TIMESTAMP"/>
-        </property>
-	</class>
-</hibernate-mapping>
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/WatchdogComponentDistributionStatus.hbm.xml b/mso-api-handlers/mso-requests-db/src/main/resources/WatchdogComponentDistributionStatus.hbm.xml
deleted file mode 100644
index ea66153..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/resources/WatchdogComponentDistributionStatus.hbm.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  ============LICENSE_START=======================================================
-  ECOMP MSO
-  ================================================================================
-  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=========================================================
-  -->
-
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<!-- Generated Jul 27, 2015 3:05:00 PM by Hibernate Tools 3.4.0.CR1 -->
-<hibernate-mapping>
-    <class name="org.openecomp.mso.requestsdb.WatchdogComponentDistributionStatus" table="WATCHDOG_PER_COMPONENT_DISTRIBUTION_STATUS">
-      
-        <composite-id>
-			<key-property name="distributionId" 	column="DISTRIBUTION_ID" 		type="string" 	length="45" />
-			<key-property name="componentName" 	column="COMPONENT_NAME" 	type="string" 	length="45"/>
-		</composite-id> 
-        
-        <property name="componentDistributionStatus" type="string">
-            <column name="COMPONENT_DISTRIBUTION_STATUS" length="45" />
-        </property>
-        
-        <property name="createTime" type="timestamp">
-            <column name="CREATE_TIME"/>
-        </property>
-        
-        <property name="modifyTime" type="timestamp">
-            <column name="MODIFY_TIME"/>
-        </property>
-
-    </class>
-</hibernate-mapping>
\ No newline at end of file
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/WatchdogDistributionStatus.hbm.xml b/mso-api-handlers/mso-requests-db/src/main/resources/WatchdogDistributionStatus.hbm.xml
deleted file mode 100644
index 2da3071..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/resources/WatchdogDistributionStatus.hbm.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  ============LICENSE_START=======================================================
-  ECOMP MSO
-  ================================================================================
-  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=========================================================
-  -->
-
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<!-- Generated Jul 27, 2015 3:05:00 PM by Hibernate Tools 3.4.0.CR1 -->
-<hibernate-mapping>
-    <class name="org.openecomp.mso.requestsdb.WatchdogDistributionStatus" table="WATCHDOG_DISTRIBUTIONID_STATUS">
-      
-        <id name="distributionId" type="string">
-        	<column name="DISTRIBUTION_ID" length="45"/>
-        	<generator class="assigned"/>
-		</id>
-        
-        <property name="distributionIdStatus" type="string">
-            <column name="DISTRIBUTION_ID_STATUS" length="45" />
-        </property>
-        
-        <property name="createTime" type="timestamp">
-            <column name="CREATE_TIME"/>
-        </property>
-        
-        <property name="modifyTime" type="timestamp">
-            <column name="MODIFY_TIME"/>
-        </property>
-
-    </class>
-</hibernate-mapping>
\ No newline at end of file
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/WatchdogServiceModVerIdLookup.hbm.xml b/mso-api-handlers/mso-requests-db/src/main/resources/WatchdogServiceModVerIdLookup.hbm.xml
deleted file mode 100644
index b6b1d9b..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/resources/WatchdogServiceModVerIdLookup.hbm.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  ============LICENSE_START=======================================================
-  ECOMP MSO
-  ================================================================================
-  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=========================================================
-  -->
-
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<!-- Generated Jul 27, 2015 3:05:00 PM by Hibernate Tools 3.4.0.CR1 -->
-<hibernate-mapping>
-    <class name="org.openecomp.mso.requestsdb.WatchdogServiceModVerIdLookup" table="WATCHDOG_SERVICE_MOD_VER_ID_LOOKUP">
-      
-        <composite-id>
-			<key-property name="distributionId" 	column="DISTRIBUTION_ID" 		type="string" 	length="45" />	
-			<key-property name="serviceModelVersionId" 	column="SERVICE_MODEL_VERSION_ID" 	type="string" 	length="45"/>	
-		</composite-id> 
-        
-        <property name="createTime" type="timestamp">
-            <column name="CREATE_TIME"/>
-        </property>
-
-    </class>
-</hibernate-mapping>
\ No newline at end of file
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/beans.xml b/mso-api-handlers/mso-requests-db/src/main/resources/beans.xml
new file mode 100644
index 0000000..cd1bc8b
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/resources/beans.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:jpa="http://www.springframework.org/schema/data/jpa"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+    http://www.springframework.org/schema/beans/spring-beans.xsd
+    http://www.springframework.org/schema/data/jpa
+    http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">
+
+  <jpa:repositories base-package="org.onap.so.db.request.data.repository" />
+
+</beans>
\ No newline at end of file
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-requests-core-mysql.cfg.xml b/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-requests-core-mysql.cfg.xml
deleted file mode 100644
index 1305dfb..0000000
--- a/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-requests-core-mysql.cfg.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ============LICENSE_START=======================================================
-  ECOMP MSO
-  ================================================================================
-  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=========================================================
-  -->
-
-<!DOCTYPE hibernate-configuration PUBLIC
-		"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-		"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
-<hibernate-configuration>
-    <session-factory>
-        <property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
-        <property name="hibernate.show_sql">false</property>
-        <property name="hibernate.format_sql">true</property>
-        <property name="connection.datasource">java:jboss/datasources/mso-requests</property>
-		
-<!-- 		<property name="hibernate.hbm2ddl.auto">create</property> -->
-
-        <mapping resource="InfraActiveRequests.hbm.xml"></mapping>
-        <mapping resource="OperationalEnvServiceModelStatus.hbm.xml"></mapping>
-        <mapping resource="OperationalEnvDistributionStatus.hbm.xml"></mapping>
-        <mapping resource="OperationStatus.hbm.xml"></mapping>
-        <mapping resource="ResourceOperationStatus.hbm.xml"></mapping>
-        <mapping resource="SiteStatus.hbm.xml"></mapping>
-        <mapping resource="WatchdogDistributionStatus.hbm.xml"></mapping>
-        <mapping resource="WatchdogComponentDistributionStatus.hbm.xml"></mapping>
-        <mapping resource="WatchdogServiceModVerIdLookup.hbm.xml"></mapping>
-    </session-factory>
-</hibernate-configuration>
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/TestApplication.java
similarity index 64%
copy from mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java
copy to mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/TestApplication.java
index 37ea292..ec2c41b 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/TestApplication.java
@@ -18,25 +18,18 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.openecomp.mso.requestsdb.adapter;
+package org.onap.so;
 
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Profile;
 
-import java.sql.Timestamp;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
-public class TimestampXMLAdapter extends XmlAdapter <Long, Timestamp> {
-
-    @Override
-    public Long marshal (Timestamp v) throws Exception {
-        return v.getTime ();
-    }
-
-    @Override
-    public Timestamp unmarshal (Long v) throws Exception {
-        if (v == null) {
-            return new Timestamp(0);
-        }
-        return new Timestamp (v);
-    }
+@SpringBootApplication(scanBasePackages = { "org.onap" })
+@Profile("test")
+public class TestApplication {
+	public static void main(String... args) {
+		SpringApplication.run(TestApplication.class, args);
+		System.getProperties().setProperty("mso.db", "MARIADB");
+		System.getProperties().setProperty("server.name", "Springboot");
+	}
 }
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/OperationStatusTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/OperationStatusTest.java
new file mode 100644
index 0000000..a10d948
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/OperationStatusTest.java
@@ -0,0 +1,82 @@
+/*-
+ * ============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.onap.so.db.request;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.Date;
+
+import javax.transaction.Transactional;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.TestApplication;
+import org.onap.so.db.request.beans.OperationStatus;
+import org.onap.so.db.request.beans.OperationStatusId;
+import org.onap.so.db.request.data.repository.OperationStatusRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@ActiveProfiles("test")
+public class OperationStatusTest {	
+	
+	@Autowired
+	private OperationStatusRepository repository;
+	
+	@Test
+	@Transactional
+	public void timeStampCreated() throws InterruptedException {
+		
+		final String testServiceId = "test-service-id";
+		final String testOperationId = "test-operation-id";
+		final OperationStatusId id = new OperationStatusId(testServiceId, testOperationId);
+		OperationStatus status = new OperationStatus();
+		
+		status.setServiceId(testServiceId);
+		status.setOperationId(testOperationId);
+		
+		status = repository.saveAndFlush(status);
+		
+		OperationStatus found = repository.findOne(id);
+		
+		Date operateAt = found.getOperateAt();
+		assertNotNull(operateAt);
+		assertEquals(testServiceId, found.getServiceId());
+		Date finishedAt = found.getFinishedAt();
+		status.setProgress("test-progress");
+		//timestamps only set to save on 1 second changes
+		Thread.sleep(1000);
+		repository.saveAndFlush(status);
+		
+		OperationStatus foundUpdate = repository.findOne(id);
+
+		assertEquals(operateAt.toString(), foundUpdate.getOperateAt().toString());
+		assertNotNull(foundUpdate.getFinishedAt());
+		assertNotEquals(finishedAt.toString(), foundUpdate.getFinishedAt().toString());
+		assertEquals("test-progress", foundUpdate.getProgress());
+	}
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/OperationalEnvServiceModelStatusTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/OperationalEnvServiceModelStatusTest.java
new file mode 100644
index 0000000..c12d3cb
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/OperationalEnvServiceModelStatusTest.java
@@ -0,0 +1,80 @@
+/*-
+ * ============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.onap.so.db.request;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.TestApplication;
+import org.onap.so.db.request.beans.OperationalEnvServiceModelStatus;
+import org.onap.so.db.request.data.repository.OperationalEnvServiceModelStatusRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.data.domain.Example;
+import org.springframework.data.domain.ExampleMatcher;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@ActiveProfiles("test")
+public class OperationalEnvServiceModelStatusTest {
+
+	@Autowired
+	private OperationalEnvServiceModelStatusRepository repository;
+	
+	
+	@Test
+	public void updateWithoutAllKeys() throws Exception {
+		
+		OperationalEnvServiceModelStatus status = new OperationalEnvServiceModelStatus();
+		status.setRequestId("request-id-1");
+		status.setOperationalEnvId("oper-env-id-1");
+		status.setServiceModelVersionId("service-model-ver-id-1");
+		status.setRetryCount(0);
+		
+		repository.saveAndFlush(status);
+		OperationalEnvServiceModelStatus status2 = repository.findOneByOperationalEnvIdAndServiceModelVersionId("oper-env-id-1", "service-model-ver-id-1");
+		status2.setRetryCount(1);
+		
+		repository.saveAndFlush(status2);
+		
+		OperationalEnvServiceModelStatus status3 = new OperationalEnvServiceModelStatus();
+
+		status3.setRequestId("request-id-2");
+		status3.setOperationalEnvId("oper-env-id-1");
+		status3.setServiceModelVersionId("service-model-ver-id-2");
+		status3.setRetryCount(2);
+		
+		repository.saveAndFlush(status3);
+		
+		OperationalEnvServiceModelStatus exampleObj = new OperationalEnvServiceModelStatus();
+		exampleObj.setOperationalEnvId("oper-env-id-1");
+		exampleObj.setServiceModelVersionId("service-model-ver-id-1");
+		ExampleMatcher matcher = ExampleMatcher.matching().withIgnorePaths("requestId");
+		OperationalEnvServiceModelStatus foundStatus = repository.findOne(Example.of(exampleObj,matcher));
+		if(foundStatus== null)
+			throw new Exception("No status found");
+
+		assertEquals(new Integer(1), foundStatus.getRetryCount());		
+	}
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/RequestDBConfig.java b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/RequestDBConfig.java
new file mode 100644
index 0000000..9bcff13
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/RequestDBConfig.java
@@ -0,0 +1,77 @@
+/*-
+ * ============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.onap.so.db.request;
+
+
+import javax.persistence.EntityManagerFactory;
+import javax.sql.DataSource;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
+import org.springframework.orm.jpa.JpaTransactionManager;
+import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
+import org.springframework.transaction.PlatformTransactionManager;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+@Configuration
+@EnableTransactionManagement
+@EnableJpaRepositories(
+		entityManagerFactoryRef = "requestEntityManagerFactory",transactionManagerRef = "requestTransactionManager",
+		basePackages = { "org.onap.so.db.request.data.repository" }
+		)
+public class RequestDBConfig {
+
+	@Primary
+	@Bean(name = "requestDataSource")
+	@ConfigurationProperties(prefix = "spring.datasource")
+	public DataSource dataSource() {
+		return DataSourceBuilder.create().build();
+	}
+
+	@Primary
+	@Bean(name = "requestEntityManagerFactory")
+	public LocalContainerEntityManagerFactoryBean 
+	entityManagerFactory(
+			EntityManagerFactoryBuilder builder,
+			@Qualifier("requestDataSource") DataSource dataSource
+			) {
+		return builder
+				.dataSource(dataSource)
+				.packages("org.onap.so.db.request.beans")
+				.persistenceUnit("requestDB")
+				.build();
+	}
+
+	@Primary
+	@Bean(name = "requestTransactionManager")
+	public PlatformTransactionManager transactionManager(
+			@Qualifier("requestEntityManagerFactory") EntityManagerFactory 
+			entityManagerFactory
+			) {
+		return new JpaTransactionManager(entityManagerFactory);
+	}
+
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/SiteStatusTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/SiteStatusTest.java
new file mode 100644
index 0000000..917f52d
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/SiteStatusTest.java
@@ -0,0 +1,86 @@
+/*-
+ * ============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.onap.so.db.request;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import javax.transaction.Transactional;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.onap.so.TestApplication;
+import org.onap.so.db.request.beans.SiteStatus;
+import org.onap.so.db.request.data.repository.SiteStatusRepository;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.data.domain.Example;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Sort.Direction;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@ActiveProfiles("test")
+public class SiteStatusTest {
+	
+	@Autowired
+	private SiteStatusRepository repository;
+	
+	@Test	
+	@Transactional
+	public void timeStampCreated() throws InterruptedException {
+		SiteStatus found = repository.findOne("test name4");		
+		assertNotNull(found.getCreated());
+		assertEquals("test name4", found.getSiteName());		
+	}
+	
+	@Test
+	public void sortByCreated() {
+		
+		final PageRequest page1 = new PageRequest(
+				  0, 20, Direction.DESC, "created"
+				);
+		
+		SiteStatus example = new SiteStatus();
+		example.setStatus(true);
+		Page<SiteStatus> found = repository.findAll(Example.of(example), page1);
+		
+		assertEquals("test name4", found.getContent().get(0).getSiteName());
+		
+	}
+	
+	@Test
+	public void updateStatus() {
+		
+		SiteStatus status = repository.findOne("test name update");
+		status.setStatus(false);
+		
+		repository.saveAndFlush(status);
+
+		assertEquals(false, repository.findOne("test name update").getStatus());
+		
+	}
+	
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/beans/BeansTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/beans/BeansTest.java
new file mode 100644
index 0000000..3f9443f
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/onap/so/db/request/beans/BeansTest.java
@@ -0,0 +1,71 @@
+/*-
+ * ============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.onap.so.db.request.beans;
+
+import static org.onap.so.openpojo.rules.HasAnnotationMatcher.hasAnnotation;
+
+import javax.persistence.Temporal;
+
+import org.junit.Test;
+import org.onap.so.openpojo.rules.CustomSetterMustExistRule;
+import org.onap.so.openpojo.rules.EqualsAndHashCodeTester;
+import org.onap.so.openpojo.rules.HasEqualsAndHashCodeRule;
+import org.onap.so.openpojo.rules.HasToStringRule;
+import org.onap.so.openpojo.rules.ToStringTester;
+
+import com.openpojo.reflection.PojoClass;
+import com.openpojo.reflection.PojoClassFilter;
+import com.openpojo.reflection.filters.FilterEnum;
+import com.openpojo.reflection.filters.FilterPackageInfo;
+import com.openpojo.validation.Validator;
+import com.openpojo.validation.ValidatorBuilder;
+import com.openpojo.validation.rule.impl.GetterMustExistRule;
+import com.openpojo.validation.test.impl.GetterTester;
+import com.openpojo.validation.test.impl.SetterTester;
+
+public class BeansTest {
+
+	private PojoClassFilter filterTestClasses = new FilterTestClasses();
+
+	@Test
+	public void pojoStructure() {
+		test("org.onap.so.db.request.beans");
+	}
+
+	private void test(String pojoPackage) {
+		Validator validator = ValidatorBuilder.create()
+				.with(new GetterMustExistRule())
+				.with(new CustomSetterMustExistRule().exclude(hasAnnotation(Temporal.class)))
+				.with(new HasEqualsAndHashCodeRule())
+				.with(new HasToStringRule())
+				.with(new SetterTester())
+				.with(new GetterTester())
+				.with(new EqualsAndHashCodeTester())
+				.with(new ToStringTester())
+				.build();
+		validator.validate(pojoPackage, new FilterPackageInfo(), filterTestClasses, new FilterEnum());
+	}
+	private static class FilterTestClasses implements PojoClassFilter {
+		public boolean include(PojoClass pojoClass) {
+			return !pojoClass.getSourcePath().contains("/test-classes/");
+		}
+	}
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsTest.java
deleted file mode 100644
index 33f1fbb..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsTest.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.requestsdb;
-
-import static org.junit.Assert.*;
-
-import java.sql.Timestamp;
-
-import org.junit.Test;
-
-public class InfraRequestsTest {
-    
-    InfraRequests ir=new InfraRequests();
-    InfraRequests ir1=new InfraRequests("requestId", "action");
-	Timestamp time=new Timestamp(123);
-	long progress=111;
-	@Test
-	public void test() {
-		ir.setAaiServiceId("aaiServiceId");
-		ir.setAction("action");
-		ir.setAicCloudRegion("aicCloudRegion");
-		ir.setAicNodeClli("aicNodeClli");
-		ir.setCallBackUrl("callBackUrl");
-		ir.setClientRequestId("clientRequestId");
-		ir.setConfigurationId("configurationId");
-		ir.setConfigurationName("configurationName");
-		ir.setCorrelator("correlator");
-		ir.setEndTime(time);
-		ir.setLastModifiedBy("lastModifiedBy");
-		ir.setModifyTime(time);
-		ir.setNetworkId("networkId");
-		ir.setNetworkName("networkName");
-		ir.setNetworkType("networkType");
-		ir.setOperationalEnvId("operationalEnvId");
-		ir.setOperationalEnvName("operationalEnvName");
-		ir.setProgress(progress);
-		ir.setProvStatus("provStatus");
-		ir.setRequestAction("requestAction");
-		ir.setRequestBody("requestBody");
-		ir.setRequestId("requestId");
-		ir.setRequestorId("requestorId");
-		ir.setRequestScope("requestScope");
-		ir.setRequestStatus("requestStatus");
-		ir.setRequestType("requestType");
-		ir.setResponseBody("responseBody");
-		ir.setServiceInstanceId("serviceInstanceId");
-		ir.setServiceInstanceName("serviceInstanceName");
-		ir.setServiceType("serviceType");
-		ir.setSource("source");
-		ir.setStartTime(time);
-		ir.setStatusMessage("statusMessage");
-		ir.setTenantId("tenantId");
-		ir.setVfModuleId("vfModuleId");
-		ir.setVfModuleModelName("vfModuleModelName");
-		ir.setVfModuleName("vfModuleName");
-		ir.setVnfId("vnfId");
-		ir.setVnfName("vnfName");
-		ir.setVnfOutputs("vnfOutputs");
-		ir.setVnfParams("vnfParams");
-		ir.setVnfType("vnfType");
-		ir.setVolumeGroupId("volumeGroupId");
-		ir.setVolumeGroupName("volumeGroupName");
-		
-		assertEquals(ir.getAaiServiceId(), "aaiServiceId");
-		assertEquals(ir.getAction(),"action");
-		assertEquals(ir.getAicCloudRegion(),"aicCloudRegion");
-		assertEquals(ir.getAicNodeClli(),"aicNodeClli");
-		assertEquals(ir.getCallBackUrl(),"callBackUrl");
-		assertEquals(ir.getClientRequestId(),"clientRequestId");
-		assertEquals(ir.getConfigurationId(),"configurationId");
-		assertEquals(ir.getConfigurationName(),"configurationName");
-		assertEquals(ir.getCorrelator(),"correlator");
-		assertEquals(ir.getEndTime(),time);
-		assertEquals(ir.getLastModifiedBy(),"lastModifiedBy");
-		assertEquals(ir.getModifyTime(),time);
-		assertEquals(ir.getNetworkId(),"networkId");
-		assertEquals(ir.getNetworkName(),"networkName");
-		assertEquals(ir.getNetworkType(),"networkType");
-		assertEquals(ir.getOperationalEnvId(),"operationalEnvId");
-		assertEquals(ir.getOperationalEnvName(),"operationalEnvName");
-	    assert(ir.getProgress().equals(progress));
-		assertEquals(ir.getProvStatus(),"provStatus");
-		assertEquals(ir.getRequestAction(),"requestAction");
-		assertEquals(ir.getRequestBody(),"requestBody");
-		assertEquals(ir.getRequestId(),"requestId");
-		assertEquals(ir.getRequestorId(),"requestorId");
-		assertEquals(ir.getRequestScope(),"requestScope");
-		assertEquals(ir.getRequestStatus(),"requestStatus");
-		assertEquals(ir.getRequestType(),"requestType");
-		assertEquals(ir.getResponseBody(),"responseBody");
-		assertEquals(ir.getServiceInstanceId(),"serviceInstanceId");
-		assertEquals(ir.getServiceInstanceName(),"serviceInstanceName");
-		assertEquals(ir.getServiceType(),"serviceType");
-		assertEquals(ir.getSource(),"source");
-		assertEquals(ir.getStartTime(),time);
-		assertEquals(ir.getStatusMessage(),"statusMessage");
-		assertEquals(ir.getTenantId(),"tenantId");
-		assertEquals(ir.getVfModuleId(),"vfModuleId");
-		assertEquals(ir.getVfModuleModelName(),"vfModuleModelName");
-		assertEquals(ir.getVfModuleName(),"vfModuleName");
-		assertEquals(ir.getVnfId(),"vnfId");
-		assertEquals(ir.getVnfName(),"vnfName");
-		assertEquals(ir.getVnfOutputs(),"vnfOutputs");
-		assertEquals(ir.getVnfParams(),"vnfParams");
-		assertEquals(ir.getVnfType(),"vnfType");
-		assertEquals(ir.getVolumeGroupId(),"volumeGroupId");
-		assertEquals(ir.getVolumeGroupName(),"volumeGroupName");
-		
-	}
-	
-
-}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationStatusTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationStatusTest.java
deleted file mode 100644
index cf18524..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationStatusTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.requestsdb;
-
-import static org.junit.Assert.*;
-import java.sql.Timestamp;
-import org.junit.Test;
-
-public class OperationStatusTest {
-	
-	OperationStatus os=new OperationStatus();
-	Timestamp time=new Timestamp(10);
-	Object obj=new Object();
-	@Test
-	public void test() {
-		os.setFinishedAt(time);
-		os.setOperateAt(time);
-		os.setOperation("operation");
-		os.setOperationContent("operationContent");
-		os.setOperationId("operationId");
-		os.setProgress("progress");
-		os.setReason("reason");
-		os.setResult("result");
-		os.setServiceId("serviceId");
-		os.setServiceName("serviceName");
-		os.setUserId("userId");
-		
-		assertEquals(os.getFinishedAt(), time);
-		assertEquals(os.getOperateAt(), time);
-		assertEquals(os.getOperation(), "operation");
-		assertEquals(os.getOperationContent(), "operationContent");
-		assertEquals(os.getOperationId(), "operationId");
-		assertEquals(os.getProgress(), "progress");
-		assertEquals(os.getReason(), "reason");
-		assertEquals(os.getResult(), "result");
-		assertEquals(os.getServiceId(), "serviceId");
-		assertEquals(os.getServiceName(), "serviceName");
-		assertEquals(os.getUserId(), "userId");
-		
-		os.equals(obj);
-		os.hashCode();
-	}
-
-}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationalEnvDistributionStatusDbTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationalEnvDistributionStatusDbTest.java
deleted file mode 100644
index 89213f9..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationalEnvDistributionStatusDbTest.java
+++ /dev/null
@@ -1,112 +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.requestsdb;
-
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import java.util.Arrays;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-
-
-public class OperationalEnvDistributionStatusDbTest {
-	@Mock
-	private AbstractSessionFactoryManager sessionFactoryRequest;
-	@Mock
-	private SessionFactory sessionFactory;
-	@Mock
-	private Session session;
-
-	@Rule
-	public ExpectedException thrown = ExpectedException.none();
-
-	@Before
-	public void setUp() {
-		MockitoAnnotations.initMocks(this);
-		when(sessionFactory.openSession()).thenReturn(session);
-		when(sessionFactoryRequest.getSessionFactory()).thenReturn(sessionFactory);
-
-	}
-
-	@Test
-	public void insertFailure() {
-		OperationalEnvDistributionStatusDb omsDB = new OperationalEnvDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn(null);
-		when(session.isOpen()).thenReturn(true);
-		when(session.getTransaction()).thenThrow(Exception.class);
-		thrown.expect(Exception.class);
-
-		omsDB.insertOperationalEnvDistributionStatus("myDistId", "myEnvId", "myModelVerId", "myDistIdStatus", "myReqId");
-	}
-
-	@Test
-	public void updateFailureRetryCount() {
-		OperationalEnvDistributionStatusDb omsDB = new OperationalEnvDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(session.isOpen()).thenReturn(true);
-		when(session.getTransaction()).thenThrow(Exception.class);
-		thrown.expect(Exception.class);
-		
-		omsDB.updateOperationalEnvDistributionStatus("asdcStatus", "myDistId", "myEnvId", "myVerId");
-	}
-
-	@Test
-	public void getOperationalEnvIdStatusTest() {
-		OperationalEnvDistributionStatusDb omsDB = new OperationalEnvDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		OperationalEnvDistributionStatus status = new OperationalEnvDistributionStatus();
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn(status);
-		when(session.isOpen()).thenReturn(true);
-		assertEquals(status, omsDB.getOperationalEnvDistributionStatusPerReqId("myDistId", "myReqId"));
-	}
-	
-	@Test
-	public void getOperationalEnvServiceModelStatusTest() {
-		OperationalEnvDistributionStatusDb omsDB = new OperationalEnvDistributionStatusDb(this.sessionFactoryRequest);
-		OperationalEnvDistributionStatus status = new OperationalEnvDistributionStatus();
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn(status);
-		when(session.isOpen()).thenReturn(true);
-		assertEquals(status, omsDB.getOperationalEnvDistributionStatus("myDistId"));
-	}
-}
\ No newline at end of file
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationalEnvDistributionStatusTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationalEnvDistributionStatusTest.java
deleted file mode 100644
index 6381ec6..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationalEnvDistributionStatusTest.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.requestsdb;
-
-
-import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import java.sql.Timestamp;
-
-public class OperationalEnvDistributionStatusTest {
-
-	OperationalEnvDistributionStatus oeds=new OperationalEnvDistributionStatus();
-    Timestamp time=new Timestamp(10);
-	@Test
-	public void test(){
-	    oeds.setCreateTime(time);
-	    oeds.setDistributionId("distributionId");
-	    oeds.setDistributionIdErrorReason("distributionIdErrorReason");
-	    oeds.setDistributionIdStatus("distributionIdStatus");
-	    oeds.setModifyTime(time);
-	    oeds.setOperationalEnvId("operationalEnvId");
-	    oeds.setRequestId("requestId");
-	    oeds.setServiceModelVersionId("serviceModelVersionId");
-	    
-	    assertEquals(oeds.getCreateTime(), time);
-	    assertEquals(oeds.getDistributionId(), "distributionId");
-	    assertEquals(oeds.getDistributionIdErrorReason(), "distributionIdErrorReason");
-	    assertEquals(oeds.getDistributionIdStatus(), "distributionIdStatus");
-	    assertEquals(oeds.getModifyTime(),time);
-	    assertEquals(oeds.getOperationalEnvId(), "operationalEnvId");
-	    assertEquals(oeds.getRequestId(), "requestId");
-	    assertEquals(oeds.getServiceModelVersionId(), "serviceModelVersionId");
-	}
-}
-	
-	/*protected String _distributionId;
-	protected String _operationalEnvId;
-	protected String _serviceModelVersionId;
-	protected String _requestId;
-	protected String _distributionIdStatus;
-	protected String _distributionIdErrorReason;
-	protected Timestamp _createTime;
-	protected Timestamp _modifyTime;
-
-	public OperationalEnvDistributionStatusTest() {
-	}
-	
-    @Before
-	public void setUp() {
-    	_operationalEnvDistributionStatus = mock(OperationalEnvDistributionStatus.class);
-    	_distributionId = "12abad84e7ff";
-    	_operationalEnvId = "28122015552391";
-    	_serviceModelVersionId = "28122015552391-aa";
-    	_requestId = "1234";
-    	_distributionIdStatus = "SENT";
-    	_distributionIdErrorReason = "Fail";  	
-    	_createTime = new Timestamp (System.currentTimeMillis());
-    	_modifyTime = new Timestamp (System.currentTimeMillis());
-    	
-    	when(_operationalEnvDistributionStatus.getDistributionId()).thenReturn(_distributionId);
-    	when(_operationalEnvDistributionStatus.getOperationalEnvId()).thenReturn(_operationalEnvId);
-    	when(_operationalEnvDistributionStatus.getServiceModelVersionId()).thenReturn(_serviceModelVersionId);
-    	when(_operationalEnvDistributionStatus.getRequestId()).thenReturn(_requestId);
-    	when(_operationalEnvDistributionStatus.getDistributionIdStatus()).thenReturn(_distributionIdStatus);
-    	when(_operationalEnvDistributionStatus.getDistributionIdErrorReason()).thenReturn(_distributionIdErrorReason);
-    	when(_operationalEnvDistributionStatus.getCreateTime()).thenReturn(_createTime);
-    	when(_operationalEnvDistributionStatus.getModifyTime()).thenReturn(_modifyTime);
-	}
-    
-
-	@After
-	public void tearDown() {
-		_operationalEnvDistributionStatus = null;
-	}
-	
-	*//**
-	 * Test of getDistributionId method
-	 *//*
-	@Test
-	public void testGetDistributionId() {
-		_operationalEnvDistributionStatus.setDistributionId(_distributionId);
-		assertEquals(_operationalEnvDistributionStatus.getDistributionId(),_distributionId);
-
-	}
-
-	*//**
-	 * Test setDistributionId  method
-	 *//*
-	@Test
-	public void testSetDistributionId() {
-		_operationalEnvDistributionStatus.setDistributionId(_distributionId);
-		verify(_operationalEnvDistributionStatus).setDistributionId(_distributionId);
-	}
-	
-	*//**
-	 * Test of getOperationalEnvId method
-	 *//*
-	@Test
-	public void testGetOperationalEnvId() {
-		_operationalEnvDistributionStatus.setOperationalEnvId(_operationalEnvId);
-		assertEquals(_operationalEnvDistributionStatus.getOperationalEnvId(),_operationalEnvId);
-
-	}
-
-	*//**
-	 * Test setOperationalEnvId method
-	 *//*
-	@Test
-	public void testSetOperationalEnvId() {
-		_operationalEnvDistributionStatus.setOperationalEnvId(_operationalEnvId);
-		verify(_operationalEnvDistributionStatus).setOperationalEnvId(_operationalEnvId);
-	}
-	
-	*//**
-	 * Test of getServiceModelVersionId method
-	 *//*
-	@Test
-	public void testGetServiceModelVersionId() {
-		_operationalEnvDistributionStatus.setServiceModelVersionId(_serviceModelVersionId);
-		assertEquals(_operationalEnvDistributionStatus.getServiceModelVersionId(),_serviceModelVersionId);
-
-	}
-
-	*//**
-	 * Test setServiceModelVersionId method
-	 *//*
-	@Test
-	public void testSetServiceModelVersionId() {
-		_operationalEnvDistributionStatus.setServiceModelVersionId(_serviceModelVersionId);
-		verify(_operationalEnvDistributionStatus).setServiceModelVersionId(_serviceModelVersionId);
-	}
-	
-	*//**
-	 * Test of getRequestId method
-	 *//*
-	@Test
-	public void testGetRequestId() {
-		_operationalEnvDistributionStatus.setRequestId(_requestId);
-		assertEquals(_operationalEnvDistributionStatus.getRequestId(),_requestId);
-
-	}
-
-	*//**
-	 * Test setRequestId method
-	 *//*
-	@Test
-	public void testSetRequestId() {
-		_operationalEnvDistributionStatus.setRequestId(_requestId);
-		verify(_operationalEnvDistributionStatus).setRequestId(_requestId);
-	}
-	
-	*//**
-	 * Test of getDistributionIdStatus method
-	 *//*
-	@Test
-	public void testGetDistributionIdStatus() {
-		_operationalEnvDistributionStatus.setDistributionIdStatus(_distributionIdStatus);
-		assertEquals(_operationalEnvDistributionStatus.getDistributionIdStatus(),_distributionIdStatus);
-
-	}
-
-	*//**
-	 * Test setDistributionIdStatus method
-	 *//*
-	@Test
-	public void testSetDistributionIdStatus() {
-		_operationalEnvDistributionStatus.setDistributionIdStatus(_distributionIdStatus);
-		verify(_operationalEnvDistributionStatus).setDistributionIdStatus(_distributionIdStatus);
-	}
-	
-	*//**
-	 * Test of getDistributionIdErrorReason method
-	 *//*
-	@Test
-	public void testGetDistributionIdErrorReason() {
-		_operationalEnvDistributionStatus.setDistributionIdErrorReason(_distributionIdErrorReason);
-		assertEquals(_operationalEnvDistributionStatus.getDistributionIdErrorReason(),_distributionIdErrorReason);
-
-	}
-
-	*//**
-	 * Test setDistributionIdErrorReason method
-	 *//*
-	@Test
-	public void testSetDistributionIdErrorReason() {
-		_operationalEnvDistributionStatus.setDistributionIdErrorReason(_distributionIdErrorReason);
-		verify(_operationalEnvDistributionStatus).setDistributionIdErrorReason(_distributionIdErrorReason);
-	}
-	
-	*//**
-	 * Test of getCreateTime method
-	 *//*
-	@Test
-	public void testGetCreateTime() {
-		_operationalEnvDistributionStatus.setCreateTime(_createTime);
-		System.out.println("CreateTime : " + _createTime);
-		assertEquals(_operationalEnvDistributionStatus.getCreateTime(),_createTime);
-
-	}
-
-	*//**
-	 * Test setCreateTime method
-	 *//*
-	@Test
-	public void testSetCreateTime() {
-		_operationalEnvDistributionStatus.setCreateTime(_createTime);
-		verify(_operationalEnvDistributionStatus).setCreateTime(_createTime);
-	}
-	
-	*//**
-	 * Test of getModifyTime method
-	 *//*
-	@Test
-	public void testGetModifyTime() {
-		_operationalEnvDistributionStatus.setModifyTime(_modifyTime);
-		System.out.println("ModifyTime : " + _modifyTime);
-		assertEquals(_operationalEnvDistributionStatus.getModifyTime(),_modifyTime);
-
-	}
-
-	*//**
-	 * Test setModifyTime method
-	 *//*
-	@Test
-	public void testSetModifyTime() {
-		_operationalEnvDistributionStatus.setModifyTime(_modifyTime);
-		verify(_operationalEnvDistributionStatus).setModifyTime(_modifyTime);
-	}
-	
-	
-}
-*/
\ No newline at end of file
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationalEnvServiceModelStatusDbTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationalEnvServiceModelStatusDbTest.java
deleted file mode 100644
index fb2a5a4..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationalEnvServiceModelStatusDbTest.java
+++ /dev/null
@@ -1,120 +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.requestsdb;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.Arrays;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-
-public class OperationalEnvServiceModelStatusDbTest {
-
-	@Mock
-	private AbstractSessionFactoryManager sessionFactoryRequest;
-	@Mock
-	private SessionFactory sessionFactory;
-	@Mock
-	private Session session;
-
-	@Rule
-	public ExpectedException thrown = ExpectedException.none();
-
-	@Before
-	public void setUp() {
-		MockitoAnnotations.initMocks(this);
-		when(sessionFactory.openSession()).thenReturn(session);
-		when(sessionFactoryRequest.getSessionFactory()).thenReturn(sessionFactory);
-
-	}
-
-	@Test
-	public void insertFailure() {
-		OperationalEnvServiceModelStatusDb omsDB = new OperationalEnvServiceModelStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn(null);
-		when(session.isOpen()).thenReturn(true);
-		when(session.getTransaction()).thenThrow(Exception.class);
-		thrown.expect(Exception.class);
-
-		omsDB.insertOperationalEnvServiceModelStatus("myRequestId", "myOperationalEnvId", "myServiceModelVersionId", "myVal", "myRecoveryAction", 1, "myWorkloadContext");
-	}
-
-	@Test
-	public void updateFailureRetryCount() {
-		OperationalEnvServiceModelStatusDb omsDB = new OperationalEnvServiceModelStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(session.isOpen()).thenReturn(true);
-		when(session.getTransaction()).thenThrow(Exception.class);
-		thrown.expect(Exception.class);
-		
-		omsDB.updateOperationalEnvRetryCountStatus("myOperationalEnvId", "myServiceModelVersionId", "status", 1);
-	}
-	
-	@Test
-	public void updateFailureRetryCountPerReqId() {
-		OperationalEnvServiceModelStatusDb omsDB = new OperationalEnvServiceModelStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(session.isOpen()).thenReturn(true);
-		when(session.getTransaction()).thenThrow(Exception.class);
-		thrown.expect(Exception.class);
-		
-		omsDB.updateOperationalEnvRetryCountStatusPerReqId("myOperationalEnvId", "myServiceModelVersionId", "status", 1, "myReqId");
-	}
-	
-	
-	@Test
-	public void getOperationalEnvIdStatusTest() {
-		OperationalEnvServiceModelStatusDb omsDB = new OperationalEnvServiceModelStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		OperationalEnvServiceModelStatus status = new OperationalEnvServiceModelStatus();
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.list()).thenReturn(Arrays.asList(status));
-		when(session.isOpen()).thenReturn(true);
-		assertEquals(status, omsDB.getOperationalEnvIdStatus("myEnvId", "myReqId").get(0));
-	}
-	
-	@Test
-	public void getOperationalEnvServiceModelStatusTest() {
-		OperationalEnvServiceModelStatusDb omsDB = new OperationalEnvServiceModelStatusDb(this.sessionFactoryRequest);
-		OperationalEnvServiceModelStatus status = new OperationalEnvServiceModelStatus();
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn(status);
-		when(session.isOpen()).thenReturn(true);
-		assertEquals(status, omsDB.getOperationalEnvServiceModelStatus("myEnvId", "myModelId"));
-	}
-}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationalEnvServiceModelStatusTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationalEnvServiceModelStatusTest.java
deleted file mode 100644
index ecde7b3..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/OperationalEnvServiceModelStatusTest.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.requestsdb;
-
-import static org.junit.Assert.assertEquals;
-import java.sql.Timestamp;
-import org.junit.Test;
-
-public class OperationalEnvServiceModelStatusTest {
-	
-	OperationalEnvServiceModelStatus oesms=new OperationalEnvServiceModelStatus();
-	Timestamp time=new Timestamp(10);
-	@Test
-	public void test(){
-		oesms.setCreateTime(time);
-		oesms.setModifyTime(time);
-		oesms.setOperationalEnvId("operationalEnvId");
-		oesms.setRecoveryAction("recoveryAction");
-		oesms.setRequestId("requestId");
-		oesms.setRetryCount(0);
-		oesms.setServiceModelVersionDistrStatus("serviceModelVersionDistrStatus");
-		oesms.setServiceModelVersionId("serviceModelVersionId");
-		oesms.setWorkloadContext("workloadContext");
-		
-		assertEquals(oesms.getCreateTime(), time);
-		assertEquals(oesms.getModifyTime(), time);
-		assertEquals(oesms.getOperationalEnvId(), "operationalEnvId");
-		assertEquals(oesms.getRecoveryAction(), "recoveryAction");
-		assertEquals(oesms.getRequestId(), "requestId");
-		assertEquals(oesms.getRetryCount(), 0);
-		assertEquals(oesms.getServiceModelVersionDistrStatus(), "serviceModelVersionDistrStatus");
-		assertEquals(oesms.getServiceModelVersionId(), "serviceModelVersionId");
-		assertEquals(oesms.getWorkloadContext(), "workloadContext");
-	}
-}
-	/*OperationalEnvServiceModelStatus _operationalEnvServiceModelStatus;
-	
-	protected String _requestId;
-	protected String _operationalEnvId;
-	protected String _serviceModelVersionId;
-	protected String _serviceModelVersionDistrStatus;
-	protected String _recoveryAction;
-	private int _retryCount;
-	private String _workloadContext;
-	protected Timestamp _createTime;
-	protected Timestamp _modifyTime;
-
-	
-	public OperationalEnvServiceModelStatusTest() {
-	}
-	
-    @Before
-	public void setUp() {
-    	_operationalEnvServiceModelStatus = mock(OperationalEnvServiceModelStatus.class);
-    	_requestId = "1234";
-    	_operationalEnvId = "28122015552391";
-    	_serviceModelVersionId = "28122015552391-aa";
-    	_serviceModelVersionDistrStatus = "SENT";
-    	_recoveryAction = "Retry";  	
-    	_retryCount = 0;
-    	_workloadContext = "VNF_E2E-IST";
-    	_createTime = new Timestamp (System.currentTimeMillis());
-    	_modifyTime = new Timestamp (System.currentTimeMillis());
-    	
-    	when(_operationalEnvServiceModelStatus.getRequestId()).thenReturn(_requestId);
-    	when(_operationalEnvServiceModelStatus.getOperationalEnvId()).thenReturn(_operationalEnvId);
-    	when(_operationalEnvServiceModelStatus.getServiceModelVersionId()).thenReturn(_serviceModelVersionId);
-    	when(_operationalEnvServiceModelStatus.getServiceModelVersionDistrStatus()).thenReturn(_serviceModelVersionDistrStatus);
-    	when(_operationalEnvServiceModelStatus.getRecoveryAction()).thenReturn(_recoveryAction);
-    	when(_operationalEnvServiceModelStatus.getRetryCount()).thenReturn(_retryCount);
-    	when(_operationalEnvServiceModelStatus.getWorkloadContext()).thenReturn(_workloadContext);
-    	when(_operationalEnvServiceModelStatus.getCreateTime()).thenReturn(_createTime);
-    	when(_operationalEnvServiceModelStatus.getModifyTime()).thenReturn(_modifyTime);
-	}
-    
-
-	@After
-	public void tearDown() {
-		_operationalEnvServiceModelStatus = null;
-	}
-	
-	*//**
-	 * Test of getRequestId method
-	 *//*
-	@Test
-	public void testGetRequestId() {
-		_operationalEnvServiceModelStatus.setRequestId(_requestId);
-		assertEquals(_operationalEnvServiceModelStatus.getRequestId(),_requestId);
-
-	}
-
-	*//**
-	 * Test setRequestId  method
-	 *//*
-	@Test
-	public void testSetRequestId() {
-		_operationalEnvServiceModelStatus.setRequestId(_requestId);
-		verify(_operationalEnvServiceModelStatus).setRequestId(_requestId);
-	}
-
-	*//**
-	 * Test of getOperationalEnvId method
-	 *//*
-	@Test
-	public void testGetOperationalEnvId() {
-		_operationalEnvServiceModelStatus.setOperationalEnvId(_operationalEnvId);
-		assertEquals(_operationalEnvServiceModelStatus.getOperationalEnvId(),_operationalEnvId);
-
-	}
-
-	*//**
-	 * Test setOperationalEnvId method
-	 *//*
-	@Test
-	public void testSetOperationalEnvId() {
-		_operationalEnvServiceModelStatus.setOperationalEnvId(_operationalEnvId);
-		verify(_operationalEnvServiceModelStatus).setOperationalEnvId(_operationalEnvId);
-	}
-	
-	*//**
-	 * Test of getServiceModelVersionId method
-	 *//*
-	@Test
-	public void testGetServiceModelVersionId() {
-		_operationalEnvServiceModelStatus.setServiceModelVersionId(_serviceModelVersionId);
-		assertEquals(_operationalEnvServiceModelStatus.getServiceModelVersionId(),_serviceModelVersionId);
-
-	}
-
-	*//**
-	 * Test setServiceModelVersionId method
-	 *//*
-	@Test
-	public void testSetServiceModelVersionId() {
-		_operationalEnvServiceModelStatus.setServiceModelVersionId(_serviceModelVersionId);
-		verify(_operationalEnvServiceModelStatus).setServiceModelVersionId(_serviceModelVersionId);
-	}
-	
-	*//**
-	 * Test of getServiceModelVersionId method
-	 *//*
-	@Test
-	public void testGetServiceModelVersionDistrStatus() {
-		_operationalEnvServiceModelStatus.setServiceModelVersionDistrStatus(_serviceModelVersionDistrStatus);
-		assertEquals(_operationalEnvServiceModelStatus.getServiceModelVersionDistrStatus(),_serviceModelVersionDistrStatus);
-
-	}
-
-	*//**
-	 * Test setServiceModelVersionId method
-	 *//*
-	@Test
-	public void testSetServiceModelVersionDistrStatus() {
-		_operationalEnvServiceModelStatus.setServiceModelVersionDistrStatus(_serviceModelVersionDistrStatus);
-		verify(_operationalEnvServiceModelStatus).setServiceModelVersionDistrStatus(_serviceModelVersionDistrStatus);
-	}
-	
-	*//**
-	 * Test of getOperationalEnvId method
-	 *//*
-	@Test
-	public void testGetRecoveryAction() {
-		_operationalEnvServiceModelStatus.setRecoveryAction(_recoveryAction);
-		assertEquals(_operationalEnvServiceModelStatus.getRecoveryAction(),_recoveryAction);
-
-	}
-
-	*//**
-	 * Test setOperationalEnvId method
-	 *//*
-	@Test
-	public void testSetRecoveryAction() {
-		_operationalEnvServiceModelStatus.setRecoveryAction(_recoveryAction);
-		verify(_operationalEnvServiceModelStatus).setRecoveryAction(_recoveryAction);
-	}
-	
-	*//**
-	 * Test of getOperationalEnvId method
-	 *//*
-	@Test
-	public void testGetRetryCount() {
-		_operationalEnvServiceModelStatus.setRetryCount(_retryCount);
-		assertEquals(_operationalEnvServiceModelStatus.getRetryCount(),_retryCount);
-
-	}
-
-	*//**
-	 * Test setOperationalEnvId method
-	 *//*
-	@Test
-	public void testSetRetryCount() {
-		_operationalEnvServiceModelStatus.setRetryCount(_retryCount);
-		verify(_operationalEnvServiceModelStatus).setRetryCount(_retryCount);
-	}
-	
-	*//**
-	 * Test of getOperationalEnvId method
-	 *//*
-	@Test
-	public void testGetWorkloadContext() {
-		_operationalEnvServiceModelStatus.setWorkloadContext(_workloadContext);
-		assertEquals(_operationalEnvServiceModelStatus.getWorkloadContext(),_workloadContext);
-
-	}
-
-	*//**
-	 * Test setOperationalEnvId method
-	 *//*
-	@Test
-	public void testSetWorkloadContext() {
-		_operationalEnvServiceModelStatus.setWorkloadContext(_workloadContext);
-		verify(_operationalEnvServiceModelStatus).setWorkloadContext(_workloadContext);
-	}
-	
-	*//**
-	 * Test of getCreateTime method
-	 *//*
-	@Test
-	public void testGetCreateTime() {
-		_operationalEnvServiceModelStatus.setCreateTime(_createTime);
-		assertEquals(_operationalEnvServiceModelStatus.getCreateTime(),_createTime);
-
-	}
-
-	*//**
-	 * Test setCreateTime method
-	 *//*
-	@Test
-	public void testSetCreateTime() {
-		_operationalEnvServiceModelStatus.setCreateTime(_createTime);
-		verify(_operationalEnvServiceModelStatus).setCreateTime(_createTime);
-	}
-	
-	*//**
-	 * Test of getModifyTime method
-	 *//*
-	@Test
-	public void testGetModifyTime() {
-		_operationalEnvServiceModelStatus.setModifyTime(_modifyTime);
-		assertEquals(_operationalEnvServiceModelStatus.getModifyTime(),_modifyTime);
-
-	}
-
-	*//**
-	 * Test setModifyTime method
-	 *//*
-	@Test
-	public void testSetModifyTime() {
-		_operationalEnvServiceModelStatus.setModifyTime(_modifyTime);
-		verify(_operationalEnvServiceModelStatus).setModifyTime(_modifyTime);
-	}
-	*/
-
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestDatabaseTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestDatabaseTest.java
deleted file mode 100644
index a26f417..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestDatabaseTest.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.requestsdb;
-
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import org.junit.Test;
-
-public class RequestDatabaseTest {
-
-	@Test
-	public void testCheckVnfIdStatus() {
-		RequestsDatabase reqDb = mock(RequestsDatabase.class);
-		when(reqDb.checkVnfIdStatus(any(String.class))).thenReturn(new InfraActiveRequests());
-		
-		InfraActiveRequests response = reqDb.checkVnfIdStatus("123456");
-		assertNotNull(response);
-	}
-}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseTest.java
deleted file mode 100644
index aacdd96..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseTest.java
+++ /dev/null
@@ -1,287 +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.requestsdb;
-
-
-import mockit.Expectations;
-import mockit.Mocked;
-import mockit.integration.junit4.JMockit;
-import org.hibernate.Criteria;
-import org.hibernate.Query;
-import org.hibernate.SQLQuery;
-import org.hibernate.Session;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-
-import java.util.Arrays;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-@RunWith(JMockit.class)
-public class RequestsDatabaseTest {
-
-    RequestsDatabase requestsDatabase = RequestsDatabase.getInstance();
-
-    @Test
-    public void getInstanceTest() throws Exception {
-        RequestsDatabase instance = RequestsDatabase.getInstance();
-        assertEquals(RequestsDatabase.class, instance.getClass());
-    }
-
-    @Test
-    public void healthCheckTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                @Mocked Session session,
-                                @Mocked SQLQuery query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            session.createSQLQuery(" show tables "); result = query;
-            query.list(); result = Arrays.asList("table1", "table2");
-        }};
-
-        assertTrue(requestsDatabase.healthCheck());
-    }
-
-    @Test
-    public void updateInfraStatusTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                      @Mocked Session session,
-                                      @Mocked Query query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            query.executeUpdate(); result = 1;
-        }};
-        assertEquals(1, requestsDatabase.updateInfraStatus("123", "unknown", "unknown"));
-    }
-
-    @Test
-    public void updateInfraStatus1Test(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                       @Mocked Session session,
-                                       @Mocked Query query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            query.executeUpdate(); result = 1;
-        }};
-        assertEquals(1, requestsDatabase.updateInfraStatus("123", "unknown", 0, "unknown"));
-    }
-
-    @Test
-    public void updateInfraFinalStatusTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                           @Mocked Session session,
-                                           @Mocked Query query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            query.executeUpdate(); result = 1;
-        }};
-        assertEquals(1, requestsDatabase.updateInfraFinalStatus("123",
-                "unknown",
-                "statusMessage",
-                0,
-                "responsebody",
-                "lastmodifiedby"));
-    }
-
-    @Test
-    public void getRequestFromInfraActiveTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                              @Mocked Session session,
-                                              @Mocked Query query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            query.uniqueResult(); result = new InfraActiveRequests("123", "action");
-        }};
-        assertEquals("123",
-                requestsDatabase.getRequestFromInfraActive("123").getRequestId());
-    }
-
-    @Test
-    public void getOrchestrationFiltersFromInfraActiveTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                                           @Mocked Session session,
-                                                           @Mocked Criteria criteria) throws Exception {
-
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            session.createCriteria(InfraActiveRequests.class); result = criteria;
-            criteria.list(); result = Arrays.asList(new InfraActiveRequests("123", "action"));
-        }};
-        assertEquals(1,
-                requestsDatabase.getRequestListFromInfraActive("queryattr",
-                        "queryvalue",
-                        "type").size());
-    }
-
-    @Test
-    public void getRequestListFromInfraActiveTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                                  @Mocked Session session,
-                                                  @Mocked Query query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            session.createQuery("from InfraActiveRequests where (requestId = :requestId OR clientRequestId = :requestId) and requestType = :requestType"); result = query;
-            query.uniqueResult(); result = new InfraActiveRequests("123", "action");
-        }};
-        assertEquals("123",
-                requestsDatabase.getRequestFromInfraActive("123", "requestType").getRequestId());
-    }
-
-    @Test
-    public void getRequestFromInfraActive1Test(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                               @Mocked Session session,
-                                               @Mocked Criteria criteria) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            session.createCriteria(InfraActiveRequests.class); result = criteria;
-            criteria.list(); result = Arrays.asList(new InfraActiveRequests());
-        }};
-        assertEquals(1,
-                requestsDatabase.getRequestListFromInfraActive("queryAttr",
-                        "queryvalue",
-                        "type").size());
-    }
-
-    @Test
-    @Ignore // 1802 merge
-    public void checkDuplicateByVnfNameTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                            @Mocked Session session,
-                                            @Mocked Query query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            session.createQuery("from InfraActiveRequests where vnfName = :vnfName and action = :action and (requestStatus = 'PENDING' or requestStatus = 'IN_PROGRESS' or requestStatus = 'TIMEOUT') and requestType = :requestType ORDER BY startTime DESC"); result = query;
-            query.list(); result = Arrays.asList(new InfraActiveRequests("123", "action"));
-        }};
-        assertEquals("123",
-                requestsDatabase.checkDuplicateByVnfName("vnfname",
-                        "action",
-                        "requesttype").getRequestId());
-    }
-
-    @Test
-    @Ignore // 1802 merge
-    public void checkDuplicateByVnfIdTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                          @Mocked Session session,
-                                          @Mocked Query query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            session.createQuery("from InfraActiveRequests where vnfId = :vnfId and action = :action and (requestStatus = 'PENDING' or requestStatus = 'IN_PROGRESS' or requestStatus = 'TIMEOUT') and requestType = :requestType ORDER BY startTime DESC"); result = query;
-            query.list(); result = Arrays.asList(new InfraActiveRequests("123", "action"));
-        }};
-        assertEquals("123",
-                requestsDatabase.checkDuplicateByVnfId("vnfname",
-                        "action",
-                        "requesttype").getRequestId());
-    }
-
-    @Test
-    public void setMockDBTest() throws Exception {
-        requestsDatabase.setMockDB(null);
-    }
-
-    @Test
-    public void getSiteStatusTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                  @Mocked Session session,
-                                  @Mocked Query query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            session.createQuery("FROM SiteStatus WHERE siteName = :site_name"); result = query;
-            query.uniqueResult(); result = new SiteStatus();
-        }};
-        assertEquals(SiteStatus.class,
-                requestsDatabase.getSiteStatus("site").getClass());
-    }
-
-    @Test
-    public void updateSiteStatusTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                     @Mocked Session session,
-                                     @Mocked Query query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            session.createQuery("FROM SiteStatus WHERE siteName = :site_name"); result = query;
-            query.uniqueResult(); result = new SiteStatus();
-        }};
-        requestsDatabase.updateSiteStatus("site", true);
-    }
-
-    @Test
-    public void getOperationStatusTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                       @Mocked Session session,
-                                       @Mocked Query query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            session.createQuery("FROM OperationStatus WHERE SERVICE_ID = :service_id and OPERATION_ID = :operation_id"); result = query;
-            query.uniqueResult(); result = new OperationStatus();
-        }};
-        assertEquals(OperationStatus.class,
-                requestsDatabase.getOperationStatus("123",
-                        "Unknown").getClass());
-    }
-
-    @Test
-    public void getOperationStatusByServiceIdTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                                  @Mocked Session session,
-                                                  @Mocked Query query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            session.createQuery("FROM OperationStatus WHERE SERVICE_ID = :service_id order by OPERATE_AT desc"); result = query;
-            List<Object>list = query.list(); result = new OperationStatus();
-        }};
-        assertEquals(OperationStatus.class,
-                requestsDatabase.getOperationStatusByServiceId("123").getClass());
-    }
-
-    @Test
-    public void getOperationStatusByServiceNameTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                                    @Mocked Session session,
-                                                    @Mocked Query query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            session.createQuery("FROM OperationStatus WHERE SERVICE_NAME = :service_name"); result = query;
-            query.uniqueResult(); result = new OperationStatus();
-        }};
-        assertEquals(OperationStatus.class,
-                requestsDatabase.getOperationStatusByServiceName("servicename").getClass());
-    }
-
-    @Test
-    public void updateOperationStatusTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                          @Mocked Session session,
-                                          @Mocked Query query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            session.createQuery("FROM OperationStatus WHERE SERVICE_ID = :service_id and OPERATION_ID = :operation_id"); result = query;
-            query.uniqueResult(); result = new OperationStatus();
-        }};
-        requestsDatabase.updateOperationStatus(new OperationStatus());
-    }
-
-    @Test
-    public void getResourceOperationStatusTest(@Mocked AbstractSessionFactoryManager sessionFactoryManager,
-                                               @Mocked Session session,
-                                               @Mocked Query query) throws Exception {
-        new Expectations() {{
-            sessionFactoryManager.getSessionFactory().openSession(); result = session;
-            session.createQuery("FROM ResourceOperationStatus WHERE serviceId = :service_id and operationId = :operation_id and resourceTemplateUUID= :uuid"); result = query;
-            query.uniqueResult(); result = new ResourceOperationStatus();
-        }};
-        assertEquals(ResourceOperationStatus.class,
-                requestsDatabase.getResourceOperationStatus("serviceId",
-                        "operationid",
-                        "123-uuid").getClass());
-    }
-}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/ResourceOperationStatusTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/ResourceOperationStatusTest.java
deleted file mode 100644
index a9773c3..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/ResourceOperationStatusTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.requestsdb;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class ResourceOperationStatusTest {
-
-	ResourceOperationStatus ros=new ResourceOperationStatus();
-	ResourceOperationStatus ros1=new ResourceOperationStatus("serviceId", "operationId", "resourceTemplateUUID");
-	Object obj=new Object();
-	@Test
-	public void test() {
-	ros.setErrorCode("errorCode");
-	ros.setJobId("jobId");
-	ros.setOperationId("operationId");
-	ros.setOperType("operType");
-	ros.setProgress("progress");
-	ros.setResourceInstanceID("resourceInstanceID");
-	ros.setResourceTemplateUUID("resourceTemplateUUId");
-	ros.setServiceId("serviceId");
-	ros.setStatus("101");
-	ros.setStatusDescription("statusDescription");
-	
-	assertEquals(ros.getErrorCode(), "errorCode");
-	assertEquals(ros.getJobId(), "jobId");
-	assertEquals(ros.getOperationId(), "operationId");
-	assertEquals(ros.getOperType(), "operType");
-	assertEquals(ros.getProgress(), "progress");
-	assertEquals(ros.getResourceInstanceID(), "resourceInstanceID");
-	assertEquals(ros.getResourceTemplateUUID(), "resourceTemplateUUId");
-	assertEquals(ros.getServiceId(), "serviceId");
-	assertEquals(ros.getStatus(), "101");
-	assertEquals(ros.getStatusDescription(), "statusDescription");
-	ros.equals(obj);
-	ros.hashCode();
-	}
-
-}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusTest.java
deleted file mode 100644
index b989dac..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.requestsdb;
-
-import static org.junit.Assert.*;
-import java.sql.Timestamp;
-import org.junit.Test;
-
-public class SiteStatusTest {
-
-    SiteStatus ss=new SiteStatus();
-    Timestamp time=new Timestamp(10);
-    @Test
-    public void test() {
-      ss.setCreated(time);
-      ss.setSiteName("siteName");
-      ss.setStatus(true);
-      
-      assertEquals(ss.getCreated(), time);
-      assertEquals(ss.getSiteName(), "siteName");
-      assertEquals(ss.getStatus(), true);
-    }
-    @Test
-    public void testToString(){
-       assert(ss.toString()!=null);
-    }
-}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogComponentDistributionStatusDbTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogComponentDistributionStatusDbTest.java
deleted file mode 100644
index a86812e..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogComponentDistributionStatusDbTest.java
+++ /dev/null
@@ -1,127 +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.requestsdb;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.util.Arrays;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-
-
-public class WatchdogComponentDistributionStatusDbTest {
-
-	@Mock
-	private AbstractSessionFactoryManager sessionFactoryRequest;
-	@Mock
-	private SessionFactory sessionFactory;
-	@Mock
-	private Session session;
-
-	@Rule
-	public ExpectedException thrown = ExpectedException.none();
-
-	@Before
-	public void setUp() {
-		MockitoAnnotations.initMocks(this);
-		when(sessionFactory.openSession()).thenReturn(session);
-		when(sessionFactoryRequest.getSessionFactory()).thenReturn(sessionFactory);
-
-	}
-
-	@Test
-	public void insertFailure() {
-		WatchdogComponentDistributionStatusDb wds = new WatchdogComponentDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn(null);
-		when(session.isOpen()).thenReturn(true);
-		when(session.getTransaction()).thenThrow(Exception.class);
-		thrown.expect(Exception.class);
-
-		wds.insertWatchdogComponentDistributionStatus("myId", "myComponentName", "myStatus");
-	}
-
-
-	@Test
-	public void getWatchdogComponentNamesTest() {
-		WatchdogComponentDistributionStatusDb wds = new WatchdogComponentDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.list()).thenReturn(Arrays.asList("myValue"));
-		when(session.isOpen()).thenReturn(true);
-		assertEquals("myValue", wds.getWatchdogComponentNames("myId").get(0));
-	}
-
-	@Test
-	public void getWatchdogComponentDistributionStatusTest() {
-		WatchdogComponentDistributionStatusDb wds = new WatchdogComponentDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.list()).thenReturn(Arrays.asList("myValue"));
-		when(session.isOpen()).thenReturn(true);
-		assertEquals("myValue", wds.getWatchdogComponentDistributionStatus("myStatus").get(0));
-		assertEquals("myValue", wds.getWatchdogComponentDistributionStatus("myId", "myName").get(0));
-	}
-	
-	@Test
-	public void testGetWatchdogDistributionIdNotFound() {
-		WatchdogDistributionStatusDb wds = new WatchdogDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn(null);
-		when(session.isOpen()).thenReturn(true);
-		assertEquals(null, wds.getWatchdogDistributionId("test"));
-	}
-
-	@Test
-	public void testGetWatchdogDistributionIdStatus() {
-		WatchdogDistributionStatusDb wds = new WatchdogDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn("myValue");
-		when(session.isOpen()).thenReturn(true);
-		assertEquals("myValue", wds.getWatchdogDistributionIdStatus("test"));
-	}
-
-	@Test
-	public void testGetWatchdogDistributionIdStatusNotFound() {
-		WatchdogDistributionStatusDb wds = new WatchdogDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn(null);
-		when(session.isOpen()).thenReturn(true);
-		assertEquals(null, wds.getWatchdogDistributionIdStatus("test"));
-	}
-
-}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogComponentDistributionStatusTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogComponentDistributionStatusTest.java
deleted file mode 100644
index 0d68c12..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogComponentDistributionStatusTest.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.requestsdb;
-
-import static org.junit.Assert.assertEquals;
-import java.sql.Timestamp;
-import org.junit.Test;
-
-public class WatchdogComponentDistributionStatusTest {
-    
-  WatchdogComponentDistributionStatus wcds=new WatchdogComponentDistributionStatus();
-  Timestamp time=new Timestamp(10);
-  
-  @Test
-  public void test(){
-      wcds.setComponentDistributionStatus("componentDistributionStatus");
-      wcds.setComponentName("componentName");
-      wcds.setCreateTime(time);
-      wcds.setDistributionId("distributionId");
-      wcds.setModifyTime(time);
-      
-      assertEquals(wcds.getComponentDistributionStatus(), "componentDistributionStatus");
-      assertEquals(wcds.getComponentName(), "componentName");
-      assertEquals(wcds.getCreateTime(), time);
-      assertEquals(wcds.getDistributionId(), "distributionId");
-      assertEquals(wcds.getModifyTime(), time);
-  }
-}
-		
-	/*WatchdogComponentDistributionStatus _watchdogComponentDistributionStatus;
-	
-	protected String _distributionId;
-	protected String _componentName;
-	protected String _componentDistributionStatus;
-	protected Timestamp _createTime;
-	protected Timestamp _modifyTime;
-
-	public WatchdogComponentDistributionStatusTest() {
-	}
-	
-    @Before
-	public void setUp() {
-    	_watchdogComponentDistributionStatus = mock(WatchdogComponentDistributionStatus.class);
-    	_distributionId = "12abad84e7ff";
-    	_componentName = "MSO";
-    	_componentDistributionStatus = "SENT";	
-    	_createTime = new Timestamp (System.currentTimeMillis());
-    	_modifyTime = new Timestamp (System.currentTimeMillis());
-    	
-    	when(_watchdogComponentDistributionStatus.getDistributionId()).thenReturn(_distributionId);
-    	when(_watchdogComponentDistributionStatus.getComponentName()).thenReturn(_componentName);
-    	when(_watchdogComponentDistributionStatus.getComponentDistributionStatus()).thenReturn(_componentDistributionStatus);
-    	when(_watchdogComponentDistributionStatus.getCreateTime()).thenReturn(_createTime);
-    	when(_watchdogComponentDistributionStatus.getModifyTime()).thenReturn(_modifyTime);
-	}
-    
-	@After
-	public void tearDown() {
-		_watchdogComponentDistributionStatus = null;
-	}
-	
-	*//**
-	 * Test of getDistributionId method
-	 *//*
-	@Test
-	public void testGetDistributionId() {
-		_watchdogComponentDistributionStatus.setDistributionId(_distributionId);
-		assertEquals(_watchdogComponentDistributionStatus.getDistributionId(),_distributionId);
-
-	}
-
-	*//**
-	 * Test setDistributionId  method
-	 *//*
-	@Test
-	public void testSetDistributionId() {
-		_watchdogComponentDistributionStatus.setDistributionId(_distributionId);
-		verify(_watchdogComponentDistributionStatus).setDistributionId(_distributionId);
-	}
-	
-	*//**
-	 * Test of getDistributionId method
-	 *//*
-	@Test
-	public void testGetComponentName() {
-		_watchdogComponentDistributionStatus.setComponentName(_componentName);
-		assertEquals(_watchdogComponentDistributionStatus.getComponentName(),_componentName);
-
-	}
-
-	*//**
-	 * Test setDistributionId  method
-	 *//*
-	@Test
-	public void testSetComponentName() {
-		_watchdogComponentDistributionStatus.setComponentName(_componentName);
-		verify(_watchdogComponentDistributionStatus).setComponentName(_componentName);
-	}
-	
-	*//**
-	 * Test of getDistributionId method
-	 *//*
-	@Test
-	public void testGetComponentDistributionStatus() {
-		_watchdogComponentDistributionStatus.setComponentDistributionStatus(_componentDistributionStatus);
-		assertEquals(_watchdogComponentDistributionStatus.getComponentDistributionStatus(),_componentDistributionStatus);
-
-	}
-
-	*//**
-	 * Test setDistributionId  method
-	 *//*
-	@Test
-	public void testSetComponentDistributionStatus() {
-		_watchdogComponentDistributionStatus.setComponentDistributionStatus(_componentDistributionStatus);
-		verify(_watchdogComponentDistributionStatus).setComponentDistributionStatus(_componentDistributionStatus);
-	}
-	
-	*//**
-	 * Test of getCreateTime method
-	 *//*
-	@Test
-	public void testGetCreateTime() {
-		_watchdogComponentDistributionStatus.setCreateTime(_createTime);
-		System.out.println("CreateTime : " + _createTime);
-		assertEquals(_watchdogComponentDistributionStatus.getCreateTime(),_createTime);
-
-	}
-
-	*//**
-	 * Test setCreateTime method
-	 *//*
-	@Test
-	public void testSetCreateTime() {
-		_watchdogComponentDistributionStatus.setCreateTime(_createTime);
-		verify(_watchdogComponentDistributionStatus).setCreateTime(_createTime);
-	}
-	
-	*//**
-	 * Test of getModifyTime method
-	 *//*
-	@Test
-	public void testGetModifyTime() {
-		_watchdogComponentDistributionStatus.setModifyTime(_modifyTime);
-		System.out.println("ModifyTime : " + _modifyTime);
-		assertEquals(_watchdogComponentDistributionStatus.getModifyTime(),_modifyTime);
-
-	}
-
-	*//**
-	 * Test setModifyTime method
-	 *//*
-	@Test
-	public void testSetModifyTime() {
-		_watchdogComponentDistributionStatus.setModifyTime(_modifyTime);
-		verify(_watchdogComponentDistributionStatus).setModifyTime(_modifyTime);
-	}
-	
-}
-*/
\ No newline at end of file
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogDistributionStatusDbTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogDistributionStatusDbTest.java
deleted file mode 100644
index 3371018..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogDistributionStatusDbTest.java
+++ /dev/null
@@ -1,124 +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.requestsdb;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-
-public class WatchdogDistributionStatusDbTest {
-	
-    @Mock
-    private AbstractSessionFactoryManager sessionFactoryRequest;
-    @Mock
-    private SessionFactory sessionFactory;
-    @Mock
-    private Session session;
-    
-    @Rule
-    public ExpectedException thrown = ExpectedException.none();
-    
-    @Before
-    public void setUp() {
-    	MockitoAnnotations.initMocks(this);
-    	when(sessionFactory.openSession()).thenReturn(session);
-    	when(sessionFactoryRequest.getSessionFactory()).thenReturn(sessionFactory);
-    	
-    }
-
-	@Test
-	public void insertFailure() {
-		WatchdogDistributionStatusDb wds = new WatchdogDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn(null);
-		when(session.isOpen()).thenReturn(true);
-		when(session.getTransaction()).thenThrow(Exception.class);
-		thrown.expect(Exception.class);
-		
-		wds.insertWatchdogDistributionId("myId");
-	}
-	
-	@Test
-	public void updateFailure() {
-		WatchdogDistributionStatusDb wds = new WatchdogDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(session.isOpen()).thenReturn(true);
-		when(session.getTransaction()).thenThrow(Exception.class);
-		thrown.expect(Exception.class);
-		
-		wds.updateWatchdogDistributionIdStatus("myId", "myStatus");
-	}
-	
-	@Test
-	public void testGetWatchdogDistributionId() {
-		WatchdogDistributionStatusDb wds = new WatchdogDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn("myValue");
-		when(session.isOpen()).thenReturn(true);
-		assertEquals("myValue", wds.getWatchdogDistributionId("test"));
-	}
-	
-	@Test
-	public void testGetWatchdogDistributionIdNotFound() {
-		WatchdogDistributionStatusDb wds = new WatchdogDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn(null);
-		when(session.isOpen()).thenReturn(true);
-		assertEquals(null, wds.getWatchdogDistributionId("test"));
-	}
-	
-	@Test
-	public void testGetWatchdogDistributionIdStatus() {
-		WatchdogDistributionStatusDb wds = new WatchdogDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn("myValue");
-		when(session.isOpen()).thenReturn(true);
-		assertEquals("myValue", wds.getWatchdogDistributionIdStatus("test"));
-	}
-	
-	@Test
-	public void testGetWatchdogDistributionIdStatusNotFound() {
-		WatchdogDistributionStatusDb wds = new WatchdogDistributionStatusDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn(null);
-		when(session.isOpen()).thenReturn(true);
-		assertEquals(null, wds.getWatchdogDistributionIdStatus("test"));
-	}
-	
-}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogDistributionStatusTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogDistributionStatusTest.java
deleted file mode 100644
index c10d7ae..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogDistributionStatusTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.requestsdb;
-
-import static org.junit.Assert.assertEquals;
-import java.sql.Timestamp;
-import org.junit.Test;
-
-public class WatchdogDistributionStatusTest {
-	
-	WatchdogDistributionStatus wds=new WatchdogDistributionStatus();
-	Timestamp time=new Timestamp(10);
-	@Test
-	public void test() {
-	wds.setCreateTime(time);
-	wds.setDistributionId("distributionId");
-	wds.setDistributionIdStatus("distributionIdStatus");
-	wds.setModifyTime(time);
-	
-	assertEquals(wds.getCreateTime(), time);
-	assertEquals(wds.getDistributionId(), "distributionId");
-	assertEquals(wds.getDistributionIdStatus(), "distributionIdStatus");
-	assertEquals(wds.getModifyTime(), time);
-
-	}
-
-
-/*	WatchdogDistributionStatus _watchdogDistributionStatus;
-	
-	protected String _distributionId;
-	protected String _distributionIdStatus;
-	protected Timestamp _createTime;
-	protected Timestamp _modifyTime;
-	
-	public WatchdogDistributionStatusTest() {
-	}
-	
-    @Before
-	public void setUp() {
-    	_watchdogDistributionStatus = mock(WatchdogDistributionStatus.class);
-    	_distributionId = "12abad84e7ff";
-    	_distributionIdStatus = "SENT";	
-    	_createTime = new Timestamp (System.currentTimeMillis());
-    	_modifyTime = new Timestamp (System.currentTimeMillis());
-    	
-    	when(_watchdogDistributionStatus.getDistributionId()).thenReturn(_distributionId);
-    	when(_watchdogDistributionStatus.getDistributionIdStatus()).thenReturn(_distributionIdStatus);
-    	when(_watchdogDistributionStatus.getCreateTime()).thenReturn(_createTime);
-    	when(_watchdogDistributionStatus.getModifyTime()).thenReturn(_modifyTime);
-	}
-    
-	@After
-	public void tearDown() {
-		_watchdogDistributionStatus = null;
-	}
-	
-	*//**
-	 * Test of getDistributionId method
-	 *//*
-	@Test
-	public void testGetDistributionId() {
-		_watchdogDistributionStatus.setDistributionId(_distributionId);
-		assertEquals(_watchdogDistributionStatus.getDistributionId(),_distributionId);
-
-	}
-
-	*//**
-	 * Test setDistributionId  method
-	 *//*
-	@Test
-	public void testSetDistributionId() {
-		_watchdogDistributionStatus.setDistributionId(_distributionId);
-		verify(_watchdogDistributionStatus).setDistributionId(_distributionId);
-	}
-	
-	*//**
-	 * Test of getDistributionIdStatus method
-	 *//*
-	@Test
-	public void testGetComponentDistributionStatus() {
-		_watchdogDistributionStatus.setDistributionIdStatus(_distributionIdStatus);
-		assertEquals(_watchdogDistributionStatus.getDistributionIdStatus(),_distributionIdStatus);
-
-	}
-
-	*//**
-	 * Test setDistributionIdStatus  method
-	 *//*
-	@Test
-	public void testSetComponentDistributionStatus() {
-		_watchdogDistributionStatus.setDistributionIdStatus(_distributionIdStatus);
-		verify(_watchdogDistributionStatus).setDistributionIdStatus(_distributionIdStatus);
-	}
-	
-	*//**
-	 * Test of getCreateTime method
-	 *//*
-	@Test
-	public void testGetCreateTime() {
-		_watchdogDistributionStatus.setCreateTime(_createTime);
-		assertEquals(_watchdogDistributionStatus.getCreateTime(),_createTime);
-
-	}
-
-	*//**
-	 * Test setCreateTime method
-	 *//*
-	@Test
-	public void testSetCreateTime() {
-		_watchdogDistributionStatus.setCreateTime(_createTime);
-		verify(_watchdogDistributionStatus).setCreateTime(_createTime);
-	}
-	
-	*//**
-	 * Test of getModifyTime method
-	 *//*
-	@Test
-	public void testGetModifyTime() {
-		_watchdogDistributionStatus.setModifyTime(_modifyTime);
-		assertEquals(_watchdogDistributionStatus.getModifyTime(),_modifyTime);
-
-	}
-
-	*//**
-	 * Test setModifyTime method
-	 *//*
-	@Test
-	public void testSetModifyTime() {
-		_watchdogDistributionStatus.setModifyTime(_modifyTime);
-		verify(_watchdogDistributionStatus).setModifyTime(_modifyTime);
-	}*/
-}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogServiceModVerIdLookupDbTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogServiceModVerIdLookupDbTest.java
deleted file mode 100644
index 42224b0..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogServiceModVerIdLookupDbTest.java
+++ /dev/null
@@ -1,86 +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.requestsdb;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.mso.db.AbstractSessionFactoryManager;
-
-
-public class WatchdogServiceModVerIdLookupDbTest {
-	@Mock
-	private AbstractSessionFactoryManager sessionFactoryRequest;
-	@Mock
-	private SessionFactory sessionFactory;
-	@Mock
-	private Session session;
-
-	@Rule
-	public ExpectedException thrown = ExpectedException.none();
-
-	@Before
-	public void setUp() {
-		MockitoAnnotations.initMocks(this);
-		when(sessionFactory.openSession()).thenReturn(session);
-		when(sessionFactoryRequest.getSessionFactory()).thenReturn(sessionFactory);
-
-	}
-	
-	@Test
-	public void getWatchdogServiceModVerIdTest() {
-		WatchdogServiceModVerIdLookupDb wds = new WatchdogServiceModVerIdLookupDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn(null);
-		when(session.isOpen()).thenReturn(true);
-		assertEquals(null, wds.getWatchdogServiceModVerId("test"));
-	}
-	
-	@Test
-	public void insertWatchdogServiceModVerIdLookupTest() {
-		WatchdogServiceModVerIdLookupDb wds = new WatchdogServiceModVerIdLookupDb(this.sessionFactoryRequest);
-		Query mockQuery = mock(Query.class);
-		when(session.createQuery(any(String.class))).thenReturn(mockQuery);
-		when(mockQuery.uniqueResult()).thenReturn(null);
-		when(session.isOpen()).thenReturn(true);
-		when(session.getTransaction()).thenThrow(Exception.class);
-		thrown.expect(Exception.class);
-		
-		wds.insertWatchdogServiceModVerIdLookup("myId", "myModelVersion");
-	}
-
-	
-}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogServiceModVerIdLookupTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogServiceModVerIdLookupTest.java
deleted file mode 100644
index d27c1b8..0000000
--- a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/WatchdogServiceModVerIdLookupTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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.requestsdb;
-
-import static org.junit.Assert.assertEquals;
-import java.sql.Timestamp;
-import org.junit.Test;
-
-public class WatchdogServiceModVerIdLookupTest {
-    
-    WatchdogServiceModVerIdLookup wsmil=new WatchdogServiceModVerIdLookup();
-    Timestamp time=new Timestamp(10);
-    @Test
-    public void test(){
-        wsmil.setCreateTime(time);
-        wsmil.setDistributionId("distributionId");
-        wsmil.setServiceModelVersionId("serviceModelVersionId");
-        
-        assertEquals(wsmil.getCreateTime(),time);
-        assertEquals(wsmil.getDistributionId(), "distributionId");
-        assertEquals(wsmil.getServiceModelVersionId(), "serviceModelVersionId");
-    }
-}
-/*WatchdogServiceModVerIdLookup _watchdogServiceModVerIdLookup;
-	
-	protected String _distributionId;
-	protected String _serviceModelVersionId;
-	protected Timestamp _createTime;
-	
-	public WatchdogServiceModVerIdLookupTest() {
-	}
-	
-    @Before
-	public void setUp() {
-    	_watchdogServiceModVerIdLookup = mock(WatchdogServiceModVerIdLookup.class);
-    	_serviceModelVersionId = "12abad84e7ff";
-    	_createTime = new Timestamp (System.currentTimeMillis());
-    	
-    	when(_watchdogServiceModVerIdLookup.getDistributionId()).thenReturn(_distributionId);
-    	when(_watchdogServiceModVerIdLookup.getServiceModelVersionId()).thenReturn(_serviceModelVersionId);
-    	when(_watchdogServiceModVerIdLookup.getCreateTime()).thenReturn(_createTime);
-	}
-    
-	@After
-	public void tearDown() {
-		_watchdogServiceModVerIdLookup = null;
-	}
-	
-	*//**
-	 * Test of getDistributionId method
-	 *//*
-	@Test
-	public void testGetDistributionId() {
-		_watchdogServiceModVerIdLookup.setDistributionId(_distributionId);
-		assertEquals(_watchdogServiceModVerIdLookup.getDistributionId(),_distributionId);
-
-	}
-
-	*//**
-	 * Test setDistributionId  method
-	 *//*
-	@Test
-	public void testSetDistributionId() {
-		_watchdogServiceModVerIdLookup.setDistributionId(_distributionId);
-		verify(_watchdogServiceModVerIdLookup).setDistributionId(_distributionId);
-	}
-	
-	*//**
-	 * Test of getServiceModelVersionId method
-	 *//*
-	@Test
-	public void testGetServiceModelVersionId() {
-		_watchdogServiceModVerIdLookup.setServiceModelVersionId(_serviceModelVersionId);
-		assertEquals(_watchdogServiceModVerIdLookup.getServiceModelVersionId(),_serviceModelVersionId);
-
-	}
-
-	*//**
-	 * Test setServiceModelVersionId  method
-	 *//*
-	@Test
-	public void testSetServiceModelVersionId() {
-		_watchdogServiceModVerIdLookup.setServiceModelVersionId(_serviceModelVersionId);
-		verify(_watchdogServiceModVerIdLookup).setServiceModelVersionId(_serviceModelVersionId);
-	}
-	
-	*//**
-	 * Test of getCreateTime method
-	 *//*
-	@Test
-	public void testGetCreateTime() {
-		_watchdogServiceModVerIdLookup.setCreateTime(_createTime);
-		assertEquals(_watchdogServiceModVerIdLookup.getCreateTime(),_createTime);
-
-	}
-
-	*//**
-	 * Test setCreateTime method
-	 *//*
-	@Test
-	public void testSetCreateTime() {
-		_watchdogServiceModVerIdLookup.setCreateTime(_createTime);
-		verify(_watchdogServiceModVerIdLookup).setCreateTime(_createTime);
-	}
-	
-}*/
\ No newline at end of file
diff --git a/mso-api-handlers/mso-requests-db/src/test/resources/application-test.yaml b/mso-api-handlers/mso-requests-db/src/test/resources/application-test.yaml
new file mode 100644
index 0000000..c8e90c3
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/resources/application-test.yaml
@@ -0,0 +1,40 @@
+# will be used as entry in DB to say SITE OFF/ON for healthcheck
+
+server:
+    port: 8080
+    tomcat:
+        max-threads: 50
+ssl-enable: false
+mso:
+  site-name: localDevEnv
+  logPath: logs
+# H2
+spring:
+  datasource:
+    url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;
+    username: sa
+    password: sa
+    driver-class-name: org.h2.Driver
+  h2:
+    console:
+      enabled: true
+      path: /h2
+
+  jpa:
+      show-sql: true
+      hibernate:
+        dialect: org.hibernate.dialect.MySQL5Dialect
+        ddl-auto: none
+        naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
+        enable-lazy-load-no-trans: true
+
+
+#Actuator
+management:
+  security:
+    enabled: false
+    basic:
+      enabled: false
+
+
+
diff --git a/mso-api-handlers/mso-requests-db/src/test/resources/logback-test.xml b/mso-api-handlers/mso-requests-db/src/test/resources/logback-test.xml
new file mode 100644
index 0000000..1951484
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/resources/logback-test.xml
@@ -0,0 +1,46 @@
+<configuration >
+  
+  
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n</pattern>
+    </encoder>
+  </appender>
+
+
+  <logger name="com.att.ecomp.audit" level="info" additivity="false">
+    <appender-ref ref="STDOUT" />
+  </logger>
+  
+  <logger name="com.att.eelf.metrics" level="info" additivity="false">
+        <appender-ref ref="STDOUT" />
+  </logger>
+
+  <logger name="com.att.eelf.error" level="trace" additivity="false">
+    <appender-ref ref="STDOUT" />
+  </logger> 
+
+	<logger name="org.onap" level="${so.log.level:-DEBUG}" additivity="false">
+		<appender-ref ref="STDOUT" />
+	</logger>
+  <root level="debug">
+    <appender-ref ref="STDOUT" />
+  </root>
+  
+ 	<!-- Spring related loggers -->
+	<logger name="org.springframework" level="WARN" />
+	<logger name="org.springframework.beans" level="WARN" />
+	<logger name="org.springframework.web" level="WARN" />
+	<logger name="com.blog.spring.jms" level="WARN" />
+	
+	<logger name="org.hibernate" level="WARN" />
+
+	
+	<!-- Tomcat related loggers -->
+	<logger name="org.apache.tomcat.util.digester.Digester" level="WARN" />
+	<logger name="org.apache.tomcat.util.modeler.modules.*" level="WARN" />
+	<logger name="org.apache.tomcat.util.IntrospectionUtils" level="WARN" />
+	<logger name="org.apache.catalina.loader.WebappClassLoaderBase" level="WARN" />
+	<logger name="wiremock.org.eclipse.jetty" level="WARN" />
+
+</configuration>
\ No newline at end of file
diff --git a/mso-api-handlers/mso-requests-db/src/test/resources/schema.sql b/mso-api-handlers/mso-requests-db/src/test/resources/schema.sql
new file mode 100644
index 0000000..a01153a
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/resources/schema.sql
@@ -0,0 +1,212 @@
+
+create table ACTIVATE_OPERATIONAL_ENV_SERVICE_MODEL_DISTRIBUTION_STATUS (
+        REQUEST_ID varchar(255) not null,
+        OPERATIONAL_ENV_ID varchar(255) not null,
+		SERVICE_MODEL_VERSION_ID varchar(255) not null,
+		SERVICE_MOD_VER_FINAL_DISTR_STATUS varchar(255),
+		RECOVERY_ACTION varchar(255),
+		RETRY_COUNT_LEFT varchar(255),
+		WORKLOAD_CONTEXT varchar(255),
+		CREATE_TIME datetime,
+		MODIFY_TIME datetime,
+        primary key (REQUEST_ID,OPERATIONAL_ENV_ID, SERVICE_MODEL_VERSION_ID)
+    );
+    
+create table OPERATION_STATUS (
+        SERVICE_ID varchar(255) not null,
+        OPERATION_ID varchar(255) not null,
+        SERVICE_NAME varchar(255),
+		OPERATION_TYPE varchar(255),
+		USER_ID varchar(255),
+		RESULT varchar(255),
+		OPERATION_CONTENT varchar(255),
+		PROGRESS varchar(255),
+		REASON varchar(255),
+        OPERATE_AT datetime,
+		FINISHED_AT datetime,
+        primary key (SERVICE_ID,OPERATION_ID)
+    );
+    
+    
+INSERT INTO PUBLIC.OPERATION_STATUS(SERVICE_ID, OPERATION_ID, OPERATION_TYPE, USER_ID, RESULT, OPERATION_CONTENT, PROGRESS, REASON, OPERATE_AT, FINISHED_AT) VALUES
+('serviceId', 'operationId', 'operationType', 'userId', 'result', 'operationContent', 'progress', 'reason', '2016-11-24 13:19:10', '2016-11-24 13:19:10'); 
+
+	create table RESOURCE_OPERATION_STATUS (
+        SERVICE_ID varchar(255) not null,
+        OPERATION_ID varchar(255) not null,
+        RESOURCE_TEMPLATE_UUID varchar(255) not null,
+		OPER_TYPE varchar(255),
+		RESOURCE_INSTANCE_ID varchar(255),
+		JOB_ID varchar(255),
+		STATUS varchar(255),
+		PROGRESS varchar(255),
+		ERROR_CODE varchar(255) ,
+		STATUS_DESCRIPOTION varchar(255) ,
+        primary key (SERVICE_ID,OPERATION_ID,RESOURCE_TEMPLATE_UUID)
+    );
+
+CREATE CACHED TABLE PUBLIC.INFRA_ACTIVE_REQUESTS(
+    REQUEST_ID VARCHAR NOT NULL SELECTIVITY 100,
+    CLIENT_REQUEST_ID VARCHAR SELECTIVITY 6,
+    ACTION VARCHAR SELECTIVITY 1,
+    REQUEST_STATUS VARCHAR SELECTIVITY 1,
+    STATUS_MESSAGE longtext SELECTIVITY 36,
+    PROGRESS VARCHAR SELECTIVITY 1,
+    START_TIME VARCHAR,
+    END_TIME VARCHAR,
+    SOURCE VARCHAR SELECTIVITY 2,
+    VNF_ID VARCHAR SELECTIVITY 15,
+    VNF_NAME VARCHAR SELECTIVITY 11,
+    VNF_TYPE VARCHAR SELECTIVITY 5,
+    SERVICE_TYPE VARCHAR SELECTIVITY 1,
+    AIC_NODE_CLLI VARCHAR SELECTIVITY 1,
+    TENANT_ID VARCHAR SELECTIVITY 2,
+    PROV_STATUS VARCHAR SELECTIVITY 1,
+    VNF_PARAMS VARCHAR SELECTIVITY 1,
+    VNF_OUTPUTS VARCHAR SELECTIVITY 3,
+    REQUEST_BODY VARCHAR SELECTIVITY 79,
+    RESPONSE_BODY VARCHAR SELECTIVITY 7,
+    LAST_MODIFIED_BY VARCHAR SELECTIVITY 2,
+    MODIFY_TIME VARCHAR,
+    REQUEST_TYPE VARCHAR SELECTIVITY 1,
+    VOLUME_GROUP_ID VARCHAR SELECTIVITY 2,
+    VOLUME_GROUP_NAME VARCHAR SELECTIVITY 3,
+    VF_MODULE_ID VARCHAR SELECTIVITY 5,
+    VF_MODULE_NAME VARCHAR SELECTIVITY 8,
+    VF_MODULE_MODEL_NAME VARCHAR SELECTIVITY 3,
+    AAI_SERVICE_ID VARCHAR SELECTIVITY 1,
+    AIC_CLOUD_REGION VARCHAR SELECTIVITY 1,
+    CALLBACK_URL VARCHAR SELECTIVITY 1,
+    CORRELATOR VARCHAR SELECTIVITY 1,
+    NETWORK_ID VARCHAR SELECTIVITY 2,
+    NETWORK_NAME VARCHAR SELECTIVITY 4,
+    NETWORK_TYPE VARCHAR SELECTIVITY 1,
+    REQUEST_SCOPE VARCHAR SELECTIVITY 1,
+    REQUEST_ACTION VARCHAR SELECTIVITY 1,
+    SERVICE_INSTANCE_ID VARCHAR SELECTIVITY 34,
+    SERVICE_INSTANCE_NAME VARCHAR SELECTIVITY 25,
+    REQUESTOR_ID VARCHAR SELECTIVITY 2,
+    CONFIGURATION_ID VARCHAR SELECTIVITY 1,
+    CONFIGURATION_NAME VARCHAR SELECTIVITY 2,
+    OPERATIONAL_ENV_ID VARCHAR SELECTIVITY 1,
+    OPERATIONAL_ENV_NAME VARCHAR SELECTIVITY 1
+);          
+
+INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, AIC_CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME) VALUES
+('00032ab7-3fb3-42e5-965d-8ea592502017', '00032ab7-3fb3-42e5-965d-8ea592502016', 'deleteInstance', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"modelInfo":{"modelType":"vfModule","modelName":"vSAMP10aDEV::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"mtn6"}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'vSAMP10aDEV::base::module-0', null, 'mtn6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null),
+('00093944-bf16-4373-ab9a-3adfe730ff2d', null, 'createInstance', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_vSAMP10a_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"MSOTADevInfra_vSAMP10a_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_vSAMP10a_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarteSet":true,"alaCarte":true}}', null, 'APIH', null, null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_vSAMP10a_011-4', 'xxxxxx', null, null, null, null),
+('001619d2-a297-4a4b-a9f5-e2823c88458f', '001619d2-a297-4a4b-a9f5-e2823c88458f', 'CREATE_VF_MODULE', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, null, STRINGDECODE('<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<vnf-request xmlns=\"http://org.onap.so/mso/infra/vnf-request/v1\">\n    <request-info>\n        <request-id>001619d2-a297-4a4b-a9f5-e2823c88458f</request-id>\n        <action>CREATE_VF_MODULE</action>\n        <source>PORTAL</source>\n    </request-info>\n    <vnf-inputs>\n        <vnf-name>test-vscp</vnf-name>\n        <vf-module-name>moduleName</vf-module-name>\n        <vnf-type>elena_test21</vnf-type>\n        <vf-module-model-name>moduleModelName</vf-module-model-name>\n        <asdc-service-model-version>1.0</asdc-service-model-version>\n        <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>\n        <aic-cloud-region>mtn9</aic-cloud-region>\n        <tenant-id>381b9ff6c75e4625b7a4182f90fc68d3</tenant-id>\n        <persona-model-id></persona-model-id>\n        <persona-model-version></persona-model-version>\n        <is-base-vf-module>false</is-base-vf-module>\n    </vnf-inputs>\n    <vnf-params xmlns:tns=\"http://org.onap.so/mso/infra/vnf-request/v1\"/>\n</vnf-request>\n'), 'NONE', 'RDBTEST', '2016-07-01 14:11:42', 'VNF', null, null, null, 'MODULENAME1', 'moduleModelName', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null);           
+INSERT INTO PUBLIC.INFRA_ACTIVE_REQUESTS(REQUEST_ID, CLIENT_REQUEST_ID, ACTION, REQUEST_STATUS, STATUS_MESSAGE, PROGRESS, START_TIME, END_TIME, SOURCE, VNF_ID, VNF_NAME, VNF_TYPE, SERVICE_TYPE, AIC_NODE_CLLI, TENANT_ID, PROV_STATUS, VNF_PARAMS, VNF_OUTPUTS, REQUEST_BODY, RESPONSE_BODY, LAST_MODIFIED_BY, MODIFY_TIME, REQUEST_TYPE, VOLUME_GROUP_ID, VOLUME_GROUP_NAME, VF_MODULE_ID, VF_MODULE_NAME, VF_MODULE_MODEL_NAME, AAI_SERVICE_ID, AIC_CLOUD_REGION, CALLBACK_URL, CORRELATOR, NETWORK_ID, NETWORK_NAME, NETWORK_TYPE, REQUEST_SCOPE, REQUEST_ACTION, SERVICE_INSTANCE_ID, SERVICE_INSTANCE_NAME, REQUESTOR_ID, CONFIGURATION_ID, CONFIGURATION_NAME, OPERATIONAL_ENV_ID, OPERATIONAL_ENV_NAME) VALUES
+('00164b9e-784d-48a8-8973-bbad6ef818ed', null, 'createInstance', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-MTN6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-MTN6-3100-0927-1', 'md5621', null, null, null, null),
+('00173cc9-5ce2-4673-a810-f87fefb2829e', null, 'createInstance', 'FAILED', 'Error parsing request.  No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, null, '{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}', null, 'APIH', null, null, null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null),
+('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', null, 'activateInstance', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', null, 'VID', null, null, null, null, null, null, null, null, null, '{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"MSOTADevInfra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":false},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null);        
+
+CREATE CACHED TABLE PUBLIC.ARCHIVED_INFRA_REQUESTS(
+    REQUEST_ID VARCHAR NOT NULL SELECTIVITY 100,
+    CLIENT_REQUEST_ID VARCHAR SELECTIVITY 6,
+    ACTION VARCHAR SELECTIVITY 1,
+    REQUEST_STATUS VARCHAR SELECTIVITY 1,
+    STATUS_MESSAGE longtext SELECTIVITY 36,
+    PROGRESS VARCHAR SELECTIVITY 1,
+    START_TIME VARCHAR,
+    END_TIME VARCHAR,
+    SOURCE VARCHAR SELECTIVITY 2,
+    VNF_ID VARCHAR SELECTIVITY 15,
+    VNF_NAME VARCHAR SELECTIVITY 11,
+    VNF_TYPE VARCHAR SELECTIVITY 5,
+    SERVICE_TYPE VARCHAR SELECTIVITY 1,
+    AIC_NODE_CLLI VARCHAR SELECTIVITY 1,
+    TENANT_ID VARCHAR SELECTIVITY 2,
+    PROV_STATUS VARCHAR SELECTIVITY 1,
+    VNF_PARAMS VARCHAR SELECTIVITY 1,
+    VNF_OUTPUTS VARCHAR SELECTIVITY 3,
+    REQUEST_BODY VARCHAR SELECTIVITY 79,
+    RESPONSE_BODY VARCHAR SELECTIVITY 7,
+    LAST_MODIFIED_BY VARCHAR SELECTIVITY 2,
+    MODIFY_TIME VARCHAR,
+    REQUEST_TYPE VARCHAR SELECTIVITY 1,
+    VOLUME_GROUP_ID VARCHAR SELECTIVITY 2,
+    VOLUME_GROUP_NAME VARCHAR SELECTIVITY 3,
+    VF_MODULE_ID VARCHAR SELECTIVITY 5,
+    VF_MODULE_NAME VARCHAR SELECTIVITY 8,
+    VF_MODULE_MODEL_NAME VARCHAR SELECTIVITY 3,
+    AAI_SERVICE_ID VARCHAR SELECTIVITY 1,
+    AIC_CLOUD_REGION VARCHAR SELECTIVITY 1,
+    CALLBACK_URL VARCHAR SELECTIVITY 1,
+    CORRELATOR VARCHAR SELECTIVITY 1,
+    NETWORK_ID VARCHAR SELECTIVITY 2,
+    NETWORK_NAME VARCHAR SELECTIVITY 4,
+    NETWORK_TYPE VARCHAR SELECTIVITY 1,
+    REQUEST_SCOPE VARCHAR SELECTIVITY 1,
+    REQUEST_ACTION VARCHAR SELECTIVITY 1,
+    SERVICE_INSTANCE_ID VARCHAR SELECTIVITY 34,
+    SERVICE_INSTANCE_NAME VARCHAR SELECTIVITY 25,
+    REQUESTOR_ID VARCHAR SELECTIVITY 2,
+    CONFIGURATION_ID VARCHAR SELECTIVITY 1,
+    CONFIGURATION_NAME VARCHAR SELECTIVITY 2,
+    OPERATIONAL_ENV_ID VARCHAR SELECTIVITY 1,
+    OPERATIONAL_ENV_NAME VARCHAR SELECTIVITY 1
+);
+
+CREATE CACHED TABLE PUBLIC.SITE_STATUS(
+    SITE_NAME VARCHAR NOT NULL,
+    STATUS VARCHAR,
+    CREATION_TIMESTAMP VARCHAR
+);             
+    
+INSERT INTO PUBLIC.SITE_STATUS(SITE_NAME, STATUS, CREATION_TIMESTAMP) VALUES
+('testSite', '0', '2017-11-30 15:48:09'),
+('test name', null, null),
+('test name2', '1', null),
+('test name3', '1', null),
+('test name4', '1', '2017-11-30 15:48:09'),
+('test name update', '0', null);
+         
+CREATE CACHED TABLE PUBLIC.WATCHDOG_DISTRIBUTIONID_STATUS(
+    DISTRIBUTION_ID VARCHAR NOT NULL,
+    DISTRIBUTION_ID_STATUS VARCHAR,
+    CREATE_TIME VARCHAR,
+    MODIFY_TIME VARCHAR
+); 
+           
+        
+INSERT INTO PUBLIC.WATCHDOG_DISTRIBUTIONID_STATUS(DISTRIBUTION_ID, DISTRIBUTION_ID_STATUS, CREATE_TIME, MODIFY_TIME) VALUES
+('1533c4bd-a3e3-493f-a16d-28c20614415e', '', '2017-11-30 15:48:09', '2017-11-30 15:48:09'),
+('55429711-809b-4a3b-9ee5-5120d46d9de0', '', '2017-11-30 16:35:36', '2017-11-30 16:35:36'),
+('67f0b2d1-9013-4b2b-9914-bbe2288284fb', '', '2017-11-30 15:54:39', '2017-11-30 15:54:39');   
+
+CREATE CACHED TABLE PUBLIC.WATCHDOG_PER_COMPONENT_DISTRIBUTION_STATUS(
+    DISTRIBUTION_ID VARCHAR NOT NULL,
+    COMPONENT_NAME VARCHAR NOT NULL,
+    COMPONENT_DISTRIBUTION_STATUS VARCHAR,
+    CREATE_TIME VARCHAR,
+    MODIFY_TIME VARCHAR
+);        
+
+           
+INSERT INTO PUBLIC.WATCHDOG_PER_COMPONENT_DISTRIBUTION_STATUS(DISTRIBUTION_ID, COMPONENT_NAME, COMPONENT_DISTRIBUTION_STATUS, CREATE_TIME, MODIFY_TIME) VALUES
+('1533c4bd-a3e3-493f-a16d-28c20614415e', 'MSO', 'COMPONENT_DONE_OK', '2017-11-30 15:48:09', '2017-11-30 15:48:09'),
+('55429711-809b-4a3b-9ee5-5120d46d9de0', 'MSO', 'COMPONENT_DONE_ERROR', '2017-11-30 16:35:36', '2017-11-30 16:35:36'),
+('67f0b2d1-9013-4b2b-9914-bbe2288284fb', 'MSO', 'COMPONENT_DONE_OK', '2017-11-30 15:54:39', '2017-11-30 15:54:39');        
+
+CREATE CACHED TABLE PUBLIC.WATCHDOG_SERVICE_MOD_VER_ID_LOOKUP(
+    DISTRIBUTION_ID VARCHAR NOT NULL,
+    SERVICE_MODEL_VERSION_ID VARCHAR NOT NULL,
+    CREATE_TIME VARCHAR,
+    MODIFY_TIME VARCHAR
+);
+        
+  
+INSERT INTO PUBLIC.WATCHDOG_SERVICE_MOD_VER_ID_LOOKUP(DISTRIBUTION_ID, SERVICE_MODEL_VERSION_ID, CREATE_TIME, MODIFY_TIME) VALUES
+('1533c4bd-a3e3-493f-a16d-28c20614415e', '7e813ab5-88d3-4fcb-86c0-498c5d7eef9a', '2017-11-30 15:48:08', '2017-11-30 15:48:08'),
+('55429711-809b-4a3b-9ee5-5120d46d9de0', 'cc031e75-4442-4d1a-b774-8a2b434e0a50', '2017-11-30 16:35:36', '2017-11-30 16:35:36'),
+('67f0b2d1-9013-4b2b-9914-bbe2288284fb', 'eade1e9d-c1ec-4ef3-bc31-60570fba1573', '2017-11-30 15:54:39', '2017-11-30 15:54:39');    
+
+ALTER TABLE PUBLIC.INFRA_ACTIVE_REQUESTS ADD CONSTRAINT PUBLIC.CONSTRAINT_E PRIMARY KEY(REQUEST_ID);          
+ALTER TABLE PUBLIC.SITE_STATUS ADD CONSTRAINT PUBLIC.CONSTRAINT_C PRIMARY KEY(SITE_NAME); 
+ALTER TABLE PUBLIC.WATCHDOG_DISTRIBUTIONID_STATUS ADD CONSTRAINT PUBLIC.CONSTRAINT_7 PRIMARY KEY(DISTRIBUTION_ID); 
+ALTER TABLE PUBLIC.WATCHDOG_PER_COMPONENT_DISTRIBUTION_STATUS ADD CONSTRAINT PUBLIC.CONSTRAINT_D PRIMARY KEY(DISTRIBUTION_ID, COMPONENT_NAME);
+ALTER TABLE PUBLIC.WATCHDOG_SERVICE_MOD_VER_ID_LOOKUP ADD CONSTRAINT PUBLIC.CONSTRAINT_6 PRIMARY KEY(DISTRIBUTION_ID, SERVICE_MODEL_VERSION_ID);   
+ALTER TABLE PUBLIC.WATCHDOG_PER_COMPONENT_DISTRIBUTION_STATUS ADD CONSTRAINT PUBLIC.CONSTRAINT_DE FOREIGN KEY(DISTRIBUTION_ID) REFERENCES PUBLIC.WATCHDOG_DISTRIBUTIONID_STATUS(DISTRIBUTION_ID) NOCHECK; 
+                   
+ 
