xicic fix
diff --git a/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java b/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
index 1d9653d..ed7b0d2 100644
--- a/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
+++ b/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
@@ -107,6 +107,7 @@
private LinkMap linkMap;
/* MAPS */
private ConcurrentMap<String, ECGI> legitCells = new ConcurrentHashMap<>();
+ private ConcurrentMap<CRNTI, UEContextUpdate> hoContextUpdateMap = new ConcurrentHashMap<>();
private ConcurrentMap<CRNTI, SynchronousQueue<String>> hoQueue = new ConcurrentHashMap<>();
private ConcurrentMap<ECGI, SynchronousQueue<String>> RRMCellQueue = new ConcurrentHashMap<>();
private ConcurrentMap<CRNTI, SynchronousQueue<String>> scellAddQueue = new ConcurrentHashMap<>();
@@ -595,18 +596,23 @@
// Decode UE Admission Context Update.
UEContextUpdate ueContextUpdate = recv_pdu.getBody().getUEContextUpdate();
- RnibCell cell = xranStore.getCell(ueContextUpdate.getEcgi());
-
RnibUe ue = ueMap.get(ueContextUpdate.getMMEUES1APID());
- if (ueMap.get(ueContextUpdate.getMMEUES1APID()) == null) {
- ue = new RnibUe();
+ if (hoQueue.keySet().contains(ue.getRanId())) {
+ CRNTI crnti = ueContextUpdate.getCrnti();
+ hoContextUpdateMap.put(crnti, ueContextUpdate);
+ hoQueue.remove(ue.getRanId());
+ } else {
+ RnibCell cell = xranStore.getCell(ueContextUpdate.getEcgi());
+ if (ueMap.get(ueContextUpdate.getMMEUES1APID()) == null) {
+ ue = new RnibUe();
+ }
+
+ ue.setMmeS1apId(ueContextUpdate.getMMEUES1APID());
+ ue.setEnbS1apId(ueContextUpdate.getENBUES1APID());
+ ue.setRanId(ueContextUpdate.getCrnti());
+
+ hostAgent.addConnectedHost(ue, cell, ctx);
}
-
- ue.setMmeS1apId(ueContextUpdate.getMMEUES1APID());
- ue.setEnbS1apId(ueContextUpdate.getENBUES1APID());
- ue.setRanId(ueContextUpdate.getCrnti());
-
- hostAgent.addConnectedHost(ue, cell, ctx);
break;
}
case 6: {
@@ -714,6 +720,20 @@
e.printStackTrace();
} finally {
hoQueue.remove(hoComplete.getCrntiNew());
+
+ UEContextUpdate ueContextUpdate = hoContextUpdateMap.get(hoComplete.getCrntiNew());
+
+ RnibUe ue = ueMap.get(ueContextUpdate.getMMEUES1APID());
+ RnibCell cell = xranStore.getCell(ueContextUpdate.getEcgi());
+ if (ueMap.get(ueContextUpdate.getMMEUES1APID()) == null) {
+ ue = new RnibUe();
+ }
+
+ ue.setMmeS1apId(ueContextUpdate.getMMEUES1APID());
+ ue.setEnbS1apId(ueContextUpdate.getENBUES1APID());
+ ue.setRanId(ueContextUpdate.getCrnti());
+
+ hostAgent.addConnectedHost(ue, cell, ctx);
}
break;
}