Register SqlResource in SvcLogicMap 55/110755/2
authorDan Timoney <dtimoney@att.com>
Thu, 30 Jul 2020 17:55:59 +0000 (13:55 -0400)
committerKevin Smokowski <kevin.smokowski@att.com>
Fri, 31 Jul 2020 17:44:39 +0000 (17:44 +0000)
Register SqlResource in hashmap used to locate services in springboot

Change-Id: I48ee488848db1e2f593cc332f5b69c804f78edc7
Issue-ID: CCSDK-2626
Signed-off-by: Dan Timoney <dtimoney@att.com>
.gitignore
ms/neng/.classpath [deleted file]
ms/neng/.settings/org.eclipse.jdt.core.prefs [deleted file]
services/pom.xml
services/src/main/java/org/onap/ccsdk/apps/services/SvcLogicFactory.java

index 1e0ec77..7f22981 100644 (file)
@@ -1,5 +1,7 @@
 .classpath
 .settings/
+.vscode
+.factorypath
 
 # Target dirs in all projects
 **/target-ide/*
diff --git a/ms/neng/.classpath b/ms/neng/.classpath
deleted file mode 100644 (file)
index 5b4ecf9..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="src" output="target/classes" path="src/main/java">
-               <attributes>
-                       <attribute name="optional" value="true"/>
-                       <attribute name="maven.pomderived" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry excluding="**" kind="src" output="target/classes" path="opt/etc/config">
-               <attributes>
-                       <attribute name="maven.pomderived" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
-               <attributes>
-                       <attribute name="maven.pomderived" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="src" output="target/test-classes" path="src/test/java">
-               <attributes>
-                       <attribute name="optional" value="true"/>
-                       <attribute name="maven.pomderived" value="true"/>
-                       <attribute name="test" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
-               <attributes>
-                       <attribute name="maven.pomderived" value="true"/>
-                       <attribute name="test" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
-               <attributes>
-                       <attribute name="maven.pomderived" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
-               <attributes>
-                       <attribute name="maven.pomderived" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="src" path=".apt_generated">
-               <attributes>
-                       <attribute name="optional" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
-               <attributes>
-                       <attribute name="optional" value="true"/>
-                       <attribute name="test" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="output" path="target/classes"/>
-</classpath>
diff --git a/ms/neng/.settings/org.eclipse.jdt.core.prefs b/ms/neng/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644 (file)
index 21227d9..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.processAnnotations=enabled
-org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=1.8
index 004e55e..0520aef 100644 (file)
             <artifactId>sliPluginUtils-provider</artifactId>
             <version>${ccsdk.sli.core.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.onap.ccsdk.sli.adaptors</groupId>
+            <artifactId>sql-resource-provider</artifactId>
+            <version>${ccsdk.sli.adaptors.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.onap.ccsdk.sli.plugins</groupId>
             <artifactId>restapi-call-node-provider</artifactId>
index 8711e7e..c2fa101 100644 (file)
@@ -24,10 +24,13 @@ import java.io.FileInputStream;
 import java.io.IOException;\r
 import java.util.List;\r
 import java.util.Properties;\r
+\r
+import org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource;\r
 import org.onap.ccsdk.sli.core.sli.ConfigurationException;\r
 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;\r
 import org.onap.ccsdk.sli.core.sli.SvcLogicLoader;\r
 import org.onap.ccsdk.sli.core.sli.SvcLogicRecorder;\r
+import org.onap.ccsdk.sli.core.sli.SvcLogicResource;\r
 import org.onap.ccsdk.sli.core.sli.SvcLogicStore;\r
 import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory;\r
 import org.onap.ccsdk.sli.core.sli.provider.base.HashMapResolver;\r
@@ -57,6 +60,9 @@ public class SvcLogicFactory {
   @Autowired\r
   List<SvcLogicJavaPlugin> plugins;\r
 \r
+  @Autowired\r
+  List<SvcLogicResource> svcLogicResources;\r
+\r
   @Bean\r
   public SvcLogicStore getStore() throws Exception {\r
     SvcLogicPropertiesProvider propProvider = new SvcLogicPropertiesProvider() {\r
@@ -120,6 +126,10 @@ public class SvcLogicFactory {
       resolver.addSvcLogicSvcLogicJavaPlugin(plugin.getClass().getName(), plugin);\r
 \r
     }\r
+    for (SvcLogicResource svcLogicResource : svcLogicResources) {\r
+      resolver.addSvcLogicResource(svcLogicResource.getClass().getName(), svcLogicResource);\r
+    }\r
+\r
     return new SvcLogicServiceImplBase(getStore(), resolver);\r
   }\r
 \r
@@ -148,4 +158,10 @@ public class SvcLogicFactory {
       return new PropertiesNode();\r
   }\r
 \r
+  @Bean\r
+  public SqlResource sqlResource() {\r
+    return new SqlResource();\r
+  }\r
+  \r
+\r
 }\r