Merge "Recovery handling"
[nonrtric.git] / policy-agent / src / main / java / org / oransc / policyagent / repository / PolicyTypes.java
index d3c2c4f..9dee6f9 100644 (file)
 
 package org.oransc.policyagent.repository;
 
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
+
 import org.oransc.policyagent.exceptions.ServiceException;
 
 public class PolicyTypes {
@@ -38,8 +40,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 boolean contains(String policyType) {
+        return types.containsKey(policyType);
+    }
+
+    public synchronized Collection<PolicyType> getAll() {
+        return types.values();
+    }
+
+    public int size() {
+        return types.size();
+    }
+
+    public void clear() {
+        this.types.clear();
+    }
 }