[VOL-2663] aaa-app device event handling
Change-Id: Ibd68b3a5d4a72a2311927fa2cf331be9be7d1da9
diff --git a/app/src/main/java/org/opencord/aaa/impl/AaaManager.java b/app/src/main/java/org/opencord/aaa/impl/AaaManager.java
index d1a85d7..849bd14 100644
--- a/app/src/main/java/org/opencord/aaa/impl/AaaManager.java
+++ b/app/src/main/java/org/opencord/aaa/impl/AaaManager.java
@@ -1037,26 +1037,10 @@
String sessionId = deviceId.toString() + portNumber.toString();
log.debug("Received PORT_REMOVED event. Clearing AAA Session with Id {}", sessionId);
- StateMachine stateMachine = stateMachines.get(sessionId);
- if (stateMachine == null) {
- // No active AAA sessions for this UNI port
- log.debug("No Active AAA Session found with Id {}", sessionId);
- return;
- }
-
- authentications.remove(stateMachine.supplicantConnectpoint());
-
flushStateMachineSession(sessionId,
StateMachine.SessionTerminationReasons.PORT_REMOVED.getReason());
break;
- case DEVICE_AVAILABILITY_CHANGED:
- if (!deviceService.isAvailable(deviceId)) {
- log.debug("Received DEVICE_AVAILABILITY_CHANGED event for {}, " +
- "went available to un-available", deviceId);
- clearAllSessionStateForDevice(deviceId);
- }
- break;
case DEVICE_REMOVED:
log.debug("Received DEVICE_REMOVED event for {}", deviceId);
clearAllSessionStateForDevice(deviceId);
@@ -1091,6 +1075,7 @@
return;
}
+ authentications.remove(stateMachine.supplicantConnectpoint());
stateMachine.setSessionTerminateReason(terminationReason);
//pushing captured machine stats to kafka