Compare commits

..

1 Commits

Author SHA1 Message Date
ralphlee
1db594b656 [WIFI-7888] Add concurrent burst config handling in opensync gateway 2022-05-11 15:43:39 -04:00
2 changed files with 17 additions and 26 deletions

View File

@@ -138,7 +138,6 @@ import sts.OpensyncStats.Report;
@Component
public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegrationInterface {
public static final String DERIVED_SESSION_ID_PREFIX = "DERIVED-";
protected static final String standard_linux_date_format = "EEE MMM dd HH:mm:ss zzz yyyy";
private static final String VLAN_TRUNK_IF_TYPE = "vlan_trunk";
private static final String ALLOWED_VLANS = "allowed_vlans";
@@ -1826,7 +1825,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
clientSession.setLocationId(ce.getLocationId());
clientSession.setDetails(new ClientSessionDetails());
long derivedSessionId = WiFiSessionUtility.encodeWiFiAssociationId(timestamp / 1000, clientInstance.getMacAddress().getAddressAsLong());
clientSession.getDetails().setSessionId(DERIVED_SESSION_ID_PREFIX + Long.toUnsignedString(derivedSessionId));
clientSession.getDetails().setSessionId(Long.toUnsignedString(derivedSessionId));
clientSession.getDetails().setDhcpDetails(new ClientDhcpDetails(Long.toUnsignedString(derivedSessionId)));
clientSession.getDetails().setAssociationState(AssociationState._802_11_Associated);
clientSession.getDetails().setIsReassociation(false);

View File

@@ -21,7 +21,6 @@ import com.telecominfraproject.wlan.client.session.models.ClientSession;
import com.telecominfraproject.wlan.client.session.models.ClientSessionDetails;
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherInterface;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
import com.telecominfraproject.wlan.opensync.external.integration.OpensyncExternalIntegrationCloud;
import com.telecominfraproject.wlan.opensync.util.OvsdbToWlanCloudTypeMappingUtility;
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetric;
@@ -106,10 +105,10 @@ public class AsyncPublishService {
processClientAssocEvent(customerId, equipmentId, locationId, apEventClientSession);
}
if (apEventClientSession.hasClientIpEvent()) {
processClientIpEvent(apId, customerId, equipmentId, locationId, apEventClientSession);
processClientIpEvent(customerId, equipmentId, locationId, apEventClientSession);
}
if (apEventClientSession.hasClientDisconnectEvent()) {
processClientDisconnectEvent(apId, customerId, equipmentId, locationId, apEventClientSession);
processClientDisconnectEvent(customerId, equipmentId, locationId, apEventClientSession);
}
}
realtimeEventPublisher.publishChannelHopEvents(customerId, equipmentId, locationId, eventReport);
@@ -239,7 +238,7 @@ public class AsyncPublishService {
}
private void processClientIpEvent(String apId, int customerId, long equipmentId, long locationId, sts.OpensyncStats.EventReport.ClientSession apEventClientSession) {
private void processClientIpEvent(int customerId, long equipmentId, long locationId, sts.OpensyncStats.EventReport.ClientSession apEventClientSession) {
ClientIpEvent apClientEvent = apEventClientSession.getClientIpEvent();
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId, MacAddress.valueOf(apClientEvent.getStaMac()));
if (client == null) {
@@ -264,16 +263,12 @@ public class AsyncPublishService {
if (clientSession.getDetails().getPriorEquipmentId() == null) {
clientSession.getDetails().setPriorEquipmentId(clientSession.getEquipmentId());
}
String sessionId = clientSession.getDetails().getSessionId();
if (!Objects.equal(sessionId, Long.toUnsignedString(apEventClientSession.getSessionId()))) {
if (sessionId != null && !sessionId.startsWith(OpensyncExternalIntegrationCloud.DERIVED_SESSION_ID_PREFIX)) {
LOG.info("Ignored clientIpEvent for different session ID for AP {}, clientMac {}: currentSessionId {}, ipSessionID {} ", apId,
apClientEvent.getStaMac(), sessionId, apEventClientSession.getSessionId());
realtimeEventPublisher.publishClientIpEvent(customerId, equipmentId, locationId, apEventClientSession.getClientIpEvent());
return;
}
clientSession.getDetails().setPriorSessionId(sessionId);
if (clientSession.getDetails().getPriorSessionId() == null) {
if (!Objects.equal(clientSession.getDetails().getSessionId(), Long.toUnsignedString(apEventClientSession.getSessionId())))
clientSession.getDetails().setPriorSessionId(clientSession.getDetails().getSessionId());
}
if (!Objects.equal(clientSession.getDetails().getSessionId(), Long.toUnsignedString(apEventClientSession.getSessionId()))) {
clientSession.getDetails().setPriorSessionId(clientSession.getDetails().getSessionId());
}
clientSession.getDetails().setSessionId(Long.toUnsignedString(apEventClientSession.getSessionId()));
if (apClientEvent.hasIpAddr()) {
@@ -299,7 +294,7 @@ public class AsyncPublishService {
realtimeEventPublisher.publishClientIpEvent(customerId, equipmentId, locationId, apEventClientSession.getClientIpEvent());
}
private void processClientDisconnectEvent(String apId, int customerId, long equipmentId, long locationId,
private void processClientDisconnectEvent(int customerId, long equipmentId, long locationId,
sts.OpensyncStats.EventReport.ClientSession apEventClientSession) {
ClientDisconnectEvent apClientEvent = apEventClientSession.getClientDisconnectEvent();
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId, MacAddress.valueOf(apClientEvent.getStaMac()));
@@ -321,15 +316,12 @@ public class AsyncPublishService {
clientSession.getDetails().setDhcpDetails(new ClientDhcpDetails(Long.toUnsignedString(apEventClientSession.getSessionId())));
}
String sessionId = clientSession.getDetails().getSessionId();
if (!Objects.equal(sessionId, Long.toUnsignedString(apEventClientSession.getSessionId()))) {
if (sessionId != null && !sessionId.startsWith(OpensyncExternalIntegrationCloud.DERIVED_SESSION_ID_PREFIX)) {
LOG.info("Ignored clientDisconnectEvent for different session ID for AP {}, clientMac {}: currentSessionId {}, disconnectSessionID {} ", apId,
apClientEvent.getStaMac(), sessionId, apEventClientSession.getSessionId());
realtimeEventPublisher.publishClientDisconnectEvent(customerId, equipmentId, locationId, apEventClientSession.getClientDisconnectEvent());
return;
}
clientSession.getDetails().setPriorSessionId(sessionId);
if (clientSession.getDetails().getPriorSessionId() == null) {
if (!Objects.equal(clientSession.getDetails().getSessionId(), Long.toUnsignedString(apEventClientSession.getSessionId())))
clientSession.getDetails().setPriorSessionId(clientSession.getDetails().getSessionId());
}
if (!Objects.equal(clientSession.getDetails().getSessionId(), Long.toUnsignedString(apEventClientSession.getSessionId()))) {
clientSession.getDetails().setPriorSessionId(clientSession.getDetails().getSessionId());
}
clientSession.getDetails().setSessionId(Long.toUnsignedString(apEventClientSession.getSessionId()));
clientSession.getDetails().setRadioType(OvsdbToWlanCloudTypeMappingUtility.getRadioTypeFromOpensyncStatsRadioBandType(apClientEvent.getBand()));