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
/
Policies.java
diff --git
a/policy-agent/src/main/java/org/oransc/policyagent/repository/Policies.java
b/policy-agent/src/main/java/org/oransc/policyagent/repository/Policies.java
index
c910dd5
..
4e2ebfa
100644
(file)
--- a/
policy-agent/src/main/java/org/oransc/policyagent/repository/Policies.java
+++ b/
policy-agent/src/main/java/org/oransc/policyagent/repository/Policies.java
@@
-25,6
+25,8
@@
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import java.util.Vector;
+
import org.oransc.policyagent.exceptions.ServiceException;
public class Policies {
import org.oransc.policyagent.exceptions.ServiceException;
public class Policies {
@@
-59,7
+61,7
@@
public class Policies {
if (map == null) {
return Collections.emptyList();
}
if (map == null) {
return Collections.emptyList();
}
- return
Collections.unmodifiableCollection
(map.values());
+ return
new Vector<>
(map.values());
}
public synchronized boolean containsPolicy(String id) {
}
public synchronized boolean containsPolicy(String id) {
@@
-79,7
+81,7
@@
public class Policies {
}
public synchronized Collection<Policy> getAll() {
}
public synchronized Collection<Policy> getAll() {
- return
Collections.unmodifiableCollection
(policiesId.values());
+ return
new Vector<>
(policiesId.values());
}
public synchronized Collection<Policy> getForService(String service) {
}
public synchronized Collection<Policy> getForService(String service) {
@@
-109,6
+111,13
@@
public class Policies {
multiMapRemove(policiesType, policy.type().name(), policy);
}
multiMapRemove(policiesType, policy.type().name(), policy);
}
+ public synchronized void removePoliciesForRic(String ricName) {
+ Collection<Policy> policiesForRic = getForRic(ricName);
+ for (Policy policy : policiesForRic) {
+ remove(policy);
+ }
+ }
+
public synchronized int size() {
return policiesId.size();
}
public synchronized int size() {
return policiesId.size();
}