Adapt A1 controller to latest A1 spec
[nonrtric.git] / policy-agent / src / main / java / org / oransc / policyagent / repository / Service.java
index 81ef7ff..18a85a9 100644 (file)
@@ -27,15 +27,16 @@ public class Service {
     private final String name;
     private final Duration keepAliveInterval;
     private Instant lastPing;
-    // private final String callbackUrl1; // TBD
+    private final String callbackUrl;
 
-    public Service(String name, Duration keepAliveInterval) {
+    public Service(String name, Duration keepAliveInterval, String callbackUrl) {
         this.name = name;
         this.keepAliveInterval = keepAliveInterval;
+        this.callbackUrl = callbackUrl;
         ping();
     }
 
-    public synchronized String getName() {
+    public synchronized String name() {
         return this.name;
     }
 
@@ -43,7 +44,7 @@ public class Service {
         return this.keepAliveInterval;
     }
 
-    public synchronized void ping() {
+    private synchronized void ping() {
         this.lastPing = Instant.now();
     }
 
@@ -55,4 +56,8 @@ public class Service {
         return Duration.between(this.lastPing, Instant.now());
     }
 
+    public synchronized String getCallbackUrl() {
+        return this.callbackUrl;
+    }
+
 }