Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Make naming consistent regarding synchronization
[nonrtric.git]
/
policy-agent
/
src
/
main
/
java
/
org
/
oransc
/
policyagent
/
repository
/
Service.java
diff --git
a/policy-agent/src/main/java/org/oransc/policyagent/repository/Service.java
b/policy-agent/src/main/java/org/oransc/policyagent/repository/Service.java
index
18a85a9
..
f0863a5
100644
(file)
--- a/
policy-agent/src/main/java/org/oransc/policyagent/repository/Service.java
+++ b/
policy-agent/src/main/java/org/oransc/policyagent/repository/Service.java
@@
-23,7
+23,10
@@
package org.oransc.policyagent.repository;
import java.time.Duration;
import java.time.Instant;
import java.time.Duration;
import java.time.Instant;
+import lombok.Getter;
+
public class Service {
public class Service {
+ @Getter
private final String name;
private final Duration keepAliveInterval;
private Instant lastPing;
private final String name;
private final Duration keepAliveInterval;
private Instant lastPing;
@@
-36,20
+39,16
@@
public class Service {
ping();
}
ping();
}
- public synchronized String name() {
- return this.name;
- }
-
public synchronized Duration getKeepAliveInterval() {
return this.keepAliveInterval;
}
public synchronized Duration getKeepAliveInterval() {
return this.keepAliveInterval;
}
- p
rivate
synchronized void ping() {
+ p
ublic
synchronized void ping() {
this.lastPing = Instant.now();
}
public synchronized boolean isExpired() {
this.lastPing = Instant.now();
}
public synchronized boolean isExpired() {
- return timeSinceLastPing().compareTo(this.keepAliveInterval) > 0;
+ return t
his.keepAliveInterval.getSeconds() > 0 && t
imeSinceLastPing().compareTo(this.keepAliveInterval) > 0;
}
public synchronized Duration timeSinceLastPing() {
}
public synchronized Duration timeSinceLastPing() {