CRNTI to be unique per cell, added fields in configuration, rx_signal from seconds to ms, on cell connection we resend meascells
diff --git a/src/main/java/org.onosproject.xran/wrapper/UeMap.java b/src/main/java/org.onosproject.xran/wrapper/UeMap.java
index a42ecbd..1938a79 100644
--- a/src/main/java/org.onosproject.xran/wrapper/UeMap.java
+++ b/src/main/java/org.onosproject.xran/wrapper/UeMap.java
@@ -16,21 +16,25 @@
package org.onosproject.xran.wrapper;
+import com.google.common.base.Objects;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import io.netty.channel.ChannelHandlerContext;
+import javafx.util.Pair;
import org.onosproject.net.HostId;
import org.onosproject.xran.XranStore;
import org.onosproject.xran.codecs.api.CRNTI;
+import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.ENBUES1APID;
import org.onosproject.xran.codecs.api.MMEUES1APID;
+import org.onosproject.xran.entities.RnibCell;
import org.onosproject.xran.entities.RnibUe;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
public class UeMap {
- private BiMap<CRNTI, MMEUES1APID> crntUe = HashBiMap.create();
+ private BiMap<EcgiCrntiPair, MMEUES1APID> crntUe = HashBiMap.create();
private XranStore xranStore;
@@ -38,21 +42,29 @@
this.xranStore = xranStore;
}
- public void put(RnibUe ue) {
+ public BiMap<EcgiCrntiPair, MMEUES1APID> getCrntUe() {
+ return crntUe;
+ }
+
+ public void putCrnti(RnibCell cell, RnibUe ue) {
+ CRNTI ranId = ue.getRanId();
+ ECGI ecgi = cell.getEcgi();
+ if (ranId != null && ecgi != null) {
+ crntUe.put(EcgiCrntiPair.valueOf(cell.getEcgi(),ue.getRanId()), ue.getMmeS1apId());
+ }
+ }
+
+ public void put(RnibCell cell, RnibUe ue) {
MMEUES1APID mmeS1apId = ue.getMmeS1apId();
if (mmeS1apId != null) {
xranStore.storeUe(ue);
- }
-
- CRNTI ranId = ue.getRanId();
- if (ranId != null) {
- crntUe.put(ranId, ue.getMmeS1apId());
+ putCrnti(cell, ue);
}
}
- public RnibUe get(CRNTI id) {
- MMEUES1APID mme = crntUe.get(id);
+ public RnibUe get(ECGI ecgi, CRNTI crnti) {
+ MMEUES1APID mme = crntUe.get(EcgiCrntiPair.valueOf(ecgi, crnti));
if (mme != null) {
return xranStore.getUe(mme);
}
@@ -70,4 +82,35 @@
crntUe.inverse().remove(id);
return xranStore.removeUe(id);
}
+
+ public static class EcgiCrntiPair extends Pair<ECGI, CRNTI> {
+
+ /**
+ * Creates a new pair
+ *
+ * @param key The key for this pair
+ * @param value The value to use for this pair
+ */
+ public EcgiCrntiPair(ECGI key, CRNTI value) {
+ super(key, value);
+ }
+
+ public static EcgiCrntiPair valueOf(ECGI key, CRNTI value) {
+ return new EcgiCrntiPair(key, value);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(getKey(), getValue());
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof EcgiCrntiPair) {
+ return ((EcgiCrntiPair) o).getKey().equals(getKey()) &&
+ ((EcgiCrntiPair) o).getValue().equals(getValue());
+ }
+ return super.equals(o);
+ }
+ }
}