diff --git a/models-decisions/pom.xml b/models-decisions/pom.xml
index 230c5e4..ca7458a 100644
--- a/models-decisions/pom.xml
+++ b/models-decisions/pom.xml
@@ -27,7 +27,7 @@
         <version>2.0.0-SNAPSHOT</version>
     </parent>
 
-    <artifactId>models-decisions</artifactId>
+    <artifactId>policy-models-decisions</artifactId>
 
     <name>${project.artifactId}</name>
     <description>The models for Policy Decision API's.</description>
diff --git a/models-pap/pom.xml b/models-pap/pom.xml
index a437d54..9257b9b 100644
--- a/models-pap/pom.xml
+++ b/models-pap/pom.xml
@@ -1,7 +1,6 @@
 <!--
   ============LICENSE_START=======================================================
    Copyright (C) 2019 Nordix Foundation.
-   Modifications Copyright (C) 2019 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.
@@ -28,7 +27,7 @@
         <version>2.0.0-SNAPSHOT</version>
     </parent>
 
-    <artifactId>models-pap</artifactId>
+    <artifactId>policy-models-pap</artifactId>
 
     <name>${project.artifactId}</name>
     <description>The models for Policy Administration (PAP) REST API's.</description>
@@ -43,10 +42,15 @@
             <artifactId>policy-models-base</artifactId>
             <version>${project.version}</version>
         </dependency>
+         <dependency>
+             <groupId>org.onap.policy.models</groupId>
+             <artifactId>policy-models-dao</artifactId>
+             <version>${project.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.assertj</groupId>
             <artifactId>assertj-core</artifactId>
             <scope>test</scope>
         </dependency>
     </dependencies>
-</project>
\ No newline at end of file
+</project>
diff --git a/models-pap/src/main/java/org/onap/policy/models/pap/provider/PapProvider.java b/models-pap/src/main/java/org/onap/policy/models/pap/provider/PapProvider.java
new file mode 100644
index 0000000..4b80bea
--- /dev/null
+++ b/models-pap/src/main/java/org/onap/policy/models/pap/provider/PapProvider.java
@@ -0,0 +1,86 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.models.pap.provider;
+
+import lombok.NonNull;
+
+import org.onap.policy.models.base.PfModelException;
+import org.onap.policy.models.dao.PfDao;
+import org.onap.policy.models.pap.concepts.PdpGroups;
+
+/**
+ * This class provides the provision of information on PAP concepts in the database to callers.
+ *
+ * @author Liam Fallon (liam.fallon@est.tech)
+ */
+public class PapProvider {
+    /**
+     * Get PDP groups.
+     *
+     * @param dao the DAO to use to access the database
+     * @param pdpGroupFilter a filter for the get
+     * @return the PDP groups found
+     * @throws PfModelException on errors getting PDP groups
+     */
+    public PdpGroups getPdpGroups(@NonNull final PfDao dao, @NonNull final String pdpGroupFilter)
+            throws PfModelException {
+        return new PdpGroups();
+    }
+
+    /**
+     * Creates PDP groups.
+     *
+     * @param dao the DAO to use to access the database
+     * @param pdpGroups a specification of the PDP groups to create
+     * @return the PDP groups created
+     * @throws PfModelException on errors creating PDP groups
+     */
+    public PdpGroups createPdpGroups(@NonNull final PfDao dao, @NonNull final PdpGroups pdpGroups)
+            throws PfModelException {
+        return new PdpGroups();
+    }
+
+    /**
+     * Updates PDP groups.
+     *
+     * @param dao the DAO to use to access the database
+     * @param pdpGroups a specification of the PDP groups to update
+     * @return the PDP groups updated
+     * @throws PfModelException on errors updating PDP groups
+     */
+    public PdpGroups updatePdpGroups(@NonNull final PfDao dao, @NonNull final PdpGroups pdpGroups)
+            throws PfModelException {
+        return new PdpGroups();
+    }
+
+    /**
+     * Delete PDP groups.
+     *
+     * @param dao the DAO to use to access the database
+     * @param pdpGroupFilter a filter for the get
+     * @return the PDP groups deleted
+     * @throws PfModelException on errors deleting PDP groups
+     */
+    public PdpGroups deletePdpGroups(@NonNull final PfDao dao, @NonNull final String pdpGroupFilter)
+            throws PfModelException {
+        return new PdpGroups();
+    }
+}
diff --git a/models-provider/pom.xml b/models-provider/pom.xml
index 44756be..b6021b0 100644
--- a/models-provider/pom.xml
+++ b/models-provider/pom.xml
@@ -57,6 +57,12 @@
         </dependency>
 
         <dependency>
+            <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-pap</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
             <groupId>com.h2database</groupId>
             <artifactId>h2</artifactId>
             <scope>test</scope>
@@ -68,5 +74,10 @@
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 </project>
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java b/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java
index fa666c0..9bc4983 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java
@@ -24,6 +24,7 @@
 
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfModelException;
+import org.onap.policy.models.pap.concepts.PdpGroups;
 import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicy;
 import org.onap.policy.models.tosca.legacy.concepts.LegacyOperationalPolicy;
 import org.onap.policy.models.tosca.simple.concepts.ToscaServiceTemplate;
@@ -34,7 +35,13 @@
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
-public interface PolicyModelsProvider {
+public interface PolicyModelsProvider extends AutoCloseable {
+    /**
+     * Open the policy model provider initializing whatever internal handling it needs.
+     *
+     * @throws PfModelException on errors opening the models provider
+     */
+    public void init() throws PfModelException;
 
     /**
      * Get policy types.
@@ -200,34 +207,36 @@
     /**
      * Get PDP groups.
      *
-     * @param somePdpGroupFilter a filter for the get
+     * @param pdpGroupFilter a filter for the get
      * @return the PDP groups found
      * @throws PfModelException on errors getting PDP groups
      */
-    public Object getPdpGroups(@NonNull final Object somePdpGroupFilter) throws PfModelException;
+    public PdpGroups getPdpGroups(@NonNull final String pdpGroupFilter) throws PfModelException;
 
     /**
      * Creates PDP groups.
      *
-     * @param somePdpGroupSpecification a specification for the PDP group
+     * @param pdpGroups a specification of the PDP groups to create
+     * @return the PDP groups created
      * @throws PfModelException on errors creating PDP groups
      */
-    public Object createPdpGroups(@NonNull final Object somePdpGroupSpecification) throws PfModelException;
-
+    public PdpGroups createPdpGroups(@NonNull final PdpGroups pdpGroups) throws PfModelException;
 
     /**
      * Updates PDP groups.
      *
-     * @param somePdpGroupSpecification a specification for the PDP group
+     * @param pdpGroups a specification of the PDP groups to update
+     * @return the PDP groups updated
      * @throws PfModelException on errors updating PDP groups
      */
-    public Object updatePdpGroups(@NonNull final Object somePdpGroupSpecification) throws PfModelException;
+    public PdpGroups updatePdpGroups(@NonNull final PdpGroups pdpGroups) throws PfModelException;
 
     /**
      * Delete PDP groups.
      *
-     * @param somePdpGroupFilter a filter for the get
+     * @param pdpGroupFilter a filter for the get
+     * @return the PDP groups deleted
      * @throws PfModelException on errors deleting PDP groups
      */
-    public Object deletePdpGroups(@NonNull final Object somePdpGroupFilter) throws PfModelException;
+    public PdpGroups deletePdpGroups(@NonNull final String pdpGroupFilter) throws PfModelException;
 }
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProviderFactory.java b/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProviderFactory.java
index b4b5f1d..718668b 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProviderFactory.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProviderFactory.java
@@ -20,7 +20,14 @@
 
 package org.onap.policy.models.provider;
 
-import org.onap.policy.models.provider.impl.DummyPolicyModelsProviderImpl;
+import javax.ws.rs.core.Response;
+
+import lombok.NonNull;
+
+import org.onap.policy.models.base.PfModelException;
+import org.onap.policy.models.dao.impl.DefaultPfDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A factory for creating PolicyModelsProvider objects using the default Policy Framework implementation.
@@ -28,11 +35,44 @@
  * @author Liam Fallon (liam.fallon@est.tech)
  */
 public class PolicyModelsProviderFactory {
+    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultPfDao.class);
 
     /**
      * Creates a new PolicyModelsProvider object from its implementation.
+     *
+     * @param parameters The parameters for the implementation of the PolicyModelProvider
+     * @throws PfModelException on errors creating an implementation of the PolicyModelProvider
      */
-    public  PolicyModelsProvider createPolicyModelsProvider() {
-        return new DummyPolicyModelsProviderImpl();
+    public PolicyModelsProvider createPolicyModelsProvider(@NonNull final PolicyModelsProviderParameters parameters)
+            throws PfModelException {
+        // Get the class for the PolicyModelsProvider
+        Class<?> implementationClass = null;
+        try {
+            // Check if the implementation class is on the classpath
+            implementationClass = Class.forName(parameters.getImplementation());
+        } catch (final Exception exc) {
+            String errorMessage = "could not find implementation of the \"PolicyModelsProvider\" interface \""
+                    + parameters.getImplementation() + "\"";
+            LOGGER.warn(errorMessage, exc);
+            throw new PfModelException(Response.Status.NOT_FOUND, errorMessage, exc);
+        }
+
+        // It is, now check if it is a PolicyModelsProvider
+        if (!PolicyModelsProvider.class.isAssignableFrom(implementationClass)) {
+            String errorMessage = "the class \"" + implementationClass.getCanonicalName()
+                    + "\" is not an implementation of the \"PolicyModelsProvider\" interface";
+            LOGGER.warn(errorMessage);
+            throw new PfModelException(Response.Status.BAD_REQUEST, errorMessage);
+        }
+
+        try {
+            return (PolicyModelsProvider) implementationClass.getConstructor(PolicyModelsProviderParameters.class)
+                    .newInstance(parameters);
+        } catch (Exception exc) {
+            String errorMessage =
+                    "could not create an instance of PolicyModelsProvider \"" + parameters.getImplementation() + "\"";
+            LOGGER.warn(errorMessage, exc);
+            throw new PfModelException(Response.Status.INTERNAL_SERVER_ERROR, errorMessage, exc);
+        }
     }
 }
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProviderParameters.java b/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProviderParameters.java
new file mode 100644
index 0000000..5abafed
--- /dev/null
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProviderParameters.java
@@ -0,0 +1,88 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.models.provider;
+
+import lombok.Data;
+
+import org.onap.policy.common.parameters.GroupValidationResult;
+import org.onap.policy.common.parameters.ParameterGroup;
+import org.onap.policy.common.parameters.ValidationStatus;
+import org.onap.policy.common.utils.validation.ParameterValidationUtils;
+import org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl;
+
+// @formatter:off
+/**
+ * Class to hold all the plugin handler parameters.
+ *
+ * <p>The following parameters are defined:
+ * <ol>
+ * <li>name: A name for the parameters.
+ * <li>implementation: The implementation of the PolicyModelsProvider to use for writing and reading concepts,
+ * defaults to {@link DatabasePolicyModelsProviderImpl} and may not be null
+ * <li>databaseUrl: The JDBC URL for the database, mandatory.
+ * <li>databaseUser: The user id to use for connecting to the database, optional, defaults to null.
+ * <li>databasePassword: The password to use for connecting to the database encoded in Base64, optional,
+ * defaults to null.
+ * <li>persistenceUnit: The persistence unit refined in META-INF/persistence.xml to use for connecting
+ * to the database, mandatory.
+ * </ol>
+ *
+ * @author Liam Fallon (liam.fallon@est.tech)
+ */
+//@formatter:on
+
+@Data
+public class PolicyModelsProviderParameters implements ParameterGroup {
+    private static final String DEFAULT_IMPLEMENTATION = DatabasePolicyModelsProviderImpl.class.getCanonicalName();
+
+    private String name;
+    private String implementation = DEFAULT_IMPLEMENTATION;
+    private String databaseUrl;
+    private String databaseUser;
+    private String databasePassword;
+    private String persistenceUnit;
+
+    /**
+     * Validate the model provider parameters.
+     *
+     */
+    @Override
+    public GroupValidationResult validate() {
+        final GroupValidationResult validationResult = new GroupValidationResult(this);
+
+        if (!ParameterValidationUtils.validateStringParameter(implementation)) {
+            validationResult.setResult("implementation", ValidationStatus.INVALID,
+                    "a PolicyModelsProvider implementation must be specified");
+        }
+
+        if (!ParameterValidationUtils.validateStringParameter(databaseUrl)) {
+            validationResult.setResult("databaseUrl", ValidationStatus.INVALID,
+                    "a URL must be specified for the JDBC connection to the database");
+        }
+
+        if (!ParameterValidationUtils.validateStringParameter(persistenceUnit)) {
+            validationResult.setResult("persistenceUnit", ValidationStatus.INVALID,
+                    "a persistence unit must be specified for connecting to the database");
+        }
+
+        return validationResult;
+    }
+}
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
index 8136a75..970aa8f 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
@@ -20,125 +20,266 @@
 
 package org.onap.policy.models.provider.impl;
 
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.util.Base64;
+
+import javax.ws.rs.core.Response;
+
 import lombok.NonNull;
 
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfModelException;
+import org.onap.policy.models.base.PfModelRuntimeException;
+import org.onap.policy.models.dao.DaoParameters;
+import org.onap.policy.models.dao.PfDao;
+import org.onap.policy.models.dao.PfDaoFactory;
+import org.onap.policy.models.dao.impl.DefaultPfDao;
+import org.onap.policy.models.pap.concepts.PdpGroups;
+import org.onap.policy.models.pap.provider.PapProvider;
 import org.onap.policy.models.provider.PolicyModelsProvider;
+import org.onap.policy.models.provider.PolicyModelsProviderParameters;
 import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicy;
 import org.onap.policy.models.tosca.legacy.concepts.LegacyOperationalPolicy;
+import org.onap.policy.models.tosca.legacy.provider.LegacyToscaProvider;
 import org.onap.policy.models.tosca.simple.concepts.ToscaServiceTemplate;
+import org.onap.policy.models.tosca.simple.provider.SimpleToscaProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
- * This class provides an implementation of the Policy Models Provider for the ONAP Policy Framework
- * that works towards a relational database.
+ * This class provides an implementation of the Policy Models Provider for the ONAP Policy Framework that works towards
+ * a relational database.
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
 public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider {
+    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultPfDao.class);
 
-    @Override
-    public ToscaServiceTemplate getPolicyTypes(@NonNull PfConceptKey policyTypeKey) throws PfModelException {
-        return null;
+    private final PolicyModelsProviderParameters parameters;
+
+    // Database connection and the DAO for reading and writing Policy Framework concepts
+    private Connection connection;
+    private PfDao pfDao;
+
+    /**
+     * Constructor that takes the parameters.
+     *
+     * @param parameters the parameters for the provider
+     */
+    public DatabasePolicyModelsProviderImpl(@NonNull final PolicyModelsProviderParameters parameters) {
+        this.parameters = parameters;
     }
 
     @Override
-    public ToscaServiceTemplate createPolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
+    public void init() throws PfModelException {
+        LOGGER.debug("opening the database connection to {} using persistence unit {}", parameters.getDatabaseUrl(),
+                parameters.getPersistenceUnit());
+
+        // Decode the password using Base64
+        String decodedPassword = new String(Base64.getDecoder().decode(parameters.getDatabasePassword()));
+
+        // Connect to the database, call does not implement AutoCloseable for try-with-resources
+        try {
+            connection = DriverManager.getConnection(parameters.getDatabaseUrl(), parameters.getDatabaseUser(),
+                    decodedPassword);
+        } catch (Exception exc) {
+            String errorMessage = "could not connect to database with URL \"" + parameters.getDatabaseUrl() + "\"";
+            LOGGER.warn(errorMessage, exc);
+            throw new PfModelException(Response.Status.NOT_ACCEPTABLE, errorMessage, exc);
+        }
+
+        // Parameters for the DAO
+        final DaoParameters daoParameters = new DaoParameters();
+        daoParameters.setPluginClass(DefaultPfDao.class.getCanonicalName());
+        daoParameters.setPersistenceUnit(parameters.getPersistenceUnit());
+
+        try {
+            pfDao = new PfDaoFactory().createPfDao(daoParameters);
+            pfDao.init(daoParameters);
+        } catch (Exception exc) {
+            String errorMessage = "could not create Data Access Object (DAO) using url \"" + parameters.getDatabaseUrl()
+                    + "\" and persistence unit \"" + parameters.getPersistenceUnit() + "\"";
+            LOGGER.warn(errorMessage, exc);
+
+            this.close();
+            throw new PfModelException(Response.Status.NOT_ACCEPTABLE, errorMessage, exc);
+        }
+    }
+
+    @Override
+    public void close() throws PfModelException {
+        LOGGER.debug("closing the database connection to {} using persistence unit {}", parameters.getDatabaseUrl(),
+                parameters.getPersistenceUnit());
+
+        if (pfDao != null) {
+            pfDao.close();
+            pfDao = null;
+        }
+
+        if (connection != null) {
+            try {
+                connection.close();
+            } catch (Exception exc) {
+
+                String errorMessage =
+                        "could not close connection to database with URL \"" + parameters.getDatabaseUrl() + "\"";
+                LOGGER.warn(errorMessage, exc);
+                throw new PfModelException(Response.Status.INTERNAL_SERVER_ERROR, errorMessage, exc);
+            } finally {
+                connection = null;
+            }
+        }
+
+        LOGGER.debug("closed the database connection to {} using persistence unit {}", parameters.getDatabaseUrl(),
+                parameters.getPersistenceUnit());
+    }
+
+    @Override
+    public ToscaServiceTemplate getPolicyTypes(@NonNull final PfConceptKey policyTypeKey) throws PfModelException {
+        assertInitilized();
+        return new SimpleToscaProvider().getPolicyTypes(pfDao, policyTypeKey);
+    }
+
+    @Override
+    public ToscaServiceTemplate createPolicyTypes(@NonNull final ToscaServiceTemplate serviceTemplate)
             throws PfModelException {
-        return null;
+        assertInitilized();
+        return new SimpleToscaProvider().createPolicyTypes(pfDao, serviceTemplate);
     }
 
     @Override
-    public ToscaServiceTemplate updatePolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
+    public ToscaServiceTemplate updatePolicyTypes(@NonNull final ToscaServiceTemplate serviceTemplate)
             throws PfModelException {
-        return null;
+        assertInitilized();
+        return new SimpleToscaProvider().updatePolicyTypes(pfDao, serviceTemplate);
     }
 
     @Override
-    public ToscaServiceTemplate deletePolicyTypes(@NonNull PfConceptKey policyTypeKey) throws PfModelException {
-        return null;
+    public ToscaServiceTemplate deletePolicyTypes(@NonNull final PfConceptKey policyTypeKey) throws PfModelException {
+        assertInitilized();
+        return new SimpleToscaProvider().deletePolicyTypes(pfDao, policyTypeKey);
     }
 
     @Override
-    public ToscaServiceTemplate getPolicies(@NonNull PfConceptKey policyKey) throws PfModelException {
-        return null;
+    public ToscaServiceTemplate getPolicies(@NonNull final PfConceptKey policyKey) throws PfModelException {
+        assertInitilized();
+        return new SimpleToscaProvider().getPolicies(pfDao, policyKey);
     }
 
     @Override
-    public ToscaServiceTemplate createPolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
-        return null;
-    }
-
-    @Override
-    public ToscaServiceTemplate updatePolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
-        return null;
-    }
-
-    @Override
-    public ToscaServiceTemplate deletePolicies(@NonNull PfConceptKey policyKey) throws PfModelException {
-        return null;
-    }
-
-    @Override
-    public LegacyOperationalPolicy getOperationalPolicy(@NonNull String policyId) throws PfModelException {
-        return null;
-    }
-
-    @Override
-    public LegacyOperationalPolicy createOperationalPolicy(@NonNull LegacyOperationalPolicy legacyOperationalPolicy)
+    public ToscaServiceTemplate createPolicies(@NonNull final ToscaServiceTemplate serviceTemplate)
             throws PfModelException {
-        return null;
+        assertInitilized();
+        return new SimpleToscaProvider().createPolicies(pfDao, serviceTemplate);
     }
 
     @Override
-    public LegacyOperationalPolicy updateOperationalPolicy(@NonNull LegacyOperationalPolicy legacyOperationalPolicy)
+    public ToscaServiceTemplate updatePolicies(@NonNull final ToscaServiceTemplate serviceTemplate)
             throws PfModelException {
-        return null;
+        assertInitilized();
+        return new SimpleToscaProvider().updatePolicies(pfDao, serviceTemplate);
     }
 
     @Override
-    public LegacyOperationalPolicy deleteOperationalPolicy(@NonNull String policyId) throws PfModelException {
-        return null;
+    public ToscaServiceTemplate deletePolicies(@NonNull final PfConceptKey policyKey) throws PfModelException {
+        assertInitilized();
+        return new SimpleToscaProvider().deletePolicies(pfDao, policyKey);
     }
 
     @Override
-    public LegacyGuardPolicy getGuardPolicy(@NonNull String policyId) throws PfModelException {
-        return null;
+    public LegacyOperationalPolicy getOperationalPolicy(@NonNull final String policyId) throws PfModelException {
+        assertInitilized();
+        return new LegacyToscaProvider().getOperationalPolicy(pfDao, policyId);
     }
 
     @Override
-    public LegacyGuardPolicy createGuardPolicy(@NonNull LegacyGuardPolicy legacyGuardPolicy) throws PfModelException {
-        return null;
+    public LegacyOperationalPolicy createOperationalPolicy(
+            @NonNull final LegacyOperationalPolicy legacyOperationalPolicy) throws PfModelException {
+        assertInitilized();
+        return new LegacyToscaProvider().createOperationalPolicy(pfDao, legacyOperationalPolicy);
     }
 
     @Override
-    public LegacyGuardPolicy updateGuardPolicy(@NonNull LegacyGuardPolicy legacyGuardPolicy) throws PfModelException {
-        return null;
+    public LegacyOperationalPolicy updateOperationalPolicy(
+            @NonNull final LegacyOperationalPolicy legacyOperationalPolicy) throws PfModelException {
+        assertInitilized();
+        return new LegacyToscaProvider().updateOperationalPolicy(pfDao, legacyOperationalPolicy);
     }
 
     @Override
-    public LegacyGuardPolicy deleteGuardPolicy(@NonNull String policyId) throws PfModelException {
-        return null;
+    public LegacyOperationalPolicy deleteOperationalPolicy(@NonNull final String policyId) throws PfModelException {
+        assertInitilized();
+        return new LegacyToscaProvider().deleteOperationalPolicy(pfDao, policyId);
     }
 
     @Override
-    public Object getPdpGroups(@NonNull Object somePdpGroupFilter) throws PfModelException {
-        return null;
+    public LegacyGuardPolicy getGuardPolicy(@NonNull final String policyId) throws PfModelException {
+        assertInitilized();
+        return new LegacyToscaProvider().getGuardPolicy(pfDao, policyId);
     }
 
     @Override
-    public Object createPdpGroups(@NonNull Object somePdpGroupSpecification) throws PfModelException {
-        return null;
+    public LegacyGuardPolicy createGuardPolicy(@NonNull final LegacyGuardPolicy legacyGuardPolicy)
+            throws PfModelException {
+        assertInitilized();
+        return new LegacyToscaProvider().createGuardPolicy(pfDao, legacyGuardPolicy);
     }
 
     @Override
-    public Object updatePdpGroups(@NonNull Object somePdpGroupSpecification) throws PfModelException {
-        return null;
+    public LegacyGuardPolicy updateGuardPolicy(@NonNull final LegacyGuardPolicy legacyGuardPolicy)
+            throws PfModelException {
+        assertInitilized();
+        return new LegacyToscaProvider().updateGuardPolicy(pfDao, legacyGuardPolicy);
     }
 
     @Override
-    public Object deletePdpGroups(@NonNull Object somePdpGroupFilter) throws PfModelException {
-        return null;
+    public LegacyGuardPolicy deleteGuardPolicy(@NonNull final String policyId) throws PfModelException {
+        assertInitilized();
+        return new LegacyToscaProvider().deleteGuardPolicy(pfDao, policyId);
     }
 
+    @Override
+    public PdpGroups getPdpGroups(@NonNull String pdpGroupFilter) throws PfModelException {
+        assertInitilized();
+        return new PapProvider().getPdpGroups(pfDao, pdpGroupFilter);
+    }
+
+    @Override
+    public PdpGroups createPdpGroups(@NonNull PdpGroups pdpGroups) throws PfModelException {
+        assertInitilized();
+        return new PapProvider().createPdpGroups(pfDao, pdpGroups);
+    }
+
+    @Override
+    public PdpGroups updatePdpGroups(@NonNull PdpGroups pdpGroups) throws PfModelException {
+        assertInitilized();
+        return new PapProvider().updatePdpGroups(pfDao, pdpGroups);
+    }
+
+    @Override
+    public PdpGroups deletePdpGroups(@NonNull String pdpGroupFilter) throws PfModelException {
+        assertInitilized();
+        return new PapProvider().deletePdpGroups(pfDao, pdpGroupFilter);
+    }
+
+    /**
+     * Check if the model provider is initialized.
+     */
+    private void assertInitilized() {
+        if (pfDao == null) {
+            String errorMessage = "policy models provider is not initilaized";
+            LOGGER.warn(errorMessage);
+            throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, errorMessage);
+        }
+    }
+
+    /**
+     * Hook for unit test mocking of database connection.
+     *
+     * @param client the mocked client
+     */
+    protected void setConnection(final Connection connection) {
+        this.connection = connection;
+    }
 }
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
index 3d57c54..d875019 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
@@ -30,121 +30,145 @@
 import org.onap.policy.models.base.PfConceptKey;
 import org.onap.policy.models.base.PfModelException;
 import org.onap.policy.models.base.PfModelRuntimeException;
+import org.onap.policy.models.pap.concepts.PdpGroups;
 import org.onap.policy.models.provider.PolicyModelsProvider;
+import org.onap.policy.models.provider.PolicyModelsProviderParameters;
 import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicy;
 import org.onap.policy.models.tosca.legacy.concepts.LegacyOperationalPolicy;
 import org.onap.policy.models.tosca.simple.concepts.ToscaServiceTemplate;
 import org.onap.policy.models.tosca.simple.serialization.ToscaServiceTemplateMessageBodyHandler;
 
 /**
- * This class provides a dummy implementation of the Policy Models Provider for the ONAP Policy
- * Framework.
+ * This class provides a dummy implementation of the Policy Models Provider for the ONAP Policy Framework.
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
 public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider {
+    /**
+     * Constructor that takes the parameters.
+     *
+     * @param parameters the parameters for the provider
+     */
+    public DummyPolicyModelsProviderImpl(@NonNull final PolicyModelsProviderParameters parameters) {
+    }
+
     @Override
-    public ToscaServiceTemplate getPolicyTypes(@NonNull PfConceptKey policyTypeKey) throws PfModelException {
+    public void init() throws PfModelException {
+        // Not required on the dummy provider
+    }
+
+    @Override
+    public void close() {
+        // Not required on the dummy provider
+    }
+
+    @Override
+    public ToscaServiceTemplate getPolicyTypes(@NonNull final PfConceptKey policyTypeKey) throws PfModelException {
         return getDummyResponse("src/main/resources/dummyimpl/DummyToscaPolicyTypeGetResponse.json");
     }
 
     @Override
-    public ToscaServiceTemplate createPolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
+    public ToscaServiceTemplate createPolicyTypes(@NonNull final ToscaServiceTemplate serviceTemplate)
             throws PfModelException {
         return serviceTemplate;
     }
 
     @Override
-    public ToscaServiceTemplate updatePolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
+    public ToscaServiceTemplate updatePolicyTypes(@NonNull final ToscaServiceTemplate serviceTemplate)
             throws PfModelException {
         return serviceTemplate;
     }
 
     @Override
-    public ToscaServiceTemplate deletePolicyTypes(@NonNull PfConceptKey policyTypeKey) throws PfModelException {
+    public ToscaServiceTemplate deletePolicyTypes(@NonNull final PfConceptKey policyTypeKey) throws PfModelException {
         return getDummyResponse("src/main/resources/dummyimpl/DummyToscaPolicyTypeDeleteResponse.json");
     }
 
     @Override
-    public ToscaServiceTemplate getPolicies(@NonNull PfConceptKey policyKey) throws PfModelException {
+    public ToscaServiceTemplate getPolicies(@NonNull final PfConceptKey policyKey) throws PfModelException {
         return getDummyResponse("src/main/resources/dummyimpl/DummyToscaPolicyGetResponse.json");
     }
 
     @Override
-    public ToscaServiceTemplate createPolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
+    public ToscaServiceTemplate createPolicies(@NonNull final ToscaServiceTemplate serviceTemplate)
+            throws PfModelException {
         return serviceTemplate;
     }
 
     @Override
-    public ToscaServiceTemplate updatePolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
+    public ToscaServiceTemplate updatePolicies(@NonNull final ToscaServiceTemplate serviceTemplate)
+            throws PfModelException {
         return serviceTemplate;
     }
 
     @Override
-    public ToscaServiceTemplate deletePolicies(@NonNull PfConceptKey policyKey) throws PfModelException {
+    public ToscaServiceTemplate deletePolicies(@NonNull final PfConceptKey policyKey) throws PfModelException {
         return getDummyResponse("src/main/resources/dummyimpl/DummyToscaPolicyDeleteResponse.json");
     }
 
     @Override
-    public LegacyOperationalPolicy getOperationalPolicy(@NonNull String policyId) throws PfModelException {
+
+    public LegacyOperationalPolicy getOperationalPolicy(@NonNull final String policyId) throws PfModelException {
         return new LegacyOperationalPolicy();
     }
 
     @Override
-    public LegacyOperationalPolicy createOperationalPolicy(@NonNull LegacyOperationalPolicy legacyOperationalPolicy)
-            throws PfModelException {
+    public LegacyOperationalPolicy createOperationalPolicy(
+            @NonNull final LegacyOperationalPolicy legacyOperationalPolicy) throws PfModelException {
         return legacyOperationalPolicy;
     }
 
     @Override
-    public LegacyOperationalPolicy updateOperationalPolicy(@NonNull LegacyOperationalPolicy legacyOperationalPolicy)
-            throws PfModelException {
+    public LegacyOperationalPolicy updateOperationalPolicy(
+            @NonNull final LegacyOperationalPolicy legacyOperationalPolicy) throws PfModelException {
         return legacyOperationalPolicy;
     }
 
     @Override
-    public LegacyOperationalPolicy deleteOperationalPolicy(@NonNull String policyId) throws PfModelException {
+    public LegacyOperationalPolicy deleteOperationalPolicy(@NonNull final String policyId) throws PfModelException {
         return new LegacyOperationalPolicy();
     }
 
     @Override
-    public LegacyGuardPolicy getGuardPolicy(@NonNull String policyId) throws PfModelException {
+    public LegacyGuardPolicy getGuardPolicy(@NonNull final String policyId) throws PfModelException {
         return new LegacyGuardPolicy();
     }
 
     @Override
-    public LegacyGuardPolicy createGuardPolicy(@NonNull LegacyGuardPolicy legacyGuardPolicy) throws PfModelException {
+    public LegacyGuardPolicy createGuardPolicy(@NonNull final LegacyGuardPolicy legacyGuardPolicy)
+            throws PfModelException {
         return legacyGuardPolicy;
     }
 
     @Override
-    public LegacyGuardPolicy updateGuardPolicy(@NonNull LegacyGuardPolicy legacyGuardPolicy) throws PfModelException {
+    public LegacyGuardPolicy updateGuardPolicy(@NonNull final LegacyGuardPolicy legacyGuardPolicy)
+            throws PfModelException {
         return legacyGuardPolicy;
     }
 
     @Override
-    public LegacyGuardPolicy deleteGuardPolicy(@NonNull String policyId) throws PfModelException {
+    public LegacyGuardPolicy deleteGuardPolicy(@NonNull final String policyId) throws PfModelException {
         return new LegacyGuardPolicy();
     }
 
     @Override
-    public Object getPdpGroups(@NonNull Object somePdpGroupFilter) throws PfModelException {
-        return null;
+    public PdpGroups getPdpGroups(@NonNull String pdpGroupFilter) throws PfModelException {
+        return new PdpGroups();
     }
 
     @Override
-    public Object createPdpGroups(@NonNull Object somePdpGroupSpecification) throws PfModelException {
-        return null;
+    public PdpGroups createPdpGroups(@NonNull PdpGroups pdpGroups) throws PfModelException {
+        return new PdpGroups();
     }
 
     @Override
-    public Object updatePdpGroups(@NonNull Object somePdpGroupSpecification) throws PfModelException {
-        return null;
+    public PdpGroups updatePdpGroups(@NonNull PdpGroups pdpGroups) throws PfModelException {
+        return new PdpGroups();
     }
 
     @Override
-    public Object deletePdpGroups(@NonNull Object somePdpGroupFilter) throws PfModelException {
-        return null;
+    public PdpGroups deletePdpGroups(@NonNull String pdpGroupFilter) throws PfModelException {
+        return new PdpGroups();
     }
 
     /**
@@ -153,7 +177,7 @@
      * @param fileName the file name containing the dummy response
      * @return the ToscaServiceTemplate with the dummy response
      */
-    private ToscaServiceTemplate getDummyResponse(@NonNull final String fileName) {
+    protected ToscaServiceTemplate getDummyResponse(@NonNull final String fileName) {
         Gson gson = new ToscaServiceTemplateMessageBodyHandler().getGson();
         ToscaServiceTemplate serviceTemplate;
 
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/PolicyModelsProviderFactoryTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/PolicyModelsProviderFactoryTest.java
new file mode 100644
index 0000000..628d9fc
--- /dev/null
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/PolicyModelsProviderFactoryTest.java
@@ -0,0 +1,90 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.models.provider;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import lombok.ToString;
+
+import org.junit.Test;
+
+/**
+ * Test the {@link PolicyModelsProviderFactory} class.
+ *
+ * @author Liam Fallon (liam.fallon@est.tech)
+ */
+@ToString
+public class PolicyModelsProviderFactoryTest {
+
+    @Test
+    public void testFactory() {
+        PolicyModelsProviderFactory factory = new PolicyModelsProviderFactory();
+
+        try {
+            factory.createPolicyModelsProvider(null);
+            fail("test should throw an exception here");
+        } catch (Exception exc) {
+            assertEquals("parameters is marked @NonNull but is null", exc.getMessage());
+        }
+
+        try {
+            PolicyModelsProviderParameters pars = new PolicyModelsProviderParameters();
+            pars.setImplementation(null);
+            factory.createPolicyModelsProvider(pars);
+            fail("test should throw an exception here");
+        } catch (Exception exc) {
+            assertEquals("could not find implementation of the \"PolicyModelsProvider\" interface \"null\"",
+                    exc.getMessage());
+        }
+
+        try {
+            PolicyModelsProviderParameters pars = new PolicyModelsProviderParameters();
+            pars.setImplementation("com.acmecorp.RoadRunner");
+            factory.createPolicyModelsProvider(pars);
+            fail("test should throw an exception here");
+        } catch (Exception exc) {
+            assertEquals("could not find implementation of the \"PolicyModelsProvider\" "
+                    + "interface \"com.acmecorp.RoadRunner\"", exc.getMessage());
+        }
+
+        try {
+            PolicyModelsProviderParameters pars = new PolicyModelsProviderParameters();
+            pars.setImplementation("java.lang.String");
+            factory.createPolicyModelsProvider(pars);
+            fail("test should throw an exception here");
+        } catch (Exception exc) {
+            assertEquals(
+                    "the class \"java.lang.String\" is not an implementation of the \"PolicyModelsProvider\" interface",
+                    exc.getMessage());
+        }
+
+        try {
+            PolicyModelsProviderParameters pars = new PolicyModelsProviderParameters();
+            pars.setImplementation("org.onap.policy.models.provider.impl.DummyBadProviderImpl");
+            factory.createPolicyModelsProvider(pars);
+            fail("test should throw an exception here");
+        } catch (Exception exc) {
+            assertEquals("could not create an instance of PolicyModelsProvider "
+                    + "\"org.onap.policy.models.provider.impl.DummyBadProviderImpl\"", exc.getMessage());
+        }
+    }
+}
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/PolicyModelsProviderParametersTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/PolicyModelsProviderParametersTest.java
new file mode 100644
index 0000000..626d2bf
--- /dev/null
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/PolicyModelsProviderParametersTest.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.models.provider;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.onap.policy.common.parameters.GroupValidationResult;
+
+/**
+ * Test of {@link PolicyModelsProviderParameters} class.
+ *
+ * @author Liam Fallon (liam.fallon@est.tech)
+ */
+public class PolicyModelsProviderParametersTest {
+
+    @Test
+    public void testParameters() {
+        PolicyModelsProviderParameters pars = new PolicyModelsProviderParameters();
+        pars.setDatabaseUrl("jdbc://www.acmecorp/roadrunner");
+        pars.setPersistenceUnit("WileECoyote");
+
+        GroupValidationResult result = pars.validate();
+        assertTrue(result.isValid());
+
+        pars.setImplementation(null);
+        result = pars.validate();
+        assertFalse(result.isValid());
+        pars.setImplementation("An Implementation");
+        result = pars.validate();
+        assertTrue(result.isValid());
+
+        pars.setDatabaseUrl(null);
+        result = pars.validate();
+        assertFalse(result.isValid());
+        pars.setDatabaseUrl("jdbc://www.acmecorp/roadrunner");
+        result = pars.validate();
+        assertTrue(result.isValid());
+
+        pars.setPersistenceUnit(null);
+        result = pars.validate();
+        assertFalse(result.isValid());
+        pars.setPersistenceUnit("WileECoyote");
+        result = pars.validate();
+        assertTrue(result.isValid());
+    }
+}
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/TestPojos.java b/models-provider/src/test/java/org/onap/policy/models/provider/TestPojos.java
new file mode 100644
index 0000000..67b314c
--- /dev/null
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/TestPojos.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.models.provider;
+
+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.rule.impl.SetterMustExistRule;
+import com.openpojo.validation.test.impl.GetterTester;
+import com.openpojo.validation.test.impl.SetterTester;
+
+import org.junit.Test;
+
+/**
+ * Class to perform unit tests of all pojos.
+ *
+ * @author liam.fallon@est.tech)
+ *
+ */
+public class TestPojos {
+
+    private static final String POJO_PACKAGE = "org.onap.policy.models.provider";
+
+    @Test
+    public void testPojos() {
+        // @formatter:off
+        final Validator validator = ValidatorBuilder
+                .create()
+                .with(new SetterMustExistRule())
+                .with(new GetterMustExistRule())
+                .with(new SetterTester())
+                .with(new GetterTester())
+                .build();
+        validator.validate(POJO_PACKAGE, new FilterPackageInfo());
+        // :formatter:on
+    }
+}
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java
new file mode 100644
index 0000000..3b30f98
--- /dev/null
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderTest.java
@@ -0,0 +1,298 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.models.provider.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
+import java.util.Base64;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.onap.policy.models.base.PfConceptKey;
+import org.onap.policy.models.pap.concepts.PdpGroups;
+import org.onap.policy.models.provider.PolicyModelsProvider;
+import org.onap.policy.models.provider.PolicyModelsProviderFactory;
+import org.onap.policy.models.provider.PolicyModelsProviderParameters;
+import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicy;
+import org.onap.policy.models.tosca.legacy.concepts.LegacyOperationalPolicy;
+import org.onap.policy.models.tosca.simple.concepts.ToscaServiceTemplate;
+
+/**
+ * Test the database models provider implementation.
+ *
+ * @author Liam Fallon (liam.fallon@est.tech)
+ */
+public class DatabasePolicyModelsProviderTest {
+    PolicyModelsProviderParameters parameters;
+
+    /**
+     * Initialize parameters.
+     */
+    @Before
+    public void setupParameters() {
+        parameters = new PolicyModelsProviderParameters();
+        parameters.setDatabaseUrl("jdbc:h2:mem:testdb");
+        parameters.setDatabaseUser("policy");
+        parameters.setDatabasePassword(Base64.getEncoder().encodeToString("P01icY".getBytes()));
+        parameters.setPersistenceUnit("ToscaConceptTest");
+
+    }
+
+    @Test
+    public void testInitAndClose() throws Exception {
+        PolicyModelsProvider databaseProvider =
+                new PolicyModelsProviderFactory().createPolicyModelsProvider(parameters);
+
+        parameters.setDatabaseUrl("jdbc://www.acmecorp.nonexist");
+        try {
+            databaseProvider.init();
+            fail("test should throw an exception");
+        } catch (Exception pfme) {
+            assertEquals("could not connect to database with URL \"jdbc://www.acmecorp.nonexist\"", pfme.getMessage());
+        }
+        parameters.setDatabaseUrl("jdbc:h2:mem:testdb");
+
+        try {
+            databaseProvider.init();
+            databaseProvider.close();
+        } catch (Exception pfme) {
+            fail("test shold not throw an exception here");
+        }
+
+        parameters.setPersistenceUnit("WileECoyote");
+        try {
+            databaseProvider.init();
+            fail("test should throw an exception");
+        } catch (Exception pfme) {
+            assertEquals("could not create Data Access Object (DAO) using url "
+                    + "\"jdbc:h2:mem:testdb\" and persistence unit \"WileECoyote\"", pfme.getMessage());
+        }
+        parameters.setPersistenceUnit("ToscaConceptTest");
+
+        try {
+            databaseProvider.init();
+            databaseProvider.close();
+        } catch (Exception pfme) {
+            fail("test shold not throw an exception here");
+        }
+
+        try {
+            databaseProvider.close();
+        } catch (Exception pfme) {
+            fail("test shold not throw an exception here");
+        }
+
+        try {
+            DatabasePolicyModelsProviderImpl databaseProviderImpl = (DatabasePolicyModelsProviderImpl) databaseProvider;
+            databaseProvider.init();
+            databaseProviderImpl.setConnection(new DummyConnection());
+            databaseProvider.close();
+            fail("test should throw an exception");
+        } catch (Exception pfme) {
+            assertEquals("could not close connection to database with URL \"jdbc:h2:mem:testdb\"", pfme.getMessage());
+        }
+    }
+
+    @Test
+    public void testProviderMethodsNull() throws Exception {
+        PolicyModelsProvider databaseProvider =
+                new PolicyModelsProviderFactory().createPolicyModelsProvider(parameters);
+        databaseProvider.init();
+
+        try {
+            databaseProvider.getPolicyTypes(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyTypeKey is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.createPolicyTypes(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("serviceTemplate is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.updatePolicyTypes(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("serviceTemplate is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.deletePolicyTypes(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyTypeKey is marked @NonNull but is null", npe.getMessage());
+        }
+
+        try {
+            databaseProvider.getPolicies(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyKey is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.createPolicies(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("serviceTemplate is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.updatePolicies(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("serviceTemplate is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.deletePolicies(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyKey is marked @NonNull but is null", npe.getMessage());
+        }
+
+        try {
+            databaseProvider.getOperationalPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyId is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.createOperationalPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("legacyOperationalPolicy is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.updateOperationalPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("legacyOperationalPolicy is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.deleteOperationalPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyId is marked @NonNull but is null", npe.getMessage());
+        }
+
+        try {
+            databaseProvider.getGuardPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyId is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.createGuardPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("legacyGuardPolicy is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.updateGuardPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("legacyGuardPolicy is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.deleteGuardPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyId is marked @NonNull but is null", npe.getMessage());
+        }
+
+        try {
+            databaseProvider.getPdpGroups(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("pdpGroupFilter is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.createPdpGroups(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("pdpGroups is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.updatePdpGroups(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("pdpGroups is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            databaseProvider.deletePdpGroups(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("pdpGroupFilter is marked @NonNull but is null", npe.getMessage());
+        }
+
+        databaseProvider.close();
+    }
+
+    @Test
+    public void testProviderMethodsNotInit() throws Exception {
+        PolicyModelsProvider databaseProvider =
+                new PolicyModelsProviderFactory().createPolicyModelsProvider(parameters);
+        try {
+            databaseProvider.getPolicyTypes(new PfConceptKey());
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policy models provider is not initilaized", npe.getMessage());
+        }
+    }
+
+    @Test
+    public void testProviderMethods() {
+        try (PolicyModelsProvider databaseProvider =
+                new PolicyModelsProviderFactory().createPolicyModelsProvider(parameters)) {
+            databaseProvider.init();
+
+            assertNull(databaseProvider.getPolicyTypes(new PfConceptKey()));
+            assertNull(databaseProvider.createPolicyTypes(new ToscaServiceTemplate()));
+            assertNull(databaseProvider.updatePolicyTypes(new ToscaServiceTemplate()));
+            assertNull(databaseProvider.deletePolicyTypes(new PfConceptKey()));
+
+            assertNull(databaseProvider.getPolicies(new PfConceptKey()));
+            assertNull(databaseProvider.createPolicies(new ToscaServiceTemplate()));
+            assertNull(databaseProvider.updatePolicies(new ToscaServiceTemplate()));
+            assertNull(databaseProvider.deletePolicies(new PfConceptKey()));
+
+            assertNull(databaseProvider.getOperationalPolicy("policy_id"));
+            assertNull(databaseProvider.createOperationalPolicy(new LegacyOperationalPolicy()));
+            assertNull(databaseProvider.updateOperationalPolicy(new LegacyOperationalPolicy()));
+            assertNull(databaseProvider.deleteOperationalPolicy("policy_id"));
+
+            assertNull(databaseProvider.getGuardPolicy("policy_id"));
+            assertNull(databaseProvider.createGuardPolicy(new LegacyGuardPolicy()));
+            assertNull(databaseProvider.updateGuardPolicy(new LegacyGuardPolicy()));
+            assertNull(databaseProvider.deleteGuardPolicy("policy_id"));
+
+            assertNotNull(databaseProvider.getPdpGroups("filter"));
+            assertNotNull(databaseProvider.createPdpGroups(new PdpGroups()));
+            assertNotNull(databaseProvider.updatePdpGroups(new PdpGroups()));
+            assertNotNull(databaseProvider.deletePdpGroups("filter"));
+
+        } catch (Exception exc) {
+            fail("test should not throw an exception");
+        }
+    }
+}
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java
new file mode 100644
index 0000000..fb0a241
--- /dev/null
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyBadProviderImpl.java
@@ -0,0 +1,156 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.models.provider.impl;
+
+import javax.ws.rs.core.Response;
+
+import lombok.NonNull;
+
+import org.onap.policy.models.base.PfConceptKey;
+import org.onap.policy.models.base.PfModelException;
+import org.onap.policy.models.base.PfModelRuntimeException;
+import org.onap.policy.models.pap.concepts.PdpGroups;
+import org.onap.policy.models.provider.PolicyModelsProvider;
+import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicy;
+import org.onap.policy.models.tosca.legacy.concepts.LegacyOperationalPolicy;
+import org.onap.policy.models.tosca.simple.concepts.ToscaServiceTemplate;
+
+/**
+ * Dummy implementation of {@link PolicyModelsProvider} with bad constructor.
+ *
+ * @author Liam Fallon (liam.fallon@est.tech)
+ */
+public class DummyBadProviderImpl implements PolicyModelsProvider {
+    public DummyBadProviderImpl() {
+        throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, "Bad Request");
+    }
+
+    @Override
+    public void close() throws Exception {}
+
+    @Override
+    public void init() throws PfModelException {
+    }
+
+    @Override
+    public ToscaServiceTemplate getPolicyTypes(@NonNull PfConceptKey policyTypeKey) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public ToscaServiceTemplate createPolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
+            throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public ToscaServiceTemplate updatePolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
+            throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public ToscaServiceTemplate deletePolicyTypes(@NonNull PfConceptKey policyTypeKey) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public ToscaServiceTemplate getPolicies(@NonNull PfConceptKey policyKey) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public ToscaServiceTemplate createPolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public ToscaServiceTemplate updatePolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public ToscaServiceTemplate deletePolicies(@NonNull PfConceptKey policyKey) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public LegacyOperationalPolicy getOperationalPolicy(@NonNull String policyId) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public LegacyOperationalPolicy createOperationalPolicy(@NonNull LegacyOperationalPolicy legacyOperationalPolicy)
+            throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public LegacyOperationalPolicy updateOperationalPolicy(@NonNull LegacyOperationalPolicy legacyOperationalPolicy)
+            throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public LegacyOperationalPolicy deleteOperationalPolicy(@NonNull String policyId) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public LegacyGuardPolicy getGuardPolicy(@NonNull String policyId) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public LegacyGuardPolicy createGuardPolicy(@NonNull LegacyGuardPolicy legacyGuardPolicy) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public LegacyGuardPolicy updateGuardPolicy(@NonNull LegacyGuardPolicy legacyGuardPolicy) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public LegacyGuardPolicy deleteGuardPolicy(@NonNull String policyId) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public PdpGroups getPdpGroups(@NonNull String pdpGroupFilter) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public PdpGroups createPdpGroups(@NonNull PdpGroups pdpGroups) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public PdpGroups updatePdpGroups(@NonNull PdpGroups pdpGroups) throws PfModelException {
+        return null;
+    }
+
+    @Override
+    public PdpGroups deletePdpGroups(@NonNull String pdpGroupFilter) throws PfModelException {
+        return null;
+    }
+}
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyConnection.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyConnection.java
new file mode 100644
index 0000000..776e7f5
--- /dev/null
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyConnection.java
@@ -0,0 +1,322 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.models.provider.impl;
+
+import java.sql.Array;
+import java.sql.Blob;
+import java.sql.CallableStatement;
+import java.sql.Clob;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.NClob;
+import java.sql.PreparedStatement;
+import java.sql.SQLClientInfoException;
+import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.sql.SQLXML;
+import java.sql.Savepoint;
+import java.sql.Statement;
+import java.sql.Struct;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.Executor;
+
+/**
+ * Dummy database connection.
+ *
+ * @author Liam Fallon (liam.fallon@est.tech)
+ */
+public class DummyConnection implements Connection {
+
+    @Override
+    public boolean isWrapperFor(Class<?> iface) throws SQLException {
+        return false;
+    }
+
+    @Override
+    public <T> T unwrap(Class<T> iface) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public void abort(Executor executor) throws SQLException {
+        return;
+    }
+
+    @Override
+    public void clearWarnings() throws SQLException {
+        return;
+    }
+
+    @Override
+    public void close() throws SQLException {
+        throw new SQLException("Bad Request");
+    }
+
+    @Override
+    public void commit() throws SQLException {
+        return;
+    }
+
+    @Override
+    public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public Blob createBlob() throws SQLException {
+        return null;
+    }
+
+    @Override
+    public Clob createClob() throws SQLException {
+        return null;
+    }
+
+    @Override
+    public NClob createNClob() throws SQLException {
+        return null;
+    }
+
+    @Override
+    public SQLXML createSQLXML() throws SQLException {
+        return null;
+    }
+
+    @Override
+    public Statement createStatement() throws SQLException {
+        return null;
+    }
+
+    @Override
+    public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
+            throws SQLException {
+        return null;
+    }
+
+    @Override
+    public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public boolean getAutoCommit() throws SQLException {
+        return false;
+    }
+
+    @Override
+    public String getCatalog() throws SQLException {
+        return null;
+    }
+
+    @Override
+    public Properties getClientInfo() throws SQLException {
+        return null;
+    }
+
+    @Override
+    public String getClientInfo(String name) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public int getHoldability() throws SQLException {
+        return 0;
+    }
+
+    @Override
+    public DatabaseMetaData getMetaData() throws SQLException {
+        return null;
+    }
+
+    @Override
+    public int getNetworkTimeout() throws SQLException {
+        return 0;
+    }
+
+    @Override
+    public String getSchema() throws SQLException {
+        return null;
+    }
+
+    @Override
+    public int getTransactionIsolation() throws SQLException {
+        return 0;
+    }
+
+    @Override
+    public Map<String, Class<?>> getTypeMap() throws SQLException {
+        return null;
+    }
+
+    @Override
+    public SQLWarning getWarnings() throws SQLException {
+        return null;
+    }
+
+    @Override
+    public boolean isClosed() throws SQLException {
+        return false;
+    }
+
+    @Override
+    public boolean isReadOnly() throws SQLException {
+        return false;
+    }
+
+    @Override
+    public boolean isValid(int timeout) throws SQLException {
+        return false;
+    }
+
+    @Override
+    public String nativeSQL(String sql) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public CallableStatement prepareCall(String sql) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency,
+            int resultSetHoldability) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public PreparedStatement prepareStatement(String sql) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
+            throws SQLException {
+        return null;
+    }
+
+    @Override
+    public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency,
+            int resultSetHoldability) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public void releaseSavepoint(Savepoint savepoint) throws SQLException {
+        return;
+    }
+
+    @Override
+    public void rollback() throws SQLException {
+        return;
+    }
+
+    @Override
+    public void rollback(Savepoint savepoint) throws SQLException {
+        return;
+    }
+
+    @Override
+    public void setAutoCommit(boolean autoCommit) throws SQLException {
+        return;
+    }
+
+    @Override
+    public void setCatalog(String catalog) throws SQLException {
+        return;
+    }
+
+    @Override
+    public void setClientInfo(Properties properties) throws SQLClientInfoException {
+        return;
+    }
+
+    @Override
+    public void setClientInfo(String name, String value) throws SQLClientInfoException {
+        return;
+    }
+
+    @Override
+    public void setHoldability(int holdability) throws SQLException {
+        return;
+    }
+
+    @Override
+    public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
+        return;
+    }
+
+    @Override
+    public void setReadOnly(boolean readOnly) throws SQLException {
+        return;
+    }
+
+    @Override
+    public Savepoint setSavepoint() throws SQLException {
+        return null;
+    }
+
+    @Override
+    public Savepoint setSavepoint(String name) throws SQLException {
+        return null;
+    }
+
+    @Override
+    public void setSchema(String schema) throws SQLException {
+        return;
+    }
+
+    @Override
+    public void setTransactionIsolation(int level) throws SQLException {
+        return;
+    }
+
+    @Override
+    public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
+        return;
+    }
+}
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderSubImpl.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderSubImpl.java
new file mode 100644
index 0000000..9b68dd0
--- /dev/null
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderSubImpl.java
@@ -0,0 +1,50 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.models.provider.impl;
+
+import lombok.NonNull;
+
+import org.onap.policy.models.provider.PolicyModelsProviderParameters;
+import org.onap.policy.models.tosca.simple.concepts.ToscaServiceTemplate;
+
+/**
+ * Sub class to check getDummyResponse() method in base class.
+ *
+ * @author Liam Fallon (liam.fallon@est.tech)
+ */
+public class DummyPolicyModelsProviderSubImpl extends DummyPolicyModelsProviderImpl {
+    /**
+     * Constructor.
+     *
+     * @param parameters the parameters
+     */
+    public DummyPolicyModelsProviderSubImpl(@NonNull PolicyModelsProviderParameters parameters) {
+        super(parameters);
+    }
+
+    public ToscaServiceTemplate getBadDummyResponse1() {
+        return super.getDummyResponse("/i/dont/exist");
+    }
+
+    public ToscaServiceTemplate getBadDummyResponse2() {
+        return super.getDummyResponse(null);
+    }
+}
diff --git a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderTest.java b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderTest.java
index f7fe5b9..bf3382f 100644
--- a/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderTest.java
+++ b/models-provider/src/test/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderTest.java
@@ -22,28 +22,237 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
 
 import org.junit.Test;
 import org.onap.policy.models.base.PfConceptKey;
-import org.onap.policy.models.base.PfModelException;
+import org.onap.policy.models.pap.concepts.PdpGroups;
 import org.onap.policy.models.provider.PolicyModelsProvider;
 import org.onap.policy.models.provider.PolicyModelsProviderFactory;
+import org.onap.policy.models.provider.PolicyModelsProviderParameters;
+import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicy;
+import org.onap.policy.models.tosca.legacy.concepts.LegacyOperationalPolicy;
 import org.onap.policy.models.tosca.simple.concepts.ToscaServiceTemplate;
 
 /**
- * Test the dummy moldes provider implementation.
+ * Test the dummy models provider implementation.
  *
  * @author Liam Fallon (liam.fallon@est.tech)
  */
 public class DummyPolicyModelsProviderTest {
 
     @Test
-    public void test() throws PfModelException {
-        PolicyModelsProvider dummyProvider = new PolicyModelsProviderFactory().createPolicyModelsProvider();
+    public void testProvider() throws Exception {
+        PolicyModelsProviderParameters parameters = new PolicyModelsProviderParameters();
+        parameters.setImplementation(DummyPolicyModelsProviderImpl.class.getCanonicalName());
+        parameters.setDatabaseUrl("jdbc:dummy");
+        parameters.setPersistenceUnit("dummy");
+
+        PolicyModelsProvider dummyProvider = new PolicyModelsProviderFactory().createPolicyModelsProvider(parameters);
+
+        dummyProvider.init();
 
         ToscaServiceTemplate serviceTemplate = dummyProvider.getPolicies(new PfConceptKey());
         assertNotNull(serviceTemplate);
         assertEquals("onap.vcpe.tca:1.0.0",
                 serviceTemplate.getTopologyTemplate().getPolicies().get("onap.vcpe.tca").getId());
+
+        dummyProvider.close();
+    }
+
+    @Test
+    public void testProviderMethods() throws Exception {
+        PolicyModelsProviderParameters parameters = new PolicyModelsProviderParameters();
+        parameters.setImplementation(DummyPolicyModelsProviderImpl.class.getCanonicalName());
+        parameters.setDatabaseUrl("jdbc:dummy");
+        parameters.setPersistenceUnit("dummy");
+
+        PolicyModelsProvider dummyProvider = new PolicyModelsProviderFactory().createPolicyModelsProvider(parameters);
+        dummyProvider.init();
+
+        assertNotNull(dummyProvider.getPolicyTypes(new PfConceptKey()));
+        assertNotNull(dummyProvider.createPolicyTypes(new ToscaServiceTemplate()));
+        assertNotNull(dummyProvider.updatePolicyTypes(new ToscaServiceTemplate()));
+        assertNotNull(dummyProvider.deletePolicyTypes(new PfConceptKey()));
+
+        assertNotNull(dummyProvider.getPolicies(new PfConceptKey()));
+        assertNotNull(dummyProvider.createPolicies(new ToscaServiceTemplate()));
+        assertNotNull(dummyProvider.updatePolicies(new ToscaServiceTemplate()));
+        assertNotNull(dummyProvider.deletePolicies(new PfConceptKey()));
+
+        assertNotNull(dummyProvider.getOperationalPolicy("policy_id"));
+        assertNotNull(dummyProvider.createOperationalPolicy(new LegacyOperationalPolicy()));
+        assertNotNull(dummyProvider.updateOperationalPolicy(new LegacyOperationalPolicy()));
+        assertNotNull(dummyProvider.deleteOperationalPolicy("policy_id"));
+
+        assertNotNull(dummyProvider.getGuardPolicy("policy_id"));
+        assertNotNull(dummyProvider.createGuardPolicy(new LegacyGuardPolicy()));
+        assertNotNull(dummyProvider.updateGuardPolicy(new LegacyGuardPolicy()));
+        assertNotNull(dummyProvider.deleteGuardPolicy("policy_id"));
+
+        assertNotNull(dummyProvider.getPdpGroups("filter"));
+        assertNotNull(dummyProvider.createPdpGroups(new PdpGroups()));
+        assertNotNull(dummyProvider.updatePdpGroups(new PdpGroups()));
+        assertNotNull(dummyProvider.deletePdpGroups("filter"));
+
+        try {
+            dummyProvider.getPolicyTypes(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyTypeKey is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.createPolicyTypes(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("serviceTemplate is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.updatePolicyTypes(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("serviceTemplate is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.deletePolicyTypes(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyTypeKey is marked @NonNull but is null", npe.getMessage());
+        }
+
+        try {
+            dummyProvider.getPolicies(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyKey is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.createPolicies(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("serviceTemplate is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.updatePolicies(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("serviceTemplate is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.deletePolicies(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyKey is marked @NonNull but is null", npe.getMessage());
+        }
+
+        try {
+            dummyProvider.getOperationalPolicy(null);
+
+
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyId is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.createOperationalPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("legacyOperationalPolicy is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.updateOperationalPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("legacyOperationalPolicy is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.deleteOperationalPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyId is marked @NonNull but is null", npe.getMessage());
+        }
+
+        try {
+            dummyProvider.getGuardPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyId is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.createGuardPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("legacyGuardPolicy is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.updateGuardPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("legacyGuardPolicy is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.deleteGuardPolicy(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("policyId is marked @NonNull but is null", npe.getMessage());
+        }
+
+        try {
+
+
+            dummyProvider.getPdpGroups(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("pdpGroupFilter is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.createPdpGroups(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("pdpGroups is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.updatePdpGroups(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("pdpGroups is marked @NonNull but is null", npe.getMessage());
+        }
+        try {
+            dummyProvider.deletePdpGroups(null);
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("pdpGroupFilter is marked @NonNull but is null", npe.getMessage());
+        }
+
+        dummyProvider.close();
+    }
+
+    @Test
+    public void testDummyResponse() {
+        DummyPolicyModelsProviderSubImpl resp = null;
+
+        try {
+            resp = new DummyPolicyModelsProviderSubImpl(new PolicyModelsProviderParameters());
+            resp.getBadDummyResponse1();
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("error serializing object", npe.getMessage());
+        } finally {
+            if (resp != null) {
+                resp.close();
+            }
+        }
+
+        try {
+            resp = new DummyPolicyModelsProviderSubImpl(new PolicyModelsProviderParameters());
+            resp.getBadDummyResponse2();
+            fail("test should throw an exception");
+        } catch (Exception npe) {
+            assertEquals("fileName is marked @NonNull but is null", npe.getMessage());
+        } finally {
+            if (resp != null) {
+                resp.close();
+            }
+        }
     }
 }
diff --git a/models-tosca/pom.xml b/models-tosca/pom.xml
index 019c5b3..5658a1c 100644
--- a/models-tosca/pom.xml
+++ b/models-tosca/pom.xml
@@ -41,6 +41,12 @@
 
         <dependency>
             <groupId>org.onap.policy.models</groupId>
+            <artifactId>policy-models-dao</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.onap.policy.models</groupId>
             <artifactId>policy-models-examples</artifactId>
             <version>${project.version}</version>
         </dependency>
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/mapping/LegacyOperationalPolicyMapper.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/mapping/LegacyOperationalPolicyMapper.java
index 2c0d508..2f87020 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/mapping/LegacyOperationalPolicyMapper.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/mapping/LegacyOperationalPolicyMapper.java
@@ -52,20 +52,20 @@
 
         // TODO: Find out how to parse the PolicyType from the content
         // TODO: Check if this is the correct way to set the policy type version
-        toscaPolicy.setType(new PfConceptKey("SomeDerivedPolicyType", "1.0.0"));
+        toscaPolicy.setType(new PfConceptKey("SomeDerivedPolicyType", "1.0.1"));
 
         Map<String, String> propertyMap = new HashMap<>();
         toscaPolicy.setProperties(propertyMap);
         toscaPolicy.getProperties().put("Content", legacyOperationalPolicy.getContent());
 
-        PfConceptKey serviceTemplateKey = new PfConceptKey("ServiceTemplate", "1.0.0");
+        PfConceptKey serviceTemplateKey = new PfConceptKey("ServiceTemplate", "1.0.2");
         ToscaServiceTemplate serviceTemplate = new ToscaServiceTemplate(serviceTemplateKey);
         serviceTemplate.setToscaDefinitionsVersion("tosca_simple_yaml_1_0");
 
         PfReferenceKey topologyTemplateKey = new PfReferenceKey(serviceTemplateKey, "TopolocyTemplate");
         serviceTemplate.setTopologyTemplate(new ToscaTopologyTemplate(topologyTemplateKey));
 
-        PfConceptKey policiesKey = new PfConceptKey("Policies", "1.0.0");
+        PfConceptKey policiesKey = new PfConceptKey("Policies", "1.0.3");
         serviceTemplate.getTopologyTemplate().setPolicies(new ToscaPolicies(policiesKey));
         serviceTemplate.getTopologyTemplate().getPolicies().getConceptMap().put(policyKey, toscaPolicy);
 
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/provider/LegacyToscaProvider.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/provider/LegacyToscaProvider.java
new file mode 100644
index 0000000..da9d929
--- /dev/null
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/legacy/provider/LegacyToscaProvider.java
@@ -0,0 +1,139 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.models.tosca.legacy.provider;
+
+import lombok.NonNull;
+
+import org.onap.policy.models.base.PfModelException;
+import org.onap.policy.models.dao.PfDao;
+import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicy;
+import org.onap.policy.models.tosca.legacy.concepts.LegacyOperationalPolicy;
+
+/**
+ * This class provides the provision of information on TOSCA concepts in the database to callers in legacy formats.
+ *
+ * @author Liam Fallon (liam.fallon@est.tech)
+ */
+public class LegacyToscaProvider {
+    /**
+     * Get legacy operational policy.
+     *
+     * @param dao the DAO to use to access the database
+     * @param policyId ID of the policy.
+     * @return the policies found
+     * @throws PfModelException on errors getting policies
+     */
+    public LegacyOperationalPolicy getOperationalPolicy(@NonNull final PfDao dao, @NonNull final String policyId)
+            throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Create legacy operational policy.
+     *
+     * @param dao the DAO to use to access the database
+     * @param legacyOperationalPolicy the definition of the policy to be created.
+     * @return the created policy
+     * @throws PfModelException on errors creating policies
+     */
+    public LegacyOperationalPolicy createOperationalPolicy(@NonNull final PfDao dao,
+            @NonNull final LegacyOperationalPolicy legacyOperationalPolicy) throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Update legacy operational policy.
+     *
+     * @param dao the DAO to use to access the database
+     * @param legacyOperationalPolicy the definition of the policy to be updated
+     * @return the updated policy
+     * @throws PfModelException on errors updating policies
+     */
+    public LegacyOperationalPolicy updateOperationalPolicy(@NonNull final PfDao dao,
+            @NonNull final LegacyOperationalPolicy legacyOperationalPolicy) throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Delete legacy operational policy.
+     *
+     * @param dao the DAO to use to access the database
+     * @param policyId ID of the policy.
+     * @return the deleted policy
+     * @throws PfModelException on errors deleting policies
+     */
+    public LegacyOperationalPolicy deleteOperationalPolicy(@NonNull final PfDao dao, @NonNull final String policyId)
+            throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Get legacy guard policy.
+     *
+     * @param dao the DAO to use to access the database
+     * @param policyId ID of the policy.
+     * @return the policies found
+     * @throws PfModelException on errors getting policies
+     */
+    public LegacyGuardPolicy getGuardPolicy(@NonNull final PfDao dao, @NonNull final String policyId)
+            throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Create legacy guard policy.
+     *
+     * @param dao the DAO to use to access the database
+     * @param legacyGuardPolicy the definition of the policy to be created.
+     * @return the created policy
+     * @throws PfModelException on errors creating policies
+     */
+    public LegacyGuardPolicy createGuardPolicy(@NonNull final PfDao dao,
+            @NonNull final LegacyGuardPolicy legacyGuardPolicy) throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Update legacy guard policy.
+     *
+     * @param dao the DAO to use to access the database
+     * @param legacyGuardPolicy the definition of the policy to be updated
+     * @return the updated policy
+     * @throws PfModelException on errors updating policies
+     */
+    public LegacyGuardPolicy updateGuardPolicy(@NonNull final PfDao dao,
+            @NonNull final LegacyGuardPolicy legacyGuardPolicy) throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Delete legacy guard policy.
+     *
+     * @param dao the DAO to use to access the database
+     * @param policyId ID of the policy.
+     * @return the deleted policy
+     * @throws PfModelException on errors deleting policies
+     */
+    public LegacyGuardPolicy deleteGuardPolicy(@NonNull final PfDao dao, @NonNull final String policyId)
+            throws PfModelException {
+        return null;
+    }
+}
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProvider.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProvider.java
new file mode 100644
index 0000000..3d563a1
--- /dev/null
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/simple/provider/SimpleToscaProvider.java
@@ -0,0 +1,142 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.models.tosca.simple.provider;
+
+import lombok.NonNull;
+
+import org.onap.policy.models.base.PfConceptKey;
+import org.onap.policy.models.base.PfModelException;
+import org.onap.policy.models.dao.PfDao;
+import org.onap.policy.models.tosca.simple.concepts.ToscaServiceTemplate;
+
+/**
+ * This class provides the provision of information on TOSCA concepts in the database to callers.
+ *
+ * @author Liam Fallon (liam.fallon@est.tech)
+ */
+public class SimpleToscaProvider {
+    /**
+     * Get policy types.
+     *
+     * @param dao the DAO to use to access the database
+     * @param policyTypeKey the policy type key for the policy types to be retrieved. A null key name returns all policy
+     *        types. A null key version returns all versions of the policy type name specified in the key.
+     * @return the policy types found
+     * @throws PfModelException on errors getting policy types
+     */
+    public ToscaServiceTemplate getPolicyTypes(@NonNull final PfDao dao, @NonNull final PfConceptKey policyTypeKey)
+            throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Create policy types.
+     *
+     * @param dao the DAO to use to access the database
+     * @param serviceTemplate the service template containing the definition of the policy types to be created
+     * @return the TOSCA service template containing the created policy types
+     * @throws PfModelException on errors creating policy types
+     */
+    public ToscaServiceTemplate createPolicyTypes(@NonNull final PfDao dao,
+            @NonNull final ToscaServiceTemplate serviceTemplate) throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Create policy types.
+     *
+     * @param dao the DAO to use to access the database
+     * @param serviceTemplate the service template containing the definition of the policy types to be modified
+     * @return the TOSCA service template containing the modified policy types
+     * @throws PfModelException on errors updating policy types
+     */
+    public ToscaServiceTemplate updatePolicyTypes(@NonNull final PfDao dao,
+            @NonNull final ToscaServiceTemplate serviceTemplate) throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Delete policy types.
+     *
+     * @param dao the DAO to use to access the database
+     * @param policyTypeKey the policy type key for the policy types to be deleted, if the version of the key is null,
+     *        all versions of the policy type are deleted.
+     * @return the TOSCA service template containing the policy types that were deleted
+     * @throws PfModelException on errors deleting policy types
+     */
+    public ToscaServiceTemplate deletePolicyTypes(@NonNull final PfDao dao, @NonNull final PfConceptKey policyTypeKey)
+            throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Get policies.
+     *
+     * @param dao the DAO to use to access the database
+     * @param policyKey the policy key for the policies to be retrieved. The parent name and version must be specified.
+     *        A null local name returns all policies for a parent policy type.
+     * @return the policies found
+     * @throws PfModelException on errors getting policies
+     */
+    public ToscaServiceTemplate getPolicies(@NonNull final PfDao dao, @NonNull final PfConceptKey policyKey)
+            throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Create policies.
+     *
+     * @param dao the DAO to use to access the database
+     * @param serviceTemplate the service template containing the definitions of the new policies to be created.
+     * @return the TOSCA service template containing the policy types that were created
+     * @throws PfModelException on errors creating policies
+     */
+    public ToscaServiceTemplate createPolicies(@NonNull final PfDao dao,
+            @NonNull final ToscaServiceTemplate serviceTemplate) throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Update policies.
+     *
+     * @param dao the DAO to use to access the database
+     * @param serviceTemplate the service template containing the definitions of the policies to be updated.
+     * @return the TOSCA service template containing the policies that were updated
+     * @throws PfModelException on errors updating policies
+     */
+    public ToscaServiceTemplate updatePolicies(@NonNull final PfDao dao,
+            @NonNull final ToscaServiceTemplate serviceTemplate) throws PfModelException {
+        return null;
+    }
+
+    /**
+     * Delete policies.
+     *
+     * @param dao the DAO to use to access the database
+     * @param policyKey the policy key
+     * @return the TOSCA service template containing the policy types that were deleted
+     * @throws PfModelException on errors deleting policies
+     */
+    public ToscaServiceTemplate deletePolicies(@NonNull final PfDao dao, @NonNull final PfConceptKey policyKey)
+            throws PfModelException {
+        return null;
+    }
+}
