X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fpolicyagent%2Frepository%2FRic.java;h=c50a0f093aca4bf6ef5d176d422b04b5923af8aa;hb=23bb4461f0d66b568675016e60be1ad478a02e98;hp=4291d6ef6e1ca8fb24f8e8260b2e15fa1cab28e1;hpb=9013ed7ad46ce6927fbf69890487e8df61b7d7ee;p=nonrtric.git diff --git a/policy-agent/src/main/java/org/oransc/policyagent/repository/Ric.java b/policy-agent/src/main/java/org/oransc/policyagent/repository/Ric.java index 4291d6ef..c50a0f09 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/repository/Ric.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/repository/Ric.java @@ -20,10 +20,9 @@ package org.oransc.policyagent.repository; -import java.util.ArrayList; +import com.google.common.collect.ImmutableList; import java.util.Collection; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Vector; @@ -39,7 +38,7 @@ import org.oransc.policyagent.configuration.RicConfig; public class Ric { private final RicConfig ricConfig; - private final List managedElementIds; + private final ImmutableList managedElementIds; private RicState state = RicState.UNDEFINED; private Map supportedPolicyTypes = new HashMap<>(); @@ -51,14 +50,13 @@ public class Ric { private final Lock lock = new Lock(); /** - * Creates the Ric. Initial state is {@link RicState.NOT_INITIATED}. + * Creates the Ric. Initial state is {@link RicState.UNDEFINED}. * * @param ricConfig The {@link RicConfig} for this Ric. */ public Ric(RicConfig ricConfig) { this.ricConfig = ricConfig; - this.managedElementIds = new ArrayList<>(ricConfig.managedElementIds()); // TODO, this is config why is it - // copied here? + this.managedElementIds = ricConfig.managedElementIds(); } public String name() { @@ -96,26 +94,6 @@ public class Ric { return managedElementIds.contains(managedElementId); } - /** - * Adds the given node as managed by this Ric. - * - * @param managedElementId the node to add. - */ - public synchronized void addManagedElement(String managedElementId) { - if (!managedElementIds.contains(managedElementId)) { - managedElementIds.add(managedElementId); - } - } - - /** - * Removes the given node as managed by this Ric. - * - * @param managedElementId the node to remove. - */ - public synchronized void removeManagedElement(String managedElementId) { - managedElementIds.remove(managedElementId); - } - /** * Gets the policy types supported by this Ric. *