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 "Rename artifacts in A1 controller"
[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
c6d2561
..
7faa376
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
@@
-20,9
+20,11
@@
package org.oransc.policyagent.repository;
package org.oransc.policyagent.repository;
+import java.util.Collection;
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
+32,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() {
- return
rics.values(
);
+ public synchronized
Collection
<Ric> getRics() {
+ 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,23
+51,23
@@
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()) {
+ for (Ric ric : this.r
egisteredR
ics.values()) {
if (ric.getManagedElementIds().contains(managedElementId)) {
return Optional.of(ric);
}
if (ric.getManagedElementIds().contains(managedElementId)) {
return Optional.of(ric);
}