Dashboard using policy agent NBI

Change-Id: I21081d49a1ce3704a4e88e009ae92003efa96d18
Issue-ID: NONRTRIC-84
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
diff --git a/dashboard/webapp-backend/pom.xml b/dashboard/webapp-backend/pom.xml
index 215ec75..80bb585 100644
--- a/dashboard/webapp-backend/pom.xml
+++ b/dashboard/webapp-backend/pom.xml
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--<![CDATA[
+<!--
+
+
+<![CDATA[
 ========================LICENSE_START=================================
 O-RAN-SC
 %%
@@ -18,287 +21,295 @@
 limitations under the License.
 ========================LICENSE_END===================================
 ]]>-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<project
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-		<groupId>org.o-ran-sc.nonrt.ric-dashboard</groupId>
-		<artifactId>ric-dash-parent</artifactId>
-		<version>1.0.0-SNAPSHOT</version>
-	</parent>
-	<artifactId>ric-dash-be</artifactId>
-	<name>NonRT RIC Dashboard Webapp backend</name>
-	<properties>
-		<springfox.version>2.9.2</springfox.version>
-		<!-- Set by Jenkins -->
-		<build.number>0</build.number>
-	</properties>
-	<repositories>
-		<repository>
-			<id>onap-releases</id>
-			<name>ONAP - Release Repository</name>
-			<url>https://nexus.onap.org/content/repositories/releases</url>
-		</repository>
-	</repositories>
-	<dependencies>
-		<!-- Platform components -->
-		<dependency>
-			<groupId>org.o-ran-sc.ric.plt.a1controller.client</groupId>
-			<artifactId>a1-controller-client</artifactId>
-			<version>0.1.0-SNAPSHOT</version>
-		</dependency>
-		<dependency>
-			<groupId>org.onap.portal.sdk</groupId>
-			<artifactId>epsdk-fw</artifactId>
-			<version>2.6.0</version>
-			<exclusions>
-				<exclusion>
-					<groupId>commons-logging</groupId>
-					<artifactId>commons-logging</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>log4j</groupId>
-					<artifactId>log4j</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>log4j</groupId>
-					<artifactId>apache-log4j-extras</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>org.slf4j</groupId>
-					<artifactId>slf4j-log4j12</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>junit</groupId>
-					<artifactId>junit</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>commons-fileupload</groupId>
-					<artifactId>commons-fileupload</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>commons-beanutils</groupId>
-					<artifactId>commons-beanutils</artifactId>
-				</exclusion>
-				<!-- EELF omits "test" scope on this dependency -->
-				<exclusion>
-					<groupId>org.powermock</groupId>
-					<artifactId>powermock-module-junit4</artifactId>
-				</exclusion>
-				<!-- EELF omits "test" scope on this dependency -->
-				<exclusion>
-					<groupId>org.powermock</groupId>
-					<artifactId>powermock-api-mockito</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-starter-security</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-starter-web</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-api</artifactId>
-		</dependency>
-		<!-- Bridge uses of Apache commons logging, like EPSDK-FW -->
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>jcl-over-slf4j</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>ch.qos.logback</groupId>
-			<artifactId>logback-classic</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>ch.qos.logback</groupId>
-			<artifactId>logback-core</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>io.springfox</groupId>
-			<artifactId>springfox-swagger2</artifactId>
-			<version>${springfox.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>io.springfox</groupId>
-			<artifactId>springfox-swagger-ui</artifactId>
-			<version>${springfox.version}</version>
-		</dependency>
-		<!-- Test dependencies -->
-		<!-- Mockito supports development, not just testing -->
-		<dependency>
-			<groupId>org.mockito</groupId>
-			<artifactId>mockito-core</artifactId>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-starter-test</artifactId>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.junit.jupiter</groupId>
-			<artifactId>junit-jupiter-api</artifactId>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.junit.jupiter</groupId>
-			<artifactId>junit-jupiter-engine</artifactId>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.junit.platform</groupId>
-			<artifactId>junit-platform-launcher</artifactId>
-			<!-- Override Spring-Boot choice for Eclipse -->
-			<version>1.4.2</version>
-			<scope>test</scope>
-		</dependency>
-	</dependencies>
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.springframework.boot</groupId>
-				<artifactId>spring-boot-maven-plugin</artifactId>
-			</plugin>
-			<plugin>
-				<!-- Most configuration and all execution is inherited -->
-				<groupId>org.codehaus.mojo</groupId>
-				<artifactId>license-maven-plugin</artifactId>
-				<configuration>
-					<roots>
-						<root>src</root>
-					</roots>
-					<excludes>
-						<exclude>**/*.json</exclude>
-					</excludes>
-				</configuration>
-			</plugin>
-			<!-- Add the build number to the jar manifest. Spring-Boot uses a complex 
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.o-ran-sc.nonrt.ric-dashboard</groupId>
+        <artifactId>ric-dash-parent</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>ric-dash-be</artifactId>
+    <name>NonRT RIC Dashboard Webapp backend</name>
+    <properties>
+        <springfox.version>2.9.2</springfox.version>
+        <immutable.version>2.7.1</immutable.version>
+        <!-- Set by Jenkins -->
+        <build.number>0</build.number>
+    </properties>
+    <repositories>
+        <repository>
+            <id>onap-releases</id>
+            <name>ONAP - Release Repository</name>
+            <url>https://nexus.onap.org/content/repositories/releases</url>
+        </repository>
+    </repositories>
+    <dependencies>
+        <!-- Platform components -->
+        <dependency>
+            <groupId>org.onap.portal.sdk</groupId>
+            <artifactId>epsdk-fw</artifactId>
+            <version>2.6.0</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-logging</groupId>
+                    <artifactId>commons-logging</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>log4j</groupId>
+                    <artifactId>log4j</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>log4j</groupId>
+                    <artifactId>apache-log4j-extras</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>junit</groupId>
+                    <artifactId>junit</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>commons-fileupload</groupId>
+                    <artifactId>commons-fileupload</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>commons-beanutils</groupId>
+                    <artifactId>commons-beanutils</artifactId>
+                </exclusion>
+                <!-- EELF omits "test" scope on this dependency -->
+                <exclusion>
+                    <groupId>org.powermock</groupId>
+                    <artifactId>powermock-module-junit4</artifactId>
+                </exclusion>
+                <!-- EELF omits "test" scope on this dependency -->
+                <exclusion>
+                    <groupId>org.powermock</groupId>
+                    <artifactId>powermock-api-mockito</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-security</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <!-- Bridge uses of Apache commons logging, like EPSDK-FW -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger2</artifactId>
+            <version>${springfox.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>io.springfox</groupId>
+            <artifactId>springfox-swagger-ui</artifactId>
+            <version>${springfox.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.immutables</groupId>
+            <artifactId>value</artifactId>
+            <version>${immutable.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.immutables</groupId>
+            <artifactId>gson</artifactId>
+            <version>${immutable.version}</version>
+        </dependency>
+        <!-- Test dependencies -->
+        <!-- Mockito supports development, not just testing -->
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-engine</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.platform</groupId>
+            <artifactId>junit-platform-launcher</artifactId>
+            <!-- Override Spring-Boot choice for Eclipse -->
+            <version>1.4.2</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <!-- Most configuration and all execution is inherited -->
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>license-maven-plugin</artifactId>
+                <configuration>
+                    <roots>
+                        <root>src</root>
+                    </roots>
+                    <excludes>
+                        <exclude>**/*.json</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+            <!-- Add the build number to the jar manifest. Spring-Boot uses a complex 
 				packaging process that makes access to the original Manifest.MF very difficult. 
 				However, Java provides access to the implementation version for a package, 
 				so cram the build number into there. -->
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-jar-plugin</artifactId>
-				<configuration>
-					<archive>
-						<manifest>
-							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
-						</manifest>
-						<manifestEntries>
-							<Implementation-Version>${project.version}-b${build.number}</Implementation-Version>
-						</manifestEntries>
-					</archive>
-				</configuration>
-			</plugin>
-			<plugin>
-				<artifactId>maven-resources-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>copy-resources</id>
-						<phase>validate</phase>
-						<goals>
-							<goal>copy-resources</goal>
-						</goals>
-						<configuration>
-							<outputDirectory>${project.build.directory}/classes/resources/</outputDirectory>
-							<resources>
-								<resource>
-									<directory>${project.parent.basedir}/webapp-frontend/dist/dashApp/</directory>
-								</resource>
-							</resources>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-			<!-- do not deploy a jar or pom file -->
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-deploy-plugin</artifactId>
-				<configuration>
-					<skip>true</skip>
-				</configuration>
-			</plugin>
-			<plugin>
-				<groupId>org.jacoco</groupId>
-				<artifactId>jacoco-maven-plugin</artifactId>
-				<version>0.8.4</version>
-				<executions>
-					<execution>
-						<id>default-prepare-agent</id>
-						<goals>
-							<goal>prepare-agent</goal>
-						</goals>
-					</execution>
-					<execution>
-						<id>default-report</id>
-						<phase>prepare-package</phase>
-						<goals>
-							<goal>report</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
-			<!-- https://stackoverflow.com/questions/39126226/fabric8-springboot-full-example -->
-			<plugin>
-				<groupId>io.fabric8</groupId>
-				<artifactId>docker-maven-plugin</artifactId>
-				<version>0.30.0</version>
-				<configuration>
-					<verbose>true</verbose>
-					<!-- environment variables supplied by Jenkins -->
-					<pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>
-					<pushRegistry>${env.CONTAINER_PUSH_REGISTRY}</pushRegistry>
-					<images>
-						<image>
-							<!-- Specify a tag to avoid default tag "latest" -->
-							<!-- Avoid maven artifact name here -->
-							<name>o-ran-sc/nonrtric-dashboard:${project.version}</name>
-							<build>
-								<from>openjdk:11-jre-slim</from>
-								<tags>
-									<!-- Add tag with build number -->
-									<tag>${project.version}</tag>
-								</tags>
-								<assembly>
-									<descriptorRef>artifact</descriptorRef>
-								</assembly>
-								<runCmds>
-									<!-- Ensure logs dir exists and is world writable -->
-									<runCmd>mkdir /logs</runCmd>
-									<runCmd>chmod -R 777 /logs</runCmd>
-								</runCmds>
-								<cmd>
-									<!-- Include maven dir on classpath for prop files -->
-									<exec>
-										<arg>java</arg>
-										<arg>-Xms128m</arg>
-										<arg>-Xmx256m</arg>
-										<arg>-cp</arg>
-										<arg>maven:maven/${project.artifactId}-${project.version}.${project.packaging}</arg>
-										<arg>-Dloader.main=org.oransc.ric.portal.dashboard.DashboardApplication</arg>
-										<arg>-Djava.security.egd=file:/dev/./urandom</arg>
-										<arg>org.springframework.boot.loader.PropertiesLauncher</arg>
-									</exec>
-								</cmd>
-							</build>
-						</image>
-					</images>
-				</configuration>
-				<!-- build Docker images in install phase, push in deploy phase -->
-				<executions>
-					<execution>
-						<goals>
-							<goal>build</goal>
-							<goal>push</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifest>
+                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+                        </manifest>
+                        <manifestEntries>
+                            <Implementation-Version>${project.version}-b${build.number}</Implementation-Version>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/classes/resources/</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>${project.parent.basedir}/webapp-frontend/dist/dashApp/</directory>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- do not deploy a jar or pom file -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <configuration>
+                    <skip>true</skip>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.jacoco</groupId>
+                <artifactId>jacoco-maven-plugin</artifactId>
+                <version>0.8.4</version>
+                <executions>
+                    <execution>
+                        <id>default-prepare-agent</id>
+                        <goals>
+                            <goal>prepare-agent</goal>
+                        </goals>
+                    </execution>
+                    <execution>
+                        <id>default-report</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>report</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- https://stackoverflow.com/questions/39126226/fabric8-springboot-full-example -->
+            <plugin>
+                <groupId>io.fabric8</groupId>
+                <artifactId>docker-maven-plugin</artifactId>
+                <version>0.30.0</version>
+                <configuration>
+                    <verbose>true</verbose>
+                    <!-- environment variables supplied by Jenkins -->
+                    <pullRegistry>${env.CONTAINER_PULL_REGISTRY}</pullRegistry>
+                    <pushRegistry>${env.CONTAINER_PUSH_REGISTRY}</pushRegistry>
+                    <images>
+                        <image>
+                            <!-- Specify a tag to avoid default tag "latest" -->
+                            <!-- Avoid maven artifact name here -->
+                            <name>o-ran-sc/nonrtric-dashboard:${project.version}</name>
+                            <build>
+                                <from>openjdk:11-jre-slim</from>
+                                <tags>
+                                    <!-- Add tag with build number -->
+                                    <tag>${project.version}</tag>
+                                </tags>
+                                <assembly>
+                                    <descriptorRef>artifact</descriptorRef>
+                                </assembly>
+                                <runCmds>
+                                    <!-- Ensure logs dir exists and is world writable -->
+                                    <runCmd>mkdir /logs</runCmd>
+                                    <runCmd>chmod -R 777 /logs</runCmd>
+                                </runCmds>
+                                <cmd>
+                                    <!-- Include maven dir on classpath for prop files -->
+                                    <exec>
+                                        <arg>java</arg>
+                                        <arg>-Xms128m</arg>
+                                        <arg>-Xmx256m</arg>
+                                        <arg>-cp</arg>
+                                        <arg>maven:maven/${project.artifactId}-${project.version}.${project.packaging}</arg>
+                                        <arg>-Dloader.main=org.oransc.ric.portal.dashboard.DashboardApplication</arg>
+                                        <arg>-Djava.security.egd=file:/dev/./urandom</arg>
+                                        <arg>org.springframework.boot.loader.PropertiesLauncher</arg>
+                                    </exec>
+                                </cmd>
+                            </build>
+                        </image>
+                    </images>
+                </configuration>
+                <!-- build Docker images in install phase, push in deploy phase -->
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>build</goal>
+                            <goal>push</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/DashboardConstants.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/DashboardConstants.java
index d61ce1d..b82aa64 100644
--- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/DashboardConstants.java
+++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/DashboardConstants.java
@@ -38,7 +38,7 @@
 	private static final String ROLE_PREFIX = "ROLE_";
 	public static final String ROLE_ADMIN = ROLE_PREFIX + ROLE_NAME_ADMIN;
 	public static final String ROLE_STANDARD = ROLE_PREFIX + ROLE_NAME_STANDARD;
-	public static final String A1_CONTROLLER_USERNAME = "admin";
-	public static final String A1_CONTROLLER_PASSWORD = "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U";
+	public static final String POLICY_CONTROLLER_USERNAME = "admin";
+	public static final String POLICY_CONTROLLER_PASSWORD = "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U";
 
 }
diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/A1ControllerConfiguration.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/A1ControllerConfiguration.java
deleted file mode 100644
index ffdcacd..0000000
--- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/A1ControllerConfiguration.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * 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.
- * ========================LICENSE_END===================================
- */
-package org.oransc.ric.portal.dashboard.config;
-
-import java.lang.invoke.MethodHandles;
-import org.oransc.ric.a1controller.client.api.A1ControllerApi;
-import org.oransc.ric.a1controller.client.invoker.ApiClient;
-import org.oransc.ric.portal.dashboard.DashboardConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-import org.springframework.web.client.RestTemplate;
-import org.springframework.web.util.DefaultUriBuilderFactory;
-
-/**
- * Creates an A1 controller client as a bean to be managed by the Spring
- * container.
- */
-@Configuration
-@Profile("!test")
-public class A1ControllerConfiguration {
-
-	private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-	public static final String A1_CONTROLLER_USERNAME = DashboardConstants.A1_CONTROLLER_USERNAME;
-	public static final String A1_CONTROLLER_PASSWORD = DashboardConstants.A1_CONTROLLER_PASSWORD;
-
-	// Populated by the autowired constructor
-	private final String a1ControllerUrl;
-
-	@Autowired
-	public A1ControllerConfiguration(@Value("${a1controller.url.prefix}") final String urlPrefix, //
-			@Value("${a1controller.url.suffix}") final String urlSuffix) {
-		logger.debug("ctor prefix '{}' suffix '{}'", urlPrefix, urlSuffix);
-		a1ControllerUrl = new DefaultUriBuilderFactory(urlPrefix.trim()).builder().path(urlSuffix.trim()).build().normalize()
-				.toString();
-		logger.info("Configuring A1 Controller at URL {}", a1ControllerUrl);
-	}
-
-	private ApiClient apiClient() {
-		ApiClient apiClient = new ApiClient(new RestTemplate());
-		apiClient.setBasePath(a1ControllerUrl);
-		apiClient.setUsername(A1_CONTROLLER_USERNAME);
-		apiClient.setPassword(A1_CONTROLLER_PASSWORD);
-		return apiClient;
-	}
-
-	@Bean
-	// The bean (method) name must be globally unique
-	public A1ControllerApi a1ControllerApi() {
-		return new A1ControllerApi(apiClient());
-	}
-
-}
diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/WebSecurityConfiguration.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/WebSecurityConfiguration.java
index 0a7f02c..85a96d0 100644
--- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/WebSecurityConfiguration.java
+++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/WebSecurityConfiguration.java
@@ -23,9 +23,9 @@
 import java.io.IOException;
 import java.lang.invoke.MethodHandles;
 import java.lang.reflect.InvocationTargetException;
+
 import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
 import org.oransc.ric.portal.dashboard.DashboardUserManager;
-import org.oransc.ric.portal.dashboard.controller.A1Controller;
 import org.oransc.ric.portal.dashboard.controller.SimpleErrorController;
 import org.oransc.ric.portal.dashboard.portalapi.PortalAuthManager;
 import org.oransc.ric.portal.dashboard.portalapi.PortalAuthenticationFilter;
@@ -43,6 +43,7 @@
 import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
 import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
 import org.springframework.security.web.csrf.CookieCsrfTokenRepository;
+import org.oransc.ric.portal.dashboard.controller.PolicyController;
 
 @Configuration
 @EnableWebSecurity
@@ -71,7 +72,7 @@
 	DashboardUserManager userManager;
 
 	@Override
-    protected void configure(HttpSecurity http) throws Exception {
+	protected void configure(HttpSecurity http) throws Exception {
 		logger.debug("configure: portalapi.username {}", userName);
 		// A chain of ".and()" always baffles me
 		http.authorizeRequests().anyRequest().authenticated();
@@ -90,7 +91,7 @@
 			"/swagger-ui.html", //
 			"/webjars/**", //
 			PortalApiConstants.API_PREFIX + "/**", //
-			A1Controller.CONTROLLER_PATH + "/" + A1Controller.VERSION_METHOD, //					
+			PolicyController.CONTROLLER_PATH + "/" + PolicyController.VERSION_METHOD, //
 			SimpleErrorController.ERROR_PATH };
 
 	@Override
diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/A1Controller.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/A1Controller.java
deleted file mode 100644
index 08b485e..0000000
--- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/A1Controller.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * 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.
- * ========================LICENSE_END===================================
- */
-package org.oransc.ric.portal.dashboard.controller;
-
-import java.lang.invoke.MethodHandles;
-import java.util.List;
-import javax.servlet.http.HttpServletResponse;
-import org.oransc.ric.a1controller.client.api.A1ControllerApi;
-import org.oransc.ric.a1controller.client.model.InputNRRidPTidPIidPISchema;
-import org.oransc.ric.a1controller.client.model.InputNRRidPTidPIidPISchemaInput;
-import org.oransc.ric.a1controller.client.model.InputNRRidPTidPIidSchema;
-import org.oransc.ric.a1controller.client.model.InputNRRidPTidPIidSchemaInput;
-import org.oransc.ric.a1controller.client.model.InputNRRidPTidSchema;
-import org.oransc.ric.a1controller.client.model.InputNRRidPTidSchemaInput;
-import org.oransc.ric.a1controller.client.model.InputNRRidSchema;
-import org.oransc.ric.a1controller.client.model.InputNRRidSchemaInput;
-import org.oransc.ric.a1controller.client.model.OutputCodeSchema;
-import org.oransc.ric.a1controller.client.model.OutputDescNamePTCodeSchema;
-import org.oransc.ric.a1controller.client.model.OutputDescNamePTCodeSchemaOutput;
-import org.oransc.ric.a1controller.client.model.OutputPICodeSchema;
-import org.oransc.ric.a1controller.client.model.OutputPIidsListCodeSchema;
-import org.oransc.ric.a1controller.client.model.OutputPTidsListCodeSchema;
-import org.oransc.ric.portal.dashboard.DashboardApplication;
-import org.oransc.ric.portal.dashboard.DashboardConstants;
-import org.oransc.ric.portal.dashboard.exceptions.HttpBadRequestException;
-import org.oransc.ric.portal.dashboard.exceptions.HttpInternalServerErrorException;
-import org.oransc.ric.portal.dashboard.exceptions.HttpNotFoundException;
-import org.oransc.ric.portal.dashboard.exceptions.HttpNotImplementedException;
-import org.oransc.ric.portal.dashboard.model.PolicyInstance;
-import org.oransc.ric.portal.dashboard.model.PolicyInstances;
-import org.oransc.ric.portal.dashboard.model.PolicyType;
-import org.oransc.ric.portal.dashboard.model.PolicyTypes;
-import org.oransc.ric.portal.dashboard.model.SuccessTransport;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.security.access.annotation.Secured;
-import org.springframework.util.Assert;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * Proxies calls from the front end to the A1 Controller via the A1 Mediator
- * API.
- *
- * If a method throws RestClientResponseException, it is handled by
- * {@link CustomResponseEntityExceptionHandler#handleProxyMethodException(Exception,
- * org.springframework.web.context.request.WebRequest)}
- * which returns status 502. All other exceptions are handled by Spring which
- * returns status 500.
- */
-@RestController
-@RequestMapping(value = A1Controller.CONTROLLER_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
-public class A1Controller {
-
-    private static final String NEAR_RT_RIC_ID = "NearRtRic1";
-
-	private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-	// Publish paths in constants so tests are easy to write
-	public static final String CONTROLLER_PATH = DashboardConstants.ENDPOINT_PREFIX + "/policy";
-	// Endpoints
-	public static final String VERSION_METHOD = DashboardConstants.VERSION_METHOD;
-	public static final String POLICY_TYPES_METHOD = "policytypes";
-	public static final String POLICY_TYPE_ID_NAME = "policy_type_id";
-	public static final String POLICIES_NAME = "policies";
-	public static final String POLICY_INSTANCE_ID_NAME = "policy_instance_id";
-
-	// Populated by the autowired constructor
-	private final A1ControllerApi a1ControllerApi;
-
-	@Autowired
-	public A1Controller(final A1ControllerApi A1ControllerApi) {
-		Assert.notNull(A1ControllerApi, "API must not be null");
-		this.a1ControllerApi = A1ControllerApi;
-		if (logger.isDebugEnabled())
-			logger.debug("ctor: configured with client type {}", A1ControllerApi.getClass().getName());
-	}
-
-	@ApiOperation(value = "Gets the A1 client library MANIFEST.MF property Implementation-Version.",
-	        response = SuccessTransport.class)
-	@GetMapping(VERSION_METHOD)
-	// No role required
-	public SuccessTransport getA1ControllerClientVersion() {
-		return new SuccessTransport(200, DashboardApplication.getImplementationVersion(A1ControllerApi.class));
-	}
-
-	/*
-	 * The fields are defined in the A1Control Typescript interface.
-	 */
-	@ApiOperation(value = "Gets the policy types from Near Realtime-RIC via the A1 Controller API")
-	@GetMapping(POLICY_TYPES_METHOD)
-	@Secured({ DashboardConstants.ROLE_ADMIN, DashboardConstants.ROLE_STANDARD })
-	public Object getAllPolicyTypes(HttpServletResponse response) {
-		logger.debug("getAllPolicyTypes");
-		InputNRRidSchemaInput nrrid = new InputNRRidSchemaInput();
-		nrrid.setNearRtRicId(NEAR_RT_RIC_ID);
-		InputNRRidSchema inputSchema = new InputNRRidSchema();
-		inputSchema.setInput(nrrid);
-		OutputPTidsListCodeSchema outputPTidsListCodeSchema =
-		        a1ControllerApi.a1ControllerGetAllPolicyTypes(inputSchema);
-		checkHttpError(outputPTidsListCodeSchema.getOutput().getCode());
-		List<Integer> policyTypeIds = outputPTidsListCodeSchema.getOutput().getPolicyTypeIdList();
-		PolicyTypes policyTypes = new PolicyTypes();
-		InputNRRidPTidSchema typeSchema = new InputNRRidPTidSchema();
-		InputNRRidPTidSchemaInput typeId = new InputNRRidPTidSchemaInput();
-		typeId.setNearRtRicId(NEAR_RT_RIC_ID);
-		for (Integer policyTypeId : policyTypeIds) {
-			typeId.setPolicyTypeId(policyTypeId);
-			typeSchema.setInput(typeId);
-			OutputDescNamePTCodeSchema controllerGetPolicyType =
-			        a1ControllerApi.a1ControllerGetPolicyType(typeSchema);
-			checkHttpError(controllerGetPolicyType.getOutput().getCode());
-			OutputDescNamePTCodeSchemaOutput policyTypeSchema = controllerGetPolicyType.getOutput();
-			PolicyType type = new PolicyType(policyTypeId, policyTypeSchema.getName(),
-				policyTypeSchema.getPolicyType().toString());
-			policyTypes.add(type);
-		}
-		return policyTypes;
-	}
-
-	@ApiOperation(value = "Returns the policy instances for the given policy type.")
-	@GetMapping(POLICY_TYPES_METHOD + "/{" + POLICY_TYPE_ID_NAME + "}/" + POLICIES_NAME)
-	@Secured({ DashboardConstants.ROLE_ADMIN, DashboardConstants.ROLE_STANDARD })
-	public Object getPolicyInstances(@PathVariable(POLICY_TYPE_ID_NAME) String policyTypeIdString) {
-		logger.debug("getPolicyInstances {}", policyTypeIdString);
-		InputNRRidPTidSchemaInput typeIdInput = new InputNRRidPTidSchemaInput();
-		typeIdInput.setNearRtRicId(NEAR_RT_RIC_ID);
-		Integer policyTypeId = Integer.decode(policyTypeIdString);
-		typeIdInput.setPolicyTypeId(policyTypeId);
-		InputNRRidPTidSchema inputSchema = new InputNRRidPTidSchema();
-		inputSchema.setInput(typeIdInput);
-		OutputPIidsListCodeSchema controllerGetAllInstancesForType =
-		        a1ControllerApi.a1ControllerGetAllInstancesForType(inputSchema);
-		checkHttpError(controllerGetAllInstancesForType.getOutput().getCode());
-		List<String> instancesForType = controllerGetAllInstancesForType.getOutput().getPolicyInstanceIdList();
-		PolicyInstances instances = new PolicyInstances();
-		InputNRRidPTidPIidSchemaInput instanceIdInput = new InputNRRidPTidPIidSchemaInput();
-		instanceIdInput.setNearRtRicId(NEAR_RT_RIC_ID);
-		instanceIdInput.setPolicyTypeId(policyTypeId);
-		InputNRRidPTidPIidSchema instanceInputSchema = new InputNRRidPTidPIidSchema();
-		for (String instanceId : instancesForType) {
-			instanceIdInput.setPolicyInstanceId(instanceId);
-			instanceInputSchema.setInput(instanceIdInput);
-			OutputPICodeSchema policyInstance =
-			        a1ControllerApi.a1ControllerGetPolicyInstance(instanceInputSchema);
-			checkHttpError(policyInstance.getOutput().getCode());
-			PolicyInstance instance =
-			        new PolicyInstance(instanceId, policyInstance.getOutput().getPolicyInstance());
-			instances.add(instance);
-		}
-		return instances;
-	}
-
-	@ApiOperation(value = "Returns a policy instance of a type")
-	@GetMapping(POLICY_TYPES_METHOD + "/{" + POLICY_TYPE_ID_NAME + "}/" + POLICIES_NAME + "/{"
-	        + POLICY_INSTANCE_ID_NAME + "}")
-	@Secured({ DashboardConstants.ROLE_ADMIN, DashboardConstants.ROLE_STANDARD })
-	public Object getPolicyInstance(@PathVariable(POLICY_TYPE_ID_NAME) String policyTypeIdString,
-			@PathVariable(POLICY_INSTANCE_ID_NAME) String policyInstanceId) {
-		logger.debug("getPolicyInstance {}:{}", policyTypeIdString, policyInstanceId);
-		InputNRRidPTidPIidSchemaInput instanceIdInput = new InputNRRidPTidPIidSchemaInput();
-		instanceIdInput.setNearRtRicId(NEAR_RT_RIC_ID);
-		instanceIdInput.setPolicyTypeId(Integer.decode(policyTypeIdString));
-		instanceIdInput.setPolicyInstanceId(policyInstanceId);
-		InputNRRidPTidPIidSchema inputSchema = new InputNRRidPTidPIidSchema();
-		inputSchema.setInput(instanceIdInput);
-		OutputPICodeSchema policyInstance = a1ControllerApi.a1ControllerGetPolicyInstance(inputSchema);
-		checkHttpError(policyInstance.getOutput().getCode());
-		return policyInstance.getOutput().getPolicyInstance();
-	}
-
-	@ApiOperation(value = "Creates the policy instances for the given policy type.")
-	@PutMapping(POLICY_TYPES_METHOD + "/{" + POLICY_TYPE_ID_NAME + "}/" + POLICIES_NAME + "/{"
-	        + POLICY_INSTANCE_ID_NAME + "}")
-	@Secured({ DashboardConstants.ROLE_ADMIN })
-	public void putPolicyInstance(@PathVariable(POLICY_TYPE_ID_NAME) String policyTypeIdString,
-			@PathVariable(POLICY_INSTANCE_ID_NAME) String policyInstanceId, @RequestBody String instance) {
-		logger.debug("putPolicyInstance typeId: {}, instanceId: {}, instance: {}", policyTypeIdString,
-		        policyInstanceId, instance);
-		InputNRRidPTidPIidPISchemaInput createInstanceInput = new InputNRRidPTidPIidPISchemaInput();
-		createInstanceInput.setNearRtRicId(NEAR_RT_RIC_ID);
-		createInstanceInput.setPolicyTypeId(Integer.decode(policyTypeIdString));
-		createInstanceInput.setPolicyInstanceId(policyInstanceId);
-		createInstanceInput.setPolicyInstance(instance);
-		InputNRRidPTidPIidPISchema inputSchema = new InputNRRidPTidPIidPISchema();
-		inputSchema.setInput(createInstanceInput);
-		OutputCodeSchema outputCodeSchema = a1ControllerApi.a1ControllerCreatePolicyInstance(inputSchema);
-		checkHttpError(outputCodeSchema.getOutput().getCode());
-	}
-
-	@ApiOperation(value = "Deletes the policy instances for the given policy type.")
-	@DeleteMapping(POLICY_TYPES_METHOD + "/{" + POLICY_TYPE_ID_NAME + "}/" + POLICIES_NAME + "/{"
-			+ POLICY_INSTANCE_ID_NAME + "}")
-	@Secured({ DashboardConstants.ROLE_ADMIN })
-	public void deletePolicyInstance(@PathVariable(POLICY_TYPE_ID_NAME) String policyTypeIdString,
-			@PathVariable(POLICY_INSTANCE_ID_NAME) String policyInstanceId) {
-		logger.debug("deletePolicyInstance typeId: {}, instanceId: {}", policyTypeIdString, policyInstanceId);
-		InputNRRidPTidPIidSchemaInput instanceIdInput = new InputNRRidPTidPIidSchemaInput();
-		instanceIdInput.setNearRtRicId(NEAR_RT_RIC_ID);
-		instanceIdInput.setPolicyTypeId(Integer.decode(policyTypeIdString));
-		instanceIdInput.setPolicyInstanceId(policyInstanceId);
-		InputNRRidPTidPIidSchema inputSchema = new InputNRRidPTidPIidSchema();
-		inputSchema.setInput(instanceIdInput);
-		OutputCodeSchema outputCodeSchema = a1ControllerApi.a1ControllerDeletePolicyInstance(inputSchema);
-		checkHttpError(outputCodeSchema.getOutput().getCode());
-	}
-
-	private void checkHttpError(String httpCode) {
-	    logger.debug("Http Response Code: {}", httpCode);
-	    if (httpCode.equals(String.valueOf(HttpStatus.NOT_FOUND.value()))) {
-	        logger.error("Caught HttpNotFoundException");
-	        throw new HttpNotFoundException("Not Found Exception");
-	    } else if (httpCode.equals(String.valueOf(HttpStatus.BAD_REQUEST.value()))) {
-	        logger.error("Caught HttpBadRequestException");
-	        throw new HttpBadRequestException("Bad Request Exception");
-	    } else if (httpCode.equals(String.valueOf(HttpStatus.INTERNAL_SERVER_ERROR.value()))) {
-	        logger.error("Caught HttpInternalServerErrorException");
-	        throw new HttpInternalServerErrorException("Internal Server Error Exception");
-	    } else if (httpCode.equals(String.valueOf(HttpStatus.NOT_IMPLEMENTED.value()))) {
-	        logger.error("Caught HttpNotImplementedException");
-	        throw new HttpNotImplementedException("Not Implemented Exception");
-	    }
-	}
-}
diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/PolicyController.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/PolicyController.java
new file mode 100644
index 0000000..8af4e97
--- /dev/null
+++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/PolicyController.java
@@ -0,0 +1,161 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * 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.
+ * ========================LICENSE_END===================================
+ */
+package org.oransc.ric.portal.dashboard.controller;
+
+import java.lang.invoke.MethodHandles;
+
+import javax.servlet.http.HttpServletResponse;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import org.oransc.ric.portal.dashboard.DashboardApplication;
+import org.oransc.ric.portal.dashboard.DashboardConstants;
+import org.oransc.ric.portal.dashboard.exceptions.HttpBadRequestException;
+import org.oransc.ric.portal.dashboard.exceptions.HttpInternalServerErrorException;
+import org.oransc.ric.portal.dashboard.exceptions.HttpNotFoundException;
+import org.oransc.ric.portal.dashboard.exceptions.HttpNotImplementedException;
+import org.oransc.ric.portal.dashboard.model.PolicyInstances;
+import org.oransc.ric.portal.dashboard.model.PolicyTypes;
+import org.oransc.ric.portal.dashboard.model.SuccessTransport;
+import org.oransc.ric.portal.dashboard.policyagentapi.PolicyAgentApi;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.security.access.annotation.Secured;
+import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * Proxies calls from the front end to the Policy agent API.
+ *
+ * If a method throws RestClientResponseException, it is handled by
+ * {@link CustomResponseEntityExceptionHandler#handleProxyMethodException(Exception, org.springframework.web.context.request.WebRequest)}
+ * which returns status 502. All other exceptions are handled by Spring which
+ * returns status 500.
+ */
+@RestController
+@RequestMapping(value = PolicyController.CONTROLLER_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
+public class PolicyController {
+
+	private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+	private static Gson gson = new GsonBuilder() //
+			.serializeNulls() //
+			.create(); //
+
+	// Publish paths in constants so tests are easy to write
+	public static final String CONTROLLER_PATH = DashboardConstants.ENDPOINT_PREFIX + "/policy";
+	// Endpoints
+	public static final String VERSION_METHOD = DashboardConstants.VERSION_METHOD;
+	public static final String POLICY_TYPES_METHOD = "policytypes";
+	public static final String POLICY_TYPE_ID_NAME = "policy_type_id";
+	public static final String POLICIES_NAME = "policies";
+	public static final String POLICY_INSTANCE_ID_NAME = "policy_instance_id";
+
+	// Populated by the autowired constructor
+	private final PolicyAgentApi policyAgentApi;
+
+	@Autowired
+	public PolicyController(final PolicyAgentApi policyAgentApi) {
+		Assert.notNull(policyAgentApi, "API must not be null");
+		this.policyAgentApi = policyAgentApi;
+		logger.debug("ctor: configured with client type {}", policyAgentApi.getClass().getName());
+	}
+
+	/*
+	 * The fields are defined in the Policy Control Typescript interface.
+	 */
+	@ApiOperation(value = "Gets the policy types from Near Realtime-RIC")
+	@GetMapping(POLICY_TYPES_METHOD)
+	@Secured({ DashboardConstants.ROLE_ADMIN, DashboardConstants.ROLE_STANDARD })
+	public PolicyTypes getAllPolicyTypes(HttpServletResponse response) {
+		logger.debug("getAllPolicyTypes");
+		return this.policyAgentApi.getAllPolicyTypes();
+	}
+
+	@ApiOperation(value = "Returns the policy instances for the given policy type.")
+	@GetMapping(POLICY_TYPES_METHOD + "/{" + POLICY_TYPE_ID_NAME + "}/" + POLICIES_NAME)
+	@Secured({ DashboardConstants.ROLE_ADMIN, DashboardConstants.ROLE_STANDARD })
+	public String getPolicyInstances(@PathVariable(POLICY_TYPE_ID_NAME) String policyTypeIdString) {
+		logger.debug("getPolicyInstances {}", policyTypeIdString);
+
+		PolicyInstances i = this.policyAgentApi.getPolicyInstancesForType(policyTypeIdString);
+		String json = gson.toJson(i);
+		return json;
+	}
+
+	@ApiOperation(value = "Returns a policy instance of a type")
+	@GetMapping(POLICY_TYPES_METHOD + "/{" + POLICY_TYPE_ID_NAME + "}/" + POLICIES_NAME + "/{" + POLICY_INSTANCE_ID_NAME
+			+ "}")
+	@Secured({ DashboardConstants.ROLE_ADMIN, DashboardConstants.ROLE_STANDARD })
+	public String getPolicyInstance(@PathVariable(POLICY_TYPE_ID_NAME) String policyTypeIdString,
+			@PathVariable(POLICY_INSTANCE_ID_NAME) String policyInstanceId) {
+		logger.debug("getPolicyInstance {}:{}", policyTypeIdString, policyInstanceId);
+		return this.policyAgentApi.getPolicyInstance(policyInstanceId);
+	}
+
+	@ApiOperation(value = "Creates the policy instances for the given policy type.")
+	@PutMapping(POLICY_TYPES_METHOD + "/{" + POLICY_TYPE_ID_NAME + "}/" + POLICIES_NAME + "/{" + POLICY_INSTANCE_ID_NAME
+			+ "}")
+	@Secured({ DashboardConstants.ROLE_ADMIN })
+	public void putPolicyInstance(@PathVariable(POLICY_TYPE_ID_NAME) String policyTypeIdString,
+			@PathVariable(POLICY_INSTANCE_ID_NAME) String policyInstanceId, @RequestBody String instance) {
+		logger.debug("putPolicyInstance typeId: {}, instanceId: {}, instance: {}", policyTypeIdString, policyInstanceId,
+				instance);
+		this.policyAgentApi.putPolicy(policyTypeIdString, policyInstanceId, instance);
+	}
+
+	@ApiOperation(value = "Deletes the policy instances for the given policy type.")
+	@DeleteMapping(POLICY_TYPES_METHOD + "/{" + POLICY_TYPE_ID_NAME + "}/" + POLICIES_NAME + "/{"
+			+ POLICY_INSTANCE_ID_NAME + "}")
+	@Secured({ DashboardConstants.ROLE_ADMIN })
+	public void deletePolicyInstance(@PathVariable(POLICY_TYPE_ID_NAME) String policyTypeIdString,
+			@PathVariable(POLICY_INSTANCE_ID_NAME) String policyInstanceId) {
+		logger.debug("deletePolicyInstance typeId: {}, instanceId: {}", policyTypeIdString, policyInstanceId);
+		this.policyAgentApi.deletePolicy(policyInstanceId);
+	}
+
+	private void checkHttpError(String httpCode) {
+		logger.debug("Http Response Code: {}", httpCode);
+		if (httpCode.equals(String.valueOf(HttpStatus.NOT_FOUND.value()))) {
+			logger.error("Caught HttpNotFoundException");
+			throw new HttpNotFoundException("Not Found Exception");
+		} else if (httpCode.equals(String.valueOf(HttpStatus.BAD_REQUEST.value()))) {
+			logger.error("Caught HttpBadRequestException");
+			throw new HttpBadRequestException("Bad Request Exception");
+		} else if (httpCode.equals(String.valueOf(HttpStatus.INTERNAL_SERVER_ERROR.value()))) {
+			logger.error("Caught HttpInternalServerErrorException");
+			throw new HttpInternalServerErrorException("Internal Server Error Exception");
+		} else if (httpCode.equals(String.valueOf(HttpStatus.NOT_IMPLEMENTED.value()))) {
+			logger.error("Caught HttpNotImplementedException");
+			throw new HttpNotImplementedException("Not Implemented Exception");
+		}
+	}
+}
diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PolicyInfo.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PolicyInfo.java
new file mode 100644
index 0000000..ca1b79d
--- /dev/null
+++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PolicyInfo.java
@@ -0,0 +1,41 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * 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.
+ * ========================LICENSE_END===================================
+ */
+package org.oransc.ric.portal.dashboard.model;
+
+import org.immutables.gson.Gson;
+import org.immutables.value.Value;
+
+@Value.Immutable
+@Gson.TypeAdapters
+public interface PolicyInfo {
+
+	public String id();
+
+	public String type();
+
+	public String ric();
+
+	public String json();
+
+	public String service();
+
+	public String lastModified();
+
+}
diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PolicyInstance.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PolicyInstance.java
deleted file mode 100644
index b699b3c..0000000
--- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PolicyInstance.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * 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.
- * ========================LICENSE_END===================================
- */
-package org.oransc.ric.portal.dashboard.model;
-
-public class PolicyInstance implements IDashboardResponse {
-	private String instanceId;
-	private Object instance;
-
-	public PolicyInstance(String id, Object instance) {
-		this.instanceId = id;
-		this.instance = instance;
-	}
-
-	public String getInstanceId() {
-		return instanceId;
-	}
-	public void setInstanceId(String instanceId) {
-		this.instanceId = instanceId;
-	}
-	public Object getInstance() {
-		return instance;
-	}
-	public void setInstance(Object instance) {
-		this.instance = instance;
-	}
-
-	@Override
-	public String toString() {
-		return PolicyInstance.class.getName() + ": [id:" + instanceId + ", instance: " + instance + "]";
-	}
-}
diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PolicyInstances.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PolicyInstances.java
index c750487..eb6b455 100644
--- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PolicyInstances.java
+++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PolicyInstances.java
@@ -21,7 +21,7 @@
 
 import java.util.ArrayList;
 
-public class PolicyInstances extends ArrayList<PolicyInstance> {
+public class PolicyInstances extends ArrayList<PolicyInfo> {
 
 	private static final long serialVersionUID = -928428052502491021L;
 
diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PolicyType.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PolicyType.java
index efe4010..ea51cc5 100644
--- a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PolicyType.java
+++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PolicyType.java
@@ -23,29 +23,17 @@
 
 public class PolicyType {
 
-	@JsonProperty("policy_type_id")
-	Integer policyTypeId;
-
 	@JsonProperty("name")
 	String name;
 
 	@JsonProperty("schema")
 	String schema;
 
-	public PolicyType(Integer policyId, String name, String schema) {
-		this.policyTypeId = policyId;
+	public PolicyType(String name, String schema) {
 		this.name = name;
 		this.schema = schema;
 	}
 
-	public Integer getPolicyTypeId() {
-		return policyTypeId;
-	}
-
-	public void setPolicyTypeId(Integer policyTypeId) {
-		this.policyTypeId = policyTypeId;
-	}
-
 	public String getName() {
 		return name;
 	}
@@ -64,6 +52,6 @@
 
 	@Override
 	public String toString() {
-		return "[policy_type_id:" + policyTypeId + ", name:" + name + ", schema:" + schema + "]";
+		return "[name:" + name + ", schema:" + schema + "]";
 	}
 }
diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/policyagentapi/PolicyAgentApi.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/policyagentapi/PolicyAgentApi.java
new file mode 100644
index 0000000..41f3c12
--- /dev/null
+++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/policyagentapi/PolicyAgentApi.java
@@ -0,0 +1,37 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+package org.oransc.ric.portal.dashboard.policyagentapi;
+
+import org.oransc.ric.portal.dashboard.model.PolicyInstances;
+import org.oransc.ric.portal.dashboard.model.PolicyTypes;
+import org.springframework.web.client.RestClientException;
+
+public interface PolicyAgentApi {
+
+    public PolicyTypes getAllPolicyTypes() throws RestClientException;
+
+    public PolicyInstances getPolicyInstancesForType(String type);
+
+    public String getPolicyInstance(String id) throws RestClientException;
+
+    public void putPolicy(String policyTypeIdString, String policyInstanceId, String json) throws RestClientException;
+
+    public void deletePolicy(String policyInstanceId) throws RestClientException;
+}
diff --git a/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/policyagentapi/PolicyAgentApiImpl.java b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/policyagentapi/PolicyAgentApiImpl.java
new file mode 100644
index 0000000..8236de1
--- /dev/null
+++ b/dashboard/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/policyagentapi/PolicyAgentApiImpl.java
@@ -0,0 +1,145 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+package org.oransc.ric.portal.dashboard.policyagentapi;
+
+import org.oransc.ric.portal.dashboard.DashboardConstants;
+import org.oransc.ric.portal.dashboard.model.ImmutablePolicyInfo;
+import org.oransc.ric.portal.dashboard.model.PolicyInfo;
+import org.oransc.ric.portal.dashboard.model.PolicyInstances;
+import org.oransc.ric.portal.dashboard.model.PolicyType;
+import org.oransc.ric.portal.dashboard.model.PolicyTypes;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestClientException;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.List;
+import java.util.Map;
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Type;
+
+import com.google.gson.GsonBuilder;
+import com.google.gson.annotations.SerializedName;
+import com.google.gson.reflect.TypeToken;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.immutables.gson.Gson;
+import org.immutables.value.Value;
+
+@Component("PolicyAgentApi")
+public class PolicyAgentApiImpl implements PolicyAgentApi {
+    private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+    RestTemplate restTemplate = new RestTemplate();
+
+    private static com.google.gson.Gson gson = new GsonBuilder() //
+            .serializeNulls() //
+            .create(); //
+
+    private final String urlPrefix;
+
+    @Autowired
+    public PolicyAgentApiImpl(
+            @org.springframework.beans.factory.annotation.Value("${policycontroller.url.prefix}") final String urlPrefix) {
+        logger.debug("ctor prefix '{}'", urlPrefix);
+        this.urlPrefix = urlPrefix;
+    }
+
+    private String baseUrl() {
+        return urlPrefix;
+    }
+
+    @Value.Immutable
+    @Gson.TypeAdapters
+    interface PolicyTypeInfo {
+
+        public String name();
+
+        public String schema();
+    }
+
+    private PolicyType toPolicyType(PolicyTypeInfo i) {
+        return new PolicyType(i.name(), i.schema());
+    }
+
+    @Override
+    public PolicyTypes getAllPolicyTypes() throws RestClientException {
+        String url = baseUrl() + "/policy_types";
+        String rsp = this.restTemplate.getForObject(url, String.class);
+
+        Type listType = new TypeToken<List<ImmutablePolicyTypeInfo>>() {
+        }.getType();
+        List<PolicyTypeInfo> rspParsed = gson.fromJson(rsp, listType);
+
+        PolicyTypes result = new PolicyTypes();
+        for (PolicyTypeInfo i : rspParsed) {
+            result.add(toPolicyType(i));
+        }
+        return result;
+    }
+
+    @Override
+    public PolicyInstances getPolicyInstancesForType(String type) {
+        String url = baseUrl() + "/policies?type={type}";
+        Map<String, ?> uriVariables = Map.of("type", type);
+        String rsp = this.restTemplate.getForObject(url, String.class, uriVariables);
+
+        Type listType = new TypeToken<List<ImmutablePolicyInfo>>() {
+        }.getType();
+        List<PolicyInfo> rspParsed = gson.fromJson(rsp, listType);
+
+        PolicyInstances result = new PolicyInstances();
+        for (PolicyInfo p : rspParsed) {
+            result.add(p);
+        }
+        return result;
+
+    }
+
+    @Override
+    public String getPolicyInstance(String id) throws RestClientException {
+        String url = baseUrl() + "/policy?instance={id}";
+        Map<String, ?> uriVariables = Map.of("id", id);
+
+        return this.restTemplate.getForObject(url, String.class, uriVariables);
+    }
+
+    @Override
+    public void putPolicy(String policyTypeIdString, String policyInstanceId, String json) throws RestClientException {
+        String url = baseUrl() + "/policy?type={type}&instance={instance}&ric={ric}&service={service}";
+        Map<String, ?> uriVariables = Map.of( //
+                "type", policyTypeIdString, //
+                "instance", policyInstanceId, //
+                "ric", "ric1", // TODO
+                "service", "dashboard");
+
+        this.restTemplate.put(url, json, uriVariables);
+    }
+
+    @Override
+    public void deletePolicy(String policyInstanceId) throws RestClientException {
+        String url = baseUrl() + "/policy?instance={instance}";
+        Map<String, ?> uriVariables = Map.of("instance", policyInstanceId);
+        this.restTemplate.delete(url, uriVariables);
+    }
+
+}
diff --git a/dashboard/webapp-backend/src/main/resources/application.properties b/dashboard/webapp-backend/src/main/resources/application.properties
index 3aa2406..b7753a7 100644
--- a/dashboard/webapp-backend/src/main/resources/application.properties
+++ b/dashboard/webapp-backend/src/main/resources/application.properties
@@ -44,9 +44,8 @@
 # endpoint URLs must be supplied at deployment time
 # NOTE: change a1controller.url.prefix to http://localhost:8282 when running
 #       dashboard locally (i.e., not inside the docker container)
-# A1 Controller
-a1controller.url.prefix = http://a1-controller-container:8181
-a1controller.url.suffix = /restconf/operations
+policycontroller.url.prefix = http://localhost:8081
+
 
 # Kubernetes API via https://github.com/nokia/caas-ingress
 # Set insecure=true to disable SSL certificate and hostname checking
diff --git a/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/DashboardTestServer.java b/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/DashboardTestServer.java
index df1a51c..a6c0a1e 100644
--- a/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/DashboardTestServer.java
+++ b/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/DashboardTestServer.java
@@ -19,6 +19,8 @@
  */
 package org.oransc.ric.portal.dashboard;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 import java.lang.invoke.MethodHandles;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
@@ -45,7 +47,6 @@
  */
 @ExtendWith(SpringExtension.class)
 @SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT)
-@ActiveProfiles("test")
 public class DashboardTestServer {
 
 	private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@@ -65,5 +66,6 @@
 		} catch (Exception ex) {
 			logger.warn(ex.toString());
 		}
+		assertEquals(1, 2);
 	}
 }
diff --git a/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/A1ControllerMockConfiguration.java b/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/A1ControllerMockConfiguration.java
deleted file mode 100644
index 5706a91..0000000
--- a/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/A1ControllerMockConfiguration.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * 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.
- * ========================LICENSE_END===================================
- */
-package org.oransc.ric.portal.dashboard.config;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import com.fasterxml.jackson.core.JsonProcessingException;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.lang.invoke.MethodHandles;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import org.oransc.ric.a1controller.client.api.A1ControllerApi;
-import org.oransc.ric.a1controller.client.invoker.ApiClient;
-import org.oransc.ric.a1controller.client.model.InputNRRidPTidPIidPISchema;
-import org.oransc.ric.a1controller.client.model.InputNRRidPTidPIidSchema;
-import org.oransc.ric.a1controller.client.model.InputNRRidPTidSchema;
-import org.oransc.ric.a1controller.client.model.InputNRRidSchema;
-import org.oransc.ric.a1controller.client.model.OutputCodeSchema;
-import org.oransc.ric.a1controller.client.model.OutputCodeSchemaOutput;
-import org.oransc.ric.a1controller.client.model.OutputDescNamePTCodeSchema;
-import org.oransc.ric.a1controller.client.model.OutputDescNamePTCodeSchemaOutput;
-import org.oransc.ric.a1controller.client.model.OutputPICodeSchema;
-import org.oransc.ric.a1controller.client.model.OutputPICodeSchemaOutput;
-import org.oransc.ric.a1controller.client.model.OutputPIidsListCodeSchema;
-import org.oransc.ric.a1controller.client.model.OutputPIidsListCodeSchemaOutput;
-import org.oransc.ric.a1controller.client.model.OutputPTidsListCodeSchema;
-import org.oransc.ric.a1controller.client.model.OutputPTidsListCodeSchemaOutput;
-import org.oransc.ric.portal.dashboard.model.PolicyType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-import org.springframework.http.HttpStatus;
-
-/**
- * Creates a mock implementation of the A1 controller client API.
- */
-@Profile("test")
-@Configuration
-public class A1ControllerMockConfiguration {
-
-	private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-
-	// A "control" is an element in the XApp descriptor
-	public static final String AC_CONTROL_NAME = "admission_control_policy";
-
-	// Simulate remote method delay for UI testing
-	@Value("${mock.config.delay:0}")
-	private int delayMs;
-
-	public A1ControllerMockConfiguration() {
-		logger.info("Configuring mock A1 Mediator");
-	}
-
-	private ApiClient apiClient() {
-		ApiClient mockClient = mock(ApiClient.class);
-		when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK);
-		return mockClient;
-	}
-
-	@Bean
-	// Use the same name as regular configuration
-	public A1ControllerApi a1ControllerApi() {
-		ApiClient apiClient = apiClient();
-		A1ControllerApi mockApi = mock(A1ControllerApi.class);
-
-		when(mockApi.getApiClient()).thenReturn(apiClient);
-
-		doAnswer(inv -> {
-			if (delayMs > 0) {
-				logger.debug("a1ControllerGetHandler sleeping {}", delayMs);
-				Thread.sleep(delayMs);
-			}
-			List<Integer> types = database.getTypes();
-			OutputPTidsListCodeSchemaOutput output = new OutputPTidsListCodeSchemaOutput();
-			output.setPolicyTypeIdList(types);
-			output.setCode(String.valueOf(HttpStatus.OK.value()));
-			OutputPTidsListCodeSchema outputSchema = new OutputPTidsListCodeSchema();
-			outputSchema.setOutput(output);
-			return outputSchema;
-		}).when(mockApi).a1ControllerGetAllPolicyTypes(any(InputNRRidSchema.class));
-
-		doAnswer(inv -> {
-			if (delayMs > 0) {
-				logger.debug("a1ControllerGetPolicyType sleeping {}", delayMs);
-				Thread.sleep(delayMs);
-			}
-			InputNRRidPTidSchema input = inv.<InputNRRidPTidSchema>getArgument(0);
-			PolicyType policyType = database.getPolicyType(input.getInput().getPolicyTypeId());
-			OutputDescNamePTCodeSchemaOutput type = new OutputDescNamePTCodeSchemaOutput();
-			type.setName(policyType.getName());
-			type.setPolicyType(database.normalize(policyType.getSchema()));
-			type.setCode(String.valueOf(HttpStatus.OK.value()));
-			OutputDescNamePTCodeSchema outputSchema = new OutputDescNamePTCodeSchema();
-			outputSchema.setOutput(type);
-			return outputSchema;
-		}).when(mockApi).a1ControllerGetPolicyType(any(InputNRRidPTidSchema.class));
-
-		doAnswer(inv -> {
-			if (delayMs > 0) {
-				logger.debug("a1ControllerGetHandler sleeping {}", delayMs);
-				Thread.sleep(delayMs);
-			}
-			InputNRRidPTidSchema input = inv.<InputNRRidPTidSchema>getArgument(0);
-			List<String> instances = database.getInstances(Optional.of(input.getInput().getPolicyTypeId()));
-			OutputPIidsListCodeSchemaOutput instancesOutput = new OutputPIidsListCodeSchemaOutput();
-			instancesOutput.setPolicyInstanceIdList(instances);
-			instancesOutput.setCode(String.valueOf(HttpStatus.OK.value()));
-			OutputPIidsListCodeSchema outputSchema = new OutputPIidsListCodeSchema();
-			outputSchema.setOutput(instancesOutput);
-			return outputSchema;
-		}).when(mockApi).a1ControllerGetAllInstancesForType(any(InputNRRidPTidSchema.class));
-
-		doAnswer(inv -> {
-			if (delayMs > 0) {
-				logger.debug("a1ControllerGetHandler sleeping {}", delayMs);
-				Thread.sleep(delayMs);
-			}
-			InputNRRidPTidPIidSchema input = inv.<InputNRRidPTidPIidSchema>getArgument(0);
-			Integer polcyTypeId = input.getInput().getPolicyTypeId();
-			String instanceId = input.getInput().getPolicyInstanceId();
-			String instance = database.normalize(database.getInstance(polcyTypeId, instanceId));
-			OutputPICodeSchemaOutput instanceOutput = new OutputPICodeSchemaOutput();
-			instanceOutput.setPolicyInstance(instance);
-			instanceOutput.setCode(String.valueOf(HttpStatus.OK.value()));
-			OutputPICodeSchema outputSchema = new OutputPICodeSchema();
-			outputSchema.setOutput(instanceOutput);
-			return outputSchema;
-		}).when(mockApi).a1ControllerGetPolicyInstance(any(InputNRRidPTidPIidSchema.class));
-
-		doAnswer(inv -> {
-			if (delayMs > 0) {
-				logger.debug("a1ControllerGetHandler sleeping {}", delayMs);
-				Thread.sleep(delayMs);
-			}
-			InputNRRidPTidPIidPISchema input = inv.<InputNRRidPTidPIidPISchema>getArgument(0);
-			Integer polcyTypeId = input.getInput().getPolicyTypeId();
-			String instanceId = input.getInput().getPolicyInstanceId();
-			String instance = input.getInput().getPolicyInstance();
-			database.putInstance(polcyTypeId, instanceId, instance);
-			OutputCodeSchemaOutput outputCodeSchemaOutput = new OutputCodeSchemaOutput();
-			outputCodeSchemaOutput.setCode(String.valueOf(HttpStatus.CREATED.value()));
-			OutputCodeSchema outputCodeSchema = new OutputCodeSchema();
-			outputCodeSchema.setOutput(outputCodeSchemaOutput);
-			return outputCodeSchema;
-		}).when(mockApi).a1ControllerCreatePolicyInstance(any(InputNRRidPTidPIidPISchema.class));
-
-		doAnswer(inv -> {
-			if (delayMs > 0) {
-				logger.debug("a1ControllerGetHandler sleeping {}", delayMs);
-				Thread.sleep(delayMs);
-			}
-			InputNRRidPTidPIidSchema input = inv.<InputNRRidPTidPIidSchema>getArgument(0);
-			Integer polcyTypeId = input.getInput().getPolicyTypeId();
-			String instanceId = input.getInput().getPolicyInstanceId();
-			database.deleteInstance(polcyTypeId, instanceId);
-			OutputCodeSchemaOutput outputCodeSchemaOutput = new OutputCodeSchemaOutput();
-			outputCodeSchemaOutput.setCode(String.valueOf(HttpStatus.NO_CONTENT.value()));
-			OutputCodeSchema outputCodeSchema = new OutputCodeSchema();
-			outputCodeSchema.setOutput(outputCodeSchemaOutput);
-			return outputCodeSchema;
-		}).when(mockApi).a1ControllerDeletePolicyInstance(any(InputNRRidPTidPIidSchema.class));
-
-		return mockApi;
-	}
-
-	class Database {
-
-		public class PolicyException extends Exception {
-
-			private static final long serialVersionUID = 1L;
-
-			public PolicyException(String message) {
-				super(message);
-				System.out.println("**** Exception " + message);
-			}
-		}
-
-		private class PolicyTypeHolder {
-			PolicyTypeHolder(PolicyType pt) {
-				this.policyType = pt;
-			}
-
-			String getInstance(String instanceId) throws PolicyException {
-				String instance = instances.get(instanceId);
-				if (instance == null) {
-					throw new PolicyException("Instance not found: " + instanceId);
-				}
-				return instance;
-			}
-
-			PolicyType getPolicyType() {
-				return policyType;
-			}
-
-			void putInstance(String id, String data) {
-				instances.put(id, data);
-			}
-
-			void deleteInstance(String id) {
-				instances.remove(id);
-			}
-
-			List<String> getInstances() {
-				return new ArrayList<>(instances.keySet());
-			}
-
-			private final PolicyType policyType;
-			private Map<String, String> instances = new HashMap<>();
-		}
-
-		Database() {
-			String schema = getStringFromFile("anr-policy-schema.json");
-			PolicyType policy = new PolicyType(1, "ANR", schema);
-			types.put(1, new PolicyTypeHolder(policy));
-
-			schema = getStringFromFile("demo-policy-schema-1.json");
-			policy = new PolicyType(2, "type2", schema);
-			types.put(2, new PolicyTypeHolder(policy));
-
-			schema = getStringFromFile("demo-policy-schema-2.json");
-			policy = new PolicyType(3, "type3", schema);
-			types.put(3, new PolicyTypeHolder(policy));
-
-			schema = getStringFromFile("demo-policy-schema-3.json");
-			policy = new PolicyType(4, "type4", schema);
-			types.put(4, new PolicyTypeHolder(policy));
-			try {
-				putInstance(1, "ANR-1", getStringFromFile("anr-policy-instance.json"));
-			} catch (JsonProcessingException | PolicyException e) {
-				// Nothing
-			}
-		}
-
-		private String getStringFromFile(String path) {
-			try {
-				InputStream inputStream = MethodHandles.lookup().lookupClass().getClassLoader()
-						.getResourceAsStream(path);
-				return new BufferedReader(new InputStreamReader(inputStream)).lines().collect(Collectors.joining("\n"));
-			} catch (Exception e) {
-				logger.error("Cannot read file :" + path, e);
-				return "";
-			}
-		}
-
-		String normalize(String str) {
-			return str.replace('\n', ' ');
-		}
-
-		void putInstance(Integer typeId, String instanceId, String instanceData)
-				throws JsonProcessingException, PolicyException {
-			PolicyTypeHolder type = getTypeHolder(typeId);
-			type.putInstance(instanceId, instanceData);
-		}
-
-		void deleteInstance(Integer typeId, String instanceId) throws JsonProcessingException, PolicyException {
-			PolicyTypeHolder type = getTypeHolder(typeId);
-			type.deleteInstance(instanceId);
-		}
-
-		String getInstance(Integer typeId, String instanceId) throws JsonProcessingException, PolicyException {
-			return getTypeHolder(typeId).getInstance(instanceId);
-		}
-
-		List<Integer> getTypes() {
-			return new ArrayList<>(types.keySet());
-		}
-
-		List<String> getInstances(Optional<Integer> typeId) throws PolicyException {
-			if (typeId.isPresent()) {
-				return getTypeHolder(typeId.get()).getInstances();
-			} else {
-				Set<String> res = new HashSet<String>();
-				for (Iterator<PolicyTypeHolder> i = types.values().iterator(); i.hasNext();) {
-					res.addAll(i.next().getInstances());
-				}
-				return new ArrayList<>(res);
-			}
-		}
-
-		private PolicyTypeHolder getTypeHolder(Integer typeId) throws PolicyException {
-			PolicyTypeHolder typeHolder = types.get(typeId);
-			if (typeHolder == null) {
-				throw new PolicyException("Type not found: " + typeId);
-			}
-			return typeHolder;
-		}
-
-		private PolicyType getPolicyType(Integer typeId) throws PolicyException {
-			PolicyTypeHolder typeHolder = getTypeHolder(typeId);
-			return typeHolder.getPolicyType();
-		}
-
-		private Map<Integer, PolicyTypeHolder> types = new HashMap<>();
-
-	}
-
-	private final Database database = new Database();
-}
diff --git a/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/PolicyControllerMockConfiguration.java b/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/PolicyControllerMockConfiguration.java
new file mode 100644
index 0000000..4213488
--- /dev/null
+++ b/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/PolicyControllerMockConfiguration.java
@@ -0,0 +1,182 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * 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.
+ * ========================LICENSE_END===================================
+ */
+package org.oransc.ric.portal.dashboard.config;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.invoke.MethodHandles;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import org.oransc.ric.portal.dashboard.model.ImmutablePolicyInfo;
+import org.oransc.ric.portal.dashboard.model.PolicyInfo;
+import org.oransc.ric.portal.dashboard.model.PolicyInstances;
+import org.oransc.ric.portal.dashboard.model.PolicyType;
+import org.oransc.ric.portal.dashboard.model.PolicyTypes;
+import org.oransc.ric.portal.dashboard.policyagentapi.PolicyAgentApi;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.test.context.TestConfiguration;
+import org.springframework.context.annotation.Bean;
+import org.springframework.web.client.RestClientException;
+
+/**
+ * Creates a mock implementation of the policy controller client API.
+ */
+@TestConfiguration
+public class PolicyControllerMockConfiguration {
+
+	private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+	@Bean
+	public PolicyAgentApi policyAgentApi() {
+		MockPolicyAgentApi apiClient = new MockPolicyAgentApi();
+		return apiClient;
+	}
+
+	class MockPolicyAgentApi implements PolicyAgentApi {
+		private final Database database = new Database();
+
+		@Override
+		public String getPolicyInstance(String id) throws RestClientException {
+			return database.getInstance(id);
+		}
+
+		@Override
+		public void putPolicy(String policyTypeIdString, String policyInstanceId, String json)
+				throws RestClientException {
+			database.putInstance(policyTypeIdString, policyInstanceId, json);
+		}
+
+		@Override
+		public void deletePolicy(String policyInstanceId) throws RestClientException {
+			database.deleteInstance(policyInstanceId);
+		}
+
+		@Override
+		public PolicyTypes getAllPolicyTypes() throws RestClientException {
+			PolicyTypes result = new PolicyTypes();
+			result.addAll(database.getTypes());
+			return result;
+		}
+
+		@Override
+		public PolicyInstances getPolicyInstancesForType(String type) {
+			PolicyInstances result = new PolicyInstances();
+			List<PolicyInfo> inst = database.getInstances(Optional.of(type));
+			result.addAll(inst);
+			return result;
+		}
+
+	}
+
+	class Database {
+
+		Database() {
+			String schema = getStringFromFile("anr-policy-schema.json");
+			PolicyType policy = new PolicyType("ANR", schema);
+			types.put("ANR", policy);
+
+			schema = getStringFromFile("demo-policy-schema-1.json");
+			policy = new PolicyType("type2", schema);
+			types.put("type2", policy);
+
+			schema = getStringFromFile("demo-policy-schema-2.json");
+			policy = new PolicyType("type3", schema);
+			types.put("type3", policy);
+
+			schema = getStringFromFile("demo-policy-schema-3.json");
+			policy = new PolicyType("type4", schema);
+			types.put("type4", policy);
+			try {
+				putInstance("ANR", "ANR-1", getStringFromFile("anr-policy-instance.json"));
+			} catch (Exception e) {
+				// Nothing
+			}
+		}
+
+		private String getStringFromFile(String path) {
+			try {
+				InputStream inputStream = MethodHandles.lookup().lookupClass().getClassLoader()
+						.getResourceAsStream(path);
+				return new BufferedReader(new InputStreamReader(inputStream)).lines().collect(Collectors.joining("\n"));
+			} catch (Exception e) {
+				logger.error("Cannot read file :" + path, e);
+				return "";
+			}
+		}
+
+		String normalize(String str) {
+			return str.replace('\n', ' ');
+		}
+
+		private String getTimeStampUTC() {
+			return java.time.Instant.now().toString();
+		}
+
+		void putInstance(String typeId, String instanceId, String instanceData) {
+			PolicyInfo i = ImmutablePolicyInfo.builder().json(instanceData).lastModified(getTimeStampUTC())
+					.id(instanceId).ric("ricXX").service("service").type(typeId).build();
+			instances.put(instanceId, i);
+		}
+
+		public void deleteInstance(String instanceId) {
+			instances.remove(instanceId);
+		}
+
+		String getInstance(String id) throws RestClientException {
+			PolicyInfo i = instances.get(id);
+			if (i == null) {
+				throw new RestClientException("Type not found: " + id);
+			}
+			return i.json();
+		}
+
+		public Collection<PolicyType> getTypes() {
+			return types.values();
+		}
+
+		public List<PolicyInfo> getInstances(Optional<String> typeId) {
+			ArrayList<PolicyInfo> result = new ArrayList<>();
+			for (PolicyInfo i : instances.values()) {
+				if (typeId.isPresent()) {
+					if (i.type().equals(typeId.get())) {
+						result.add(i);
+					}
+
+				} else {
+					result.add(i);
+				}
+			}
+			return result;
+		}
+
+		private Map<String, PolicyType> types = new HashMap<>();
+		private Map<String, PolicyInfo> instances = new HashMap<>();
+
+	}
+
+}