diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandler.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandler.java
new file mode 100644
index 0000000..22fcdda
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/HealthCheckHandler.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - 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=========================================================
+ */
+
+package org.openecomp.mso.adapters.requestsdb;
+
+
+import javax.ws.rs.GET;
+import javax.ws.rs.HEAD;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.mso.HealthCheckUtils;
+import org.openecomp.mso.utils.UUIDChecker;
+
+
+@Path("/")
+	public class HealthCheckHandler {
+		
+		private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+
+	    @HEAD
+	    @GET
+	    @Path("/healthcheck")
+	    @Produces("text/html")
+	    public Response healthcheck (@QueryParam("requestId") String requestId) {
+			long startTime = System.currentTimeMillis ();
+			MsoLogger.setServiceName ("Healthcheck");
+			UUIDChecker.verifyOldUUID(requestId, msoLogger);
+			HealthCheckUtils healthCheck = new HealthCheckUtils ();
+			if (!healthCheck.siteStatusCheck(msoLogger, startTime)) {
+				return HealthCheckUtils.HEALTH_CHECK_NOK_RESPONSE;
+			}
+
+			if (!healthCheck.requestDBCheck (msoLogger, startTime)) {
+				return HealthCheckUtils.NOT_STARTED_RESPONSE;
+			}
+			msoLogger.debug("healthcheck - Successful");
+			return HealthCheckUtils.HEALTH_CHECK_RESPONSE;
+	    }
+
+}
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java
new file mode 100644
index 0000000..5b4009f
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapter.java
@@ -0,0 +1,58 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - 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=========================================================
+ */
+
+package org.openecomp.mso.adapters.requestsdb;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.xml.bind.annotation.XmlElement;
+
+import org.openecomp.mso.adapters.requestsdb.exceptions.MsoRequestsDbException;
+import org.openecomp.mso.requestsdb.InfraActiveRequests;
+import org.openecomp.mso.requestsdb.SiteStatus;
+
+/**
+ * MSO Request DB Adapter Web Service
+ */
+@WebService(name = "RequestsDbAdapter", targetNamespace = "http://com.att.mso/requestsdb")
+public interface MsoRequestsDbAdapter {
+
+    @WebMethod
+    public void updateInfraRequest (@WebParam(name = "requestId") @XmlElement(required = true) String requestId,
+                                    @WebParam(name = "lastModifiedBy") @XmlElement(required = true) String lastModifiedBy,
+                                    @WebParam(name = "statusMessage") @XmlElement(required = false) String statusMessage,
+                                    @WebParam(name = "responseBody") @XmlElement(required = false) String responseBody,
+                                    @WebParam(name = "requestStatus") @XmlElement(required = false) RequestStatusType requestStatus,
+                                    @WebParam(name = "progress") @XmlElement(required = false) String progress,
+                                    @WebParam(name = "vnfOutputs") @XmlElement(required = false) String vnfOutputs,
+                                    @WebParam(name = "serviceInstanceId") @XmlElement(required = false) String serviceInstanceId,
+                                    @WebParam(name = "networkId") @XmlElement(required = false) String networkId,
+                                    @WebParam(name = "vnfId") @XmlElement(required = false) String vnfId,
+                                    @WebParam(name = "vfModuleId") @XmlElement(required = false) String vfModuleId,
+                                    @WebParam(name = "volumeGroupId") @XmlElement(required = false) String volumeGroupId) throws MsoRequestsDbException;
+
+    @WebMethod
+    public InfraActiveRequests getInfraRequest (@WebParam(name="requestId") @XmlElement(required = true) String requestId) throws MsoRequestsDbException;
+
+    @WebMethod
+    public boolean getSiteStatus (@WebParam(name="siteName") @XmlElement(required = true) String siteName);
+
+}
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
new file mode 100644
index 0000000..e1b752a
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
@@ -0,0 +1,246 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - 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=========================================================
+ */
+
+package org.openecomp.mso.adapters.requestsdb;
+
+import java.sql.Timestamp;
+import java.util.List;
+
+import javax.jws.WebService;
+
+import org.openecomp.mso.requestsdb.SiteStatus;
+import org.openecomp.mso.utils.UUIDChecker;
+import org.hibernate.HibernateException;
+import org.hibernate.Query;
+import org.hibernate.Session;
+
+import org.openecomp.mso.adapters.requestsdb.exceptions.MsoRequestsDbException;
+import org.openecomp.mso.logger.MessageEnum;
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.mso.requestsdb.HibernateUtil;
+import org.openecomp.mso.requestsdb.InfraActiveRequests;
+
+@WebService(serviceName = "RequestsDbAdapter", endpointInterface = "org.openecomp.mso.adapters.requestsdb.MsoRequestsDbAdapter", targetNamespace = "http://com.att.mso/requestsdb")
+public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
+
+    private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
+
+    @Override
+    public void updateInfraRequest (String requestId,
+                                    String lastModifiedBy,
+                                    String statusMessage,
+                                    String responseBody,
+                                    RequestStatusType requestStatus,
+                                    String progress,
+                                    String vnfOutputs,
+                                    String serviceInstanceId,
+                                    String networkId,
+                                    String vnfId,
+                                    String vfModuleId,
+                                    String volumeGroupId) throws MsoRequestsDbException {
+        MsoLogger.setLogContext (requestId, null);
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+        int result = 0;
+        long startTime = System.currentTimeMillis ();
+        try {
+           	session.beginTransaction ();
+            String queryString = "update InfraActiveRequests set ";
+            if (statusMessage != null) {
+                queryString += "statusMessage = :statusMessage, ";
+            }
+            if (responseBody != null) {
+                queryString += "responseBody = :responseBody, ";
+            }
+            if (requestStatus != null) {
+                queryString += "requestStatus = :requestStatus, ";
+            }
+            if (progress != null) {
+                queryString += "progress = :progress, ";
+            }
+            if (vnfOutputs != null) {
+                queryString += "vnfOutputs = :vnfOutputs, ";
+            }
+            if (serviceInstanceId != null) {
+                queryString += "serviceInstanceId = :serviceInstanceId, ";
+            }
+            if (networkId != null) {
+                queryString += "networkId = :networkId, ";
+            }
+            if (vnfId != null) {
+                queryString += "vnfId = :vnfId, ";
+            }
+            if (vfModuleId != null) {
+                queryString += "vfModuleId = :vfModuleId, ";
+            }
+            if (volumeGroupId != null) {
+                queryString += "volumeGroupId = :volumeGroupId, ";
+            }
+            if (requestStatus == RequestStatusType.COMPLETE || requestStatus == RequestStatusType.FAILED) {
+                queryString += "endTime = :endTime, ";
+            } else {
+                queryString += "modifyTime = :modifyTime, ";
+            }
+            queryString += "lastModifiedBy = :lastModifiedBy where requestId = :requestId OR clientRequestId = :requestId";
+            
+            LOGGER.debug("Executing update: " + queryString); 
+            
+            Query query = session.createQuery (queryString);
+            query.setParameter ("requestId", requestId);
+            if (statusMessage != null) {
+                query.setParameter ("statusMessage", statusMessage);
+                LOGGER.debug ("StatusMessage in updateInfraRequest is set to: " + statusMessage);               
+            }
+            if (responseBody != null) {
+            	query.setParameter ("responseBody", responseBody);
+            	LOGGER.debug ("ResponseBody in updateInfraRequest is set to: " + responseBody);
+            }
+            if (requestStatus != null) {
+                query.setParameter ("requestStatus", requestStatus.toString ());
+                LOGGER.debug ("RequestStatus in updateInfraRequest is set to: " + requestStatus.toString());
+            }
+            
+            if (progress != null) {
+                query.setParameter ("progress", Long.parseLong (progress));
+                LOGGER.debug ("Progress in updateInfraRequest is set to: " + progress);
+            }
+            if (vnfOutputs != null) {
+                query.setParameter ("vnfOutputs", vnfOutputs);
+                LOGGER.debug ("VnfOutputs in updateInfraRequest is set to: " + vnfOutputs);
+            }
+            if (serviceInstanceId != null) {
+                query.setParameter ("serviceInstanceId", serviceInstanceId);
+                LOGGER.debug ("ServiceInstanceId in updateInfraRequest is set to: " + serviceInstanceId);
+            }
+            if (networkId != null) {
+                query.setParameter ("networkId", networkId);
+                LOGGER.debug ("NetworkId in updateInfraRequest is set to: " + networkId);
+            }
+            if (vnfId != null) {
+                query.setParameter ("vnfId", vnfId);
+                LOGGER.debug ("VnfId in updateInfraRequest is set to: " + vnfId);
+            }
+            if (vfModuleId != null) {
+                query.setParameter ("vfModuleId", vfModuleId);
+                LOGGER.debug ("vfModuleId in updateInfraRequest is set to: " + vfModuleId);
+            }
+            if (volumeGroupId != null) {
+                query.setParameter ("volumeGroupId", volumeGroupId);
+                LOGGER.debug ("VolumeGroupId in updateInfraRequest is set to: " + volumeGroupId);
+            }
+            Timestamp nowTimeStamp = new Timestamp (System.currentTimeMillis ());
+            if (requestStatus == RequestStatusType.COMPLETE || requestStatus == RequestStatusType.FAILED) {
+                query.setParameter ("endTime", nowTimeStamp);
+                LOGGER.debug ("EndTime in updateInfraRequest is set to: " + nowTimeStamp);
+            } else {
+                query.setParameter ("modifyTime", nowTimeStamp);
+                LOGGER.debug ("ModifyTime in updateInfraRequest is set to: " + nowTimeStamp);
+            }
+            query.setParameter ("lastModifiedBy", lastModifiedBy);
+            LOGGER.debug ("LastModifiedBy in updateInfraRequest is set to: " + lastModifiedBy);
+            result = query.executeUpdate ();
+            checkIfExists (result, requestId, startTime);
+            session.getTransaction ().commit (); 
+        } catch (HibernateException e) {
+            String error = "Unable to update MSO Requests DB: " + e.getMessage ();
+            LOGGER.error (MessageEnum.RA_CANT_UPDATE_REQUEST, "infra request parameters", requestId, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "HibernateException - " + error, e);
+            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, error);
+            throw new MsoRequestsDbException (error, e);
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+        }
+        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
+    }
+
+
+    private void checkIfExists (int result, String requestId, long startTime) throws MsoRequestsDbException {
+        if (result == 0) {
+            String error = "Request ID does not exist in MSO Requests DB: " + requestId;
+            LOGGER.error (MessageEnum.RA_DB_REQUEST_NOT_EXIST, requestId, "", "", MsoLogger.ErrorCode.DataError, error);
+            throw new MsoRequestsDbException (error);
+        }
+    }
+
+
+    @Override
+    public InfraActiveRequests getInfraRequest (String requestId) throws MsoRequestsDbException {
+        long startTime = System.currentTimeMillis ();
+        MsoLogger.setLogContext (requestId, null);
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+
+        LOGGER.debug ("Call to MSO Infra RequestsDb adapter get method with request Id: " + requestId);
+
+        InfraActiveRequests request = null;
+        try {
+            session.beginTransaction ();
+            Query query = session.createQuery ("FROM InfraActiveRequests where requestId = :requestId OR clientRequestId = :requestId");
+            query.setParameter ("requestId", requestId);
+            request = (InfraActiveRequests) query.uniqueResult();
+        } catch (HibernateException e) {
+            String error = "Unable to retrieve MSO Infra Requests DB for Request ID "
+                           + requestId;
+            LOGGER.error (MessageEnum.RA_DB_REQUEST_NOT_EXIST, "Get Infra request", requestId, "", "", MsoLogger.ErrorCode.BusinessProcesssError, "HibernateException - " + error, e);
+            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, error);
+            throw new MsoRequestsDbException (error, e);
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+        }
+        LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
+        return request;
+    }
+
+
+    /**
+     * Get SiteStatus by SiteName.
+     *
+     * @param siteName The unique name of the site
+     * @return Status of that site
+     */
+    public boolean getSiteStatus (String siteName) {
+        UUIDChecker.generateUUID (LOGGER);
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+
+        long startTime = System.currentTimeMillis ();
+        SiteStatus siteStatus = null;
+        LOGGER.debug ("Request database - get Site Status with Site name:" + siteName);
+        try {
+            String hql = "FROM SiteStatus WHERE siteName = :site_name";
+            Query query = session.createQuery (hql);
+            query.setParameter ("site_name", siteName);
+
+            siteStatus = (SiteStatus) query.uniqueResult ();
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+        }
+        if (siteStatus == null) {
+            // if not exist in DB, it means the site is not disabled, thus return true
+            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
+            return true;
+        } else {
+            LOGGER.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successful");
+            return siteStatus.getStatus();
+        }
+    }
+}
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/RequestStatusType.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/RequestStatusType.java
new file mode 100644
index 0000000..706142f
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/RequestStatusType.java
@@ -0,0 +1,69 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - 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=========================================================
+ */
+
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2015.07.24 at 11:49:17 AM EDT 
+//
+
+
+package org.openecomp.mso.adapters.requestsdb;
+
+
+
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for request-status-type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * <pre>
+ * &lt;simpleType name="request-status-type">
+ *   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     &lt;enumeration value="COMPLETE"/>
+ *     &lt;enumeration value="FAILED"/>
+ *     &lt;enumeration value="IN_PROGRESS"/>
+ *   &lt;/restriction>
+ * &lt;/simpleType>
+ * </pre>
+ * 
+ */
+@XmlType(name = "request-status-type")
+@XmlEnum
+public enum RequestStatusType {
+
+    COMPLETE,
+    FAILED,
+    IN_PROGRESS;
+
+    public String value() {
+        return name();
+    }
+
+    public static RequestStatusType fromValue(String v) {
+        return valueOf(v);
+    }
+
+}
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/ResponseStatus.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/ResponseStatus.java
new file mode 100644
index 0000000..5b943e2
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/ResponseStatus.java
@@ -0,0 +1,33 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - 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=========================================================
+ */
+
+package org.openecomp.mso.adapters.requestsdb;
+
+
+
+/*
+ * Enum for Status values returned by API Handler to Tail-F
+*/
+public enum ResponseStatus {
+	SENDING_FINAL_NOTIFY,
+	SUCCESS,
+	FAILED,
+	TIMEOUT	
+}
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/Status.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/Status.java
new file mode 100644
index 0000000..0b4db4b
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/Status.java
@@ -0,0 +1,40 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - 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=========================================================
+ */
+
+package org.openecomp.mso.adapters.requestsdb;
+
+
+/*
+ * Enum for Status values returned by API Handler to Tail-F
+*/
+public enum Status {
+                    PENDING, INPROGRESS, COMPLETED, FAILED, TIMEOUT;
+
+    public boolean isFinished () {
+        switch (this) {
+            case COMPLETED:
+            case FAILED:
+            case TIMEOUT:
+                return true;
+            default:
+                return false;
+        }
+    }
+}
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/exceptions/MsoRequestsDbException.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/exceptions/MsoRequestsDbException.java
new file mode 100644
index 0000000..8e4fcf4
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/exceptions/MsoRequestsDbException.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - 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=========================================================
+ */
+
+package org.openecomp.mso.adapters.requestsdb.exceptions;
+
+
+
+import javax.xml.ws.WebFault;
+
+/**
+ * This class simply extends Exception (without addition additional functionality)
+ * to provide an identifier for RequestsDB related exceptions on create, delete, query.
+ * 
+ *
+ */
+@WebFault (name="MsoRequestsDbException", faultBean="org.openecomp.mso.adapters.requestsdb.exceptions.MsoRequestsDbExceptionBean", targetNamespace="http://com.att.mso/requestsdb")
+public class MsoRequestsDbException extends Exception {
+
+	private static final long serialVersionUID = 1L;
+
+	private MsoRequestsDbExceptionBean faultInfo;
+	
+	public MsoRequestsDbException (String msg) {
+		super(msg);
+		faultInfo = new MsoRequestsDbExceptionBean (msg);
+	}
+	
+	public MsoRequestsDbException (Throwable e) {
+		super(e);
+		faultInfo = new MsoRequestsDbExceptionBean (e.getMessage());
+	}
+	
+	public MsoRequestsDbException (String msg, Throwable e) {
+		super (msg, e);
+		faultInfo = new MsoRequestsDbExceptionBean (msg);
+	}
+
+	public MsoRequestsDbExceptionBean getFaultInfo() {
+		return faultInfo;
+	}
+
+	public void setFaultInfo(MsoRequestsDbExceptionBean faultInfo) {
+		this.faultInfo = faultInfo;
+	}
+}
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/exceptions/MsoRequestsDbExceptionBean.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/exceptions/MsoRequestsDbExceptionBean.java
new file mode 100644
index 0000000..8701e5b
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/exceptions/MsoRequestsDbExceptionBean.java
@@ -0,0 +1,48 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - 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=========================================================
+ */
+
+package org.openecomp.mso.adapters.requestsdb.exceptions;
+
+
+import java.io.Serializable;
+
+/**
+ * Jax-WS Fault Bean for MsoRequestsDB Exception
+ */
+public class MsoRequestsDbExceptionBean implements Serializable {
+
+    private static final long serialVersionUID = 1360000062602372639L;
+
+    private String message;
+
+	public MsoRequestsDbExceptionBean () {}
+
+	public MsoRequestsDbExceptionBean (String message) {
+		this.message = message;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+
+	public void setMessage(String message) {
+		this.message = message;
+	}
+}
diff --git a/adapters/mso-requests-db-adapter/src/main/java/resources/application.properties b/adapters/mso-requests-db-adapter/src/main/java/resources/application.properties
new file mode 100644
index 0000000..c934538
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/java/resources/application.properties
@@ -0,0 +1,28 @@
+###
+# ============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=========================================================
+###
+
+
+# -- welcome --
+welcomeTitle=JSF Blank Application
+
+welcomeHeading=Welcome!
+
+welcomeMessage=This is a JSF blank application. \
+	You can find the application.properties file with this message in the src/resources folder.
