Remove Security issue and bug and fix copyrights
[nonrtric.git] / dashboard / webapp-backend / src / main / java / org / oransc / ric / portal / dashboard / portalapi / PortalRestCentralServiceImpl.java
index a2fae9f..b8f3e89 100644 (file)
@@ -3,6 +3,7 @@
  * O-RAN-SC
  * %%
  * Copyright (C) 2019 AT&T Intellectual Property
+ * Modifications Copyright (C) 2020 Nordix Foundation
  * %%
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,6 +33,7 @@ import org.oransc.ric.portal.dashboard.DashboardUserManager;
 import org.oransc.ric.portal.dashboard.config.SpringContextCache;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
 
 /**
@@ -47,11 +49,13 @@ public class PortalRestCentralServiceImpl implements IPortalRestCentralService {
 
     private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
+    @Autowired
+    private SpringContextCache springContextCache;
     private final PortalAuthManager authManager;
     private final DashboardUserManager userManager;
 
     public PortalRestCentralServiceImpl() throws IOException, PortalAPIException {
-        final ApplicationContext context = SpringContextCache.getApplicationContext();
+        final ApplicationContext context = springContextCache.getApplicationContext();
         authManager = context.getBean(PortalAuthManager.class);
         userManager = context.getBean(DashboardUserManager.class);
     }