X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fpolicyagent%2Frepository%2FPolicyTypes.java;h=7723983191a08800fba98f380f1f0ae773d9d4dd;hb=9f9cde2f0d76ad943f5dfcf50548be5800834a2f;hp=d3c2c4fc739120a033ad7d499f7ad0fef097cd98;hpb=3b5213d7ef998e3f76d58a767230013be0a7927f;p=nonrtric.git diff --git a/policy-agent/src/main/java/org/oransc/policyagent/repository/PolicyTypes.java b/policy-agent/src/main/java/org/oransc/policyagent/repository/PolicyTypes.java index d3c2c4fc..77239831 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/repository/PolicyTypes.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/repository/PolicyTypes.java @@ -20,8 +20,11 @@ package org.oransc.policyagent.repository; +import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.Map; + import org.oransc.policyagent.exceptions.ServiceException; public class PolicyTypes { @@ -38,8 +41,27 @@ public class PolicyTypes { return t; } + public synchronized PolicyType get(String name) { + return types.get(name); + } + public synchronized void put(PolicyType type) { types.put(type.name(), type); } + public synchronized boolean contains(String policyType) { + return types.containsKey(policyType); + } + + public synchronized Collection getAll() { + return Collections.unmodifiableCollection(types.values()); + } + + public synchronized int size() { + return types.size(); + } + + public synchronized void clear() { + this.types.clear(); + } }