diff options
author | Dan Timoney <dtimoney@att.com> | 2020-07-30 13:55:59 -0400 |
---|---|---|
committer | Kevin Smokowski <kevin.smokowski@att.com> | 2020-07-31 17:44:39 +0000 |
commit | 8804a42d24f2f29b135fc0675bfe8ff987bde8f6 (patch) | |
tree | 89fb876925b92a563fc641a72401db42725820fb | |
parent | 385874a6fd067cb17323a27ecd1af62b4176aecc (diff) |
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 <dtimoney@att.com>
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | ms/neng/.classpath | 54 | ||||
-rw-r--r-- | ms/neng/.settings/org.eclipse.jdt.core.prefs | 7 | ||||
-rw-r--r-- | services/pom.xml | 5 | ||||
-rw-r--r-- | services/src/main/java/org/onap/ccsdk/apps/services/SvcLogicFactory.java | 16 |
5 files changed, 23 insertions, 61 deletions
@@ -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 @@ -<?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 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 @@ -112,6 +112,11 @@ <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> <version>${ccsdk.sli.plugins.version}</version> 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<SvcLogicJavaPlugin> plugins;
+ @Autowired
+ List<SvcLogicResource> 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();
+ }
+
+
}
|