From 8804a42d24f2f29b135fc0675bfe8ff987bde8f6 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Thu, 30 Jul 2020 13:55:59 -0400 Subject: Register SqlResource in SvcLogicMap Register SqlResource in hashmap used to locate services in springboot Change-Id: I48ee488848db1e2f593cc332f5b69c804f78edc7 Issue-ID: CCSDK-2626 Signed-off-by: Dan Timoney --- .gitignore | 2 + ms/neng/.classpath | 54 ---------------------- ms/neng/.settings/org.eclipse.jdt.core.prefs | 7 --- services/pom.xml | 5 ++ .../onap/ccsdk/apps/services/SvcLogicFactory.java | 16 +++++++ 5 files changed, 23 insertions(+), 61 deletions(-) delete mode 100644 ms/neng/.classpath delete mode 100644 ms/neng/.settings/org.eclipse.jdt.core.prefs diff --git a/.gitignore b/.gitignore index 1e0ec776..7f22981f 100644 --- a/.gitignore +++ b/.gitignore @@ -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 index 5b4ecf99..00000000 --- a/ms/neng/.classpath +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ms/neng/.settings/org.eclipse.jdt.core.prefs b/ms/neng/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 21227d99..00000000 --- a/ms/neng/.settings/org.eclipse.jdt.core.prefs +++ /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 diff --git a/services/pom.xml b/services/pom.xml index 004e55e0..0520aef0 100644 --- a/services/pom.xml +++ b/services/pom.xml @@ -111,6 +111,11 @@ sliPluginUtils-provider ${ccsdk.sli.core.version} + + org.onap.ccsdk.sli.adaptors + sql-resource-provider + ${ccsdk.sli.adaptors.version} + org.onap.ccsdk.sli.plugins restapi-call-node-provider diff --git a/services/src/main/java/org/onap/ccsdk/apps/services/SvcLogicFactory.java b/services/src/main/java/org/onap/ccsdk/apps/services/SvcLogicFactory.java index 8711e7ed..c2fa1010 100644 --- a/services/src/main/java/org/onap/ccsdk/apps/services/SvcLogicFactory.java +++ b/services/src/main/java/org/onap/ccsdk/apps/services/SvcLogicFactory.java @@ -24,10 +24,13 @@ import java.io.FileInputStream; import java.io.IOException; import java.util.List; import java.util.Properties; + +import org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource; import org.onap.ccsdk.sli.core.sli.ConfigurationException; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; import org.onap.ccsdk.sli.core.sli.SvcLogicLoader; import org.onap.ccsdk.sli.core.sli.SvcLogicRecorder; +import org.onap.ccsdk.sli.core.sli.SvcLogicResource; import org.onap.ccsdk.sli.core.sli.SvcLogicStore; import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory; import org.onap.ccsdk.sli.core.sli.provider.base.HashMapResolver; @@ -57,6 +60,9 @@ public class SvcLogicFactory { @Autowired List plugins; + @Autowired + List svcLogicResources; + @Bean public SvcLogicStore getStore() throws Exception { SvcLogicPropertiesProvider propProvider = new SvcLogicPropertiesProvider() { @@ -120,6 +126,10 @@ public class SvcLogicFactory { resolver.addSvcLogicSvcLogicJavaPlugin(plugin.getClass().getName(), plugin); } + for (SvcLogicResource svcLogicResource : svcLogicResources) { + resolver.addSvcLogicResource(svcLogicResource.getClass().getName(), svcLogicResource); + } + return new SvcLogicServiceImplBase(getStore(), resolver); } @@ -148,4 +158,10 @@ public class SvcLogicFactory { return new PropertiesNode(); } + @Bean + public SqlResource sqlResource() { + return new SqlResource(); + } + + } -- cgit 1.2.3-korg