Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Added check in PUT policy"
[nonrtric.git]
/
policy-agent
/
src
/
main
/
java
/
org
/
oransc
/
policyagent
/
repository
/
Rics.java
diff --git
a/policy-agent/src/main/java/org/oransc/policyagent/repository/Rics.java
b/policy-agent/src/main/java/org/oransc/policyagent/repository/Rics.java
index
6f3b3e8
..
66cecd3
100644
(file)
--- a/
policy-agent/src/main/java/org/oransc/policyagent/repository/Rics.java
+++ b/
policy-agent/src/main/java/org/oransc/policyagent/repository/Rics.java
@@
-23,6
+23,7
@@
package org.oransc.policyagent.repository;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
+import java.util.Vector;
import org.oransc.policyagent.exceptions.ServiceException;
import org.oransc.policyagent.exceptions.ServiceException;
@@
-30,18
+31,18
@@
import org.oransc.policyagent.exceptions.ServiceException;
* Dynamic representation of all Rics in the system.
*/
public class Rics {
* Dynamic representation of all Rics in the system.
*/
public class Rics {
- Map<String, Ric> rics = new HashMap<>();
+ Map<String, Ric> r
egisteredR
ics = new HashMap<>();
public synchronized void put(Ric ric) {
public synchronized void put(Ric ric) {
- rics.put(ric.name(), ric);
+ r
egisteredR
ics.put(ric.name(), ric);
}
public synchronized Iterable<Ric> getRics() {
}
public synchronized Iterable<Ric> getRics() {
- return
rics.values(
);
+ return
new Vector<>(registeredRics.values()
);
}
public synchronized Ric getRic(String name) throws ServiceException {
}
public synchronized Ric getRic(String name) throws ServiceException {
- Ric ric = rics.get(name);
+ Ric ric = r
egisteredR
ics.get(name);
if (ric == null) {
throw new ServiceException("Could not find ric: " + name);
}
if (ric == null) {
throw new ServiceException("Could not find ric: " + name);
}
@@
-49,24
+50,24
@@
public class Rics {
}
public synchronized Ric get(String name) {
}
public synchronized Ric get(String name) {
- return rics.get(name);
+ return r
egisteredR
ics.get(name);
}
public synchronized void remove(String name) {
}
public synchronized void remove(String name) {
- rics.remove(name);
+ r
egisteredR
ics.remove(name);
}
public synchronized int size() {
}
public synchronized int size() {
- return rics.size();
+ return r
egisteredR
ics.size();
}
public synchronized void clear() {
}
public synchronized void clear() {
- this.rics.clear();
+ this.r
egisteredR
ics.clear();
}
public synchronized Optional<Ric> lookupRicForManagedElement(String managedElementId) {
}
public synchronized Optional<Ric> lookupRicForManagedElement(String managedElementId) {
- for (Ric ric : this.rics.values()) {
- if (ric.get
Config().m
anagedElementIds().contains(managedElementId)) {
+ for (Ric ric : this.r
egisteredR
ics.values()) {
+ if (ric.get
M
anagedElementIds().contains(managedElementId)) {
return Optional.of(ric);
}
}
return Optional.of(ric);
}
}