aboutsummaryrefslogtreecommitdiffstats
path: root/services/src
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2022-09-29 15:52:33 -0400
committerDan Timoney <dtimoney@att.com>2022-09-29 15:52:33 -0400
commitc2556dd48738b43e91e27a57df60c3ec347c5ac0 (patch)
tree8d7ef5cf7d36fc5a946b1c99900ee88b7f3378b2 /services/src
parent7ae63cbdf21b06e0234d51a3200f9ebbf393f8eb (diff)
Update third party versions in ccsdk/apps
Upgrade to latest springboot 2.6 release and updated gson version Change-Id: Ie12921daa905424bee3e5423371f951d3156e803 Issue-ID: CCSDK-3771 Signed-off-by: Dan Timoney <dtimoney@att.com>
Diffstat (limited to 'services/src')
-rw-r--r--services/src/main/java/org/onap/ccsdk/apps/services/SvcLogicFactory.java75
1 files changed, 63 insertions, 12 deletions
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 54d612f6..973f2414 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
@@ -76,6 +76,9 @@ public class SvcLogicFactory {
private static final String SDNC_CONFIG_DIR = "SDNC_CONFIG_DIR";
private static final String CONTRAIL_PROPERTIES = "contrail-adaptor.properties";
+ /*
+ * In Springboot 2.6, these autowired lists become a circular dependency with the RestconfApiController.
+ * For now, comment these out and instead just explicitly add wiring for the sli classes
@Autowired
List<SvcLogicRecorder> recorders;
@@ -85,6 +88,10 @@ public class SvcLogicFactory {
@Autowired
List<SvcLogicResource> svcLogicResources;
+ */
+
+
+
@Bean
public SvcLogicStore getStore() throws Exception {
@@ -139,24 +146,68 @@ public class SvcLogicFactory {
@Bean
public SvcLogicServiceBase createService() throws Exception {
HashMapResolver resolver = new HashMapResolver();
- for (SvcLogicRecorder recorder : recorders) {
- log.info("Registering SvcLogicRecorder {}", recorder.getClass().getName());
- resolver.addSvcLogicRecorder(recorder.getClass().getName(), recorder);
- }
+ /**
+ * See comment above re: autowired lists. Need to explicitly register
+ * SLI features to avoid circular dependency issue in springboot 2.6
+ *
+ * for (SvcLogicRecorder recorder : recorders) {
+ * log.info("Registering SvcLogicRecorder {}", recorder.getClass().getName());
+ * resolver.addSvcLogicRecorder(recorder.getClass().getName(), recorder);
+ *
+ * }
+ *
+ * for (SvcLogicJavaPlugin plugin : plugins) {
+ * log.info("Registering SvcLogicJavaPlugin {}", plugin.getClass().getName());
+ * resolver.addSvcLogicSvcLogicJavaPlugin(plugin.getClass().getName(), plugin);
+ *
+ * }
+ * for (SvcLogicResource svcLogicResource : svcLogicResources) {
+ * log.info("Registering SvcLogicResource {}",
+ * svcLogicResource.getClass().getName());
+ * resolver.addSvcLogicResource(svcLogicResource.getClass().getName(),
+ * svcLogicResource);
+ * }
+ */
- for (SvcLogicJavaPlugin plugin : plugins) {
- log.info("Registering SvcLogicJavaPlugin {}", plugin.getClass().getName());
- resolver.addSvcLogicSvcLogicJavaPlugin(plugin.getClass().getName(), plugin);
+ Slf4jRecorder slf4jRecorder = slf4jRecorderNode();
- }
- for (SvcLogicResource svcLogicResource : svcLogicResources) {
- log.info("Registering SvcLogicResource {}", svcLogicResource.getClass().getName());
- resolver.addSvcLogicResource(svcLogicResource.getClass().getName(), svcLogicResource);
- }
+ SliPluginUtils sliPluginUtils = sliPluginUtil();
+
+ SliStringUtils sliStringUtils = sliStringUtils();
+
+ AAIService aaiService = aaiService();
+
+ ConfigResource configResource = configResource();
+
+ OperationalResource operationalResource = operationalResource();
+
+ NetboxClient netboxClient = netboxClient();
+
+ SqlResource sqlResource = sqlResource();
+
+ RestapiCallNode restapiCallNode = restapiCallNode();
+
+ PropertiesNode propertiesNode = propertiesNode();
+ // Register recorder (there is only one)
+ resolver.addSvcLogicRecorder(Slf4jRecorder.class.getName(), new Slf4jRecorder());
+
+ // Register plugins
+ resolver.addSvcLogicSvcLogicJavaPlugin(sliPluginUtils.getClass().getName(), sliPluginUtils);
+ resolver.addSvcLogicSvcLogicJavaPlugin(sliStringUtils.getClass().getName(), sliStringUtils);
+ resolver.addSvcLogicSvcLogicJavaPlugin(restapiCallNode.getClass().getName(), restapiCallNode);
+ resolver.addSvcLogicSvcLogicJavaPlugin(propertiesNode.getClass().getName(), propertiesNode);
+ resolver.addSvcLogicSvcLogicJavaPlugin(netboxClient.getClass().getName(), netboxClient);
+
+ // Register resources
+ resolver.addSvcLogicResource(aaiService.getClass().getName(), aaiService);
+ resolver.addSvcLogicResource(configResource.getClass().getName(), configResource);
+ resolver.addSvcLogicResource(operationalResource.getClass().getName(), operationalResource);
+ resolver.addSvcLogicResource(sqlResource.getClass().getName(), sqlResource);
return new SvcLogicServiceImplBase(getStore(), resolver);
}
+
@Bean
public Slf4jRecorder slf4jRecorderNode() {