portal api proxy added 45/43145/1
authorrv871f <richard.vondadelszen@amdocs.com>
Mon, 16 Apr 2018 19:36:16 +0000 (15:36 -0400)
committerrv871f <richard.vondadelszen@amdocs.com>
Mon, 16 Apr 2018 19:37:02 +0000 (15:37 -0400)
Issue-ID: AAI-1034
Change-Id: I2061e16684a3f1ba5c751d75db3c5d93247227fa
Signed-off-by: rv871f <richard.vondadelszen@amdocs.com>
sparkybe-onap-application/src/main/java/org/onap/aai/sparky/Application.java

index 2ffa433..2334297 100644 (file)
@@ -25,6 +25,7 @@ import javax.servlet.Filter;
 import org.apache.camel.component.servlet.CamelHttpTransportServlet;
 import org.onap.aai.sparky.config.PropertyPasswordConfiguration;
 import org.onap.aai.sparky.security.filter.LoginFilter;
+import org.openecomp.portalsdk.core.onboarding.crossapi.PortalRestAPIProxy;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -103,5 +104,17 @@ public class Application {
     return registration;
   }
 
+    /**
+   * Bind the Portal API Proxy
+   */
+  @Bean
+  @ConditionalOnProperty(value = "sparky.portal.enabled", havingValue = "true")
+  public ServletRegistrationBean portalApiProxy() {
+    
+    final ServletRegistrationBean servlet =
+        new ServletRegistrationBean(new PortalRestAPIProxy(), "/api/v2/*");
+    servlet.setName("PortalRestApiProxy");
+    return servlet;
+  }
 
 }