Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fixed concurrency problems
[nonrtric.git]
/
policy-agent
/
src
/
main
/
java
/
org
/
oransc
/
policyagent
/
repository
/
Ric.java
diff --git
a/policy-agent/src/main/java/org/oransc/policyagent/repository/Ric.java
b/policy-agent/src/main/java/org/oransc/policyagent/repository/Ric.java
index
505fce9
..
4291d6e
100644
(file)
--- a/
policy-agent/src/main/java/org/oransc/policyagent/repository/Ric.java
+++ b/
policy-agent/src/main/java/org/oransc/policyagent/repository/Ric.java
@@
-26,8
+26,10
@@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.util.List;
import java.util.Map;
import java.util.Vector;
+
import lombok.Getter;
import lombok.Setter;
import lombok.Getter;
import lombok.Setter;
+
import org.oransc.policyagent.clients.A1Client.A1ProtocolType;
import org.oransc.policyagent.configuration.RicConfig;
import org.oransc.policyagent.clients.A1Client.A1ProtocolType;
import org.oransc.policyagent.configuration.RicConfig;
@@
-35,6
+37,7
@@
import org.oransc.policyagent.configuration.RicConfig;
* Represents the dynamic information about a NearRealtime-RIC.
*/
public class Ric {
* Represents the dynamic information about a NearRealtime-RIC.
*/
public class Ric {
+
private final RicConfig ricConfig;
private final List<String> managedElementIds;
private final RicConfig ricConfig;
private final List<String> managedElementIds;
@@
-44,6
+47,8
@@
public class Ric {
@Setter
private A1ProtocolType protocolVersion = A1ProtocolType.UNKNOWN;
@Setter
private A1ProtocolType protocolVersion = A1ProtocolType.UNKNOWN;
+ @Getter
+ private final Lock lock = new Lock();
/**
* Creates the Ric. Initial state is {@link RicState.NOT_INITIATED}.
/**
* Creates the Ric. Initial state is {@link RicState.NOT_INITIATED}.
@@
-52,7
+57,8
@@
public class Ric {
*/
public Ric(RicConfig ricConfig) {
this.ricConfig = ricConfig;
*/
public Ric(RicConfig ricConfig) {
this.ricConfig = ricConfig;
- this.managedElementIds = new ArrayList<>(ricConfig.managedElementIds());
+ this.managedElementIds = new ArrayList<>(ricConfig.managedElementIds()); // TODO, this is config why is it
+ // copied here?
}
public String name() {
}
public String name() {
@@
-161,7
+167,7
@@
public class Ric {
*/
public enum RicState {
/**
*/
public enum RicState {
/**
- * The agent view of the
agent
may be inconsistent.
+ * The agent view of the
Ric
may be inconsistent.
*/
UNDEFINED,
/**
*/
UNDEFINED,
/**
@@
-169,8
+175,8
@@
public class Ric {
*/
IDLE,
/**
*/
IDLE,
/**
- * The
Ric states are recovered
.
+ * The
agent is synchronizing the view of the Ric
.
*/
*/
-
RECOVER
ING
+
SYNCHRONIZ
ING
}
}
}
}