Added callback to R-APPS invoked after RIC recovery
[nonrtric.git] / policy-agent / src / main / java / org / oransc / policyagent / controllers / ServiceController.java
index 86335b6..ad06231 100644 (file)
@@ -17,6 +17,7 @@
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
+
 package org.oransc.policyagent.controllers;
 
 import com.google.gson.Gson;
@@ -26,7 +27,6 @@ import java.time.Duration;
 import java.util.Collection;
 import java.util.Vector;
 
-import org.oransc.policyagent.configuration.ApplicationConfig;
 import org.oransc.policyagent.exceptions.ServiceException;
 import org.oransc.policyagent.repository.Service;
 import org.oransc.policyagent.repository.Services;
@@ -42,15 +42,13 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 public class ServiceController {
 
-    private final ApplicationConfig appConfig;
     private final Services services;
     private static Gson gson = new GsonBuilder() //
         .serializeNulls() //
         .create(); //
 
     @Autowired
-    ServiceController(ApplicationConfig config, Services services) {
-        this.appConfig = config;
+    ServiceController(Services services) {
         this.services = services;
     }
 
@@ -88,7 +86,7 @@ public class ServiceController {
     }
 
     private Service toService(ServiceRegistrationInfo s) {
-        return new Service(s.name(), Duration.ofSeconds(s.keepAliveInterval()));
+        return new Service(s.name(), Duration.ofSeconds(s.keepAliveInterval()), s.callbackUrl());
     }
 
     @GetMapping("/services")