mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-03 03:57:54 +00:00
Compare commits
1 Commits
release/v1
...
WIFI-7888-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1db594b656 |
@@ -138,7 +138,6 @@ import sts.OpensyncStats.Report;
|
|||||||
@Component
|
@Component
|
||||||
public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegrationInterface {
|
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";
|
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 VLAN_TRUNK_IF_TYPE = "vlan_trunk";
|
||||||
private static final String ALLOWED_VLANS = "allowed_vlans";
|
private static final String ALLOWED_VLANS = "allowed_vlans";
|
||||||
@@ -1826,7 +1825,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
clientSession.setLocationId(ce.getLocationId());
|
clientSession.setLocationId(ce.getLocationId());
|
||||||
clientSession.setDetails(new ClientSessionDetails());
|
clientSession.setDetails(new ClientSessionDetails());
|
||||||
long derivedSessionId = WiFiSessionUtility.encodeWiFiAssociationId(timestamp / 1000, clientInstance.getMacAddress().getAddressAsLong());
|
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().setDhcpDetails(new ClientDhcpDetails(Long.toUnsignedString(derivedSessionId)));
|
||||||
clientSession.getDetails().setAssociationState(AssociationState._802_11_Associated);
|
clientSession.getDetails().setAssociationState(AssociationState._802_11_Associated);
|
||||||
clientSession.getDetails().setIsReassociation(false);
|
clientSession.getDetails().setIsReassociation(false);
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import com.telecominfraproject.wlan.client.session.models.ClientSession;
|
|||||||
import com.telecominfraproject.wlan.client.session.models.ClientSessionDetails;
|
import com.telecominfraproject.wlan.client.session.models.ClientSessionDetails;
|
||||||
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherInterface;
|
import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherInterface;
|
||||||
import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
|
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.opensync.util.OvsdbToWlanCloudTypeMappingUtility;
|
||||||
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetric;
|
import com.telecominfraproject.wlan.servicemetric.models.ServiceMetric;
|
||||||
|
|
||||||
@@ -106,10 +105,10 @@ public class AsyncPublishService {
|
|||||||
processClientAssocEvent(customerId, equipmentId, locationId, apEventClientSession);
|
processClientAssocEvent(customerId, equipmentId, locationId, apEventClientSession);
|
||||||
}
|
}
|
||||||
if (apEventClientSession.hasClientIpEvent()) {
|
if (apEventClientSession.hasClientIpEvent()) {
|
||||||
processClientIpEvent(apId, customerId, equipmentId, locationId, apEventClientSession);
|
processClientIpEvent(customerId, equipmentId, locationId, apEventClientSession);
|
||||||
}
|
}
|
||||||
if (apEventClientSession.hasClientDisconnectEvent()) {
|
if (apEventClientSession.hasClientDisconnectEvent()) {
|
||||||
processClientDisconnectEvent(apId, customerId, equipmentId, locationId, apEventClientSession);
|
processClientDisconnectEvent(customerId, equipmentId, locationId, apEventClientSession);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
realtimeEventPublisher.publishChannelHopEvents(customerId, equipmentId, locationId, eventReport);
|
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();
|
ClientIpEvent apClientEvent = apEventClientSession.getClientIpEvent();
|
||||||
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId, MacAddress.valueOf(apClientEvent.getStaMac()));
|
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId, MacAddress.valueOf(apClientEvent.getStaMac()));
|
||||||
if (client == null) {
|
if (client == null) {
|
||||||
@@ -264,16 +263,12 @@ public class AsyncPublishService {
|
|||||||
if (clientSession.getDetails().getPriorEquipmentId() == null) {
|
if (clientSession.getDetails().getPriorEquipmentId() == null) {
|
||||||
clientSession.getDetails().setPriorEquipmentId(clientSession.getEquipmentId());
|
clientSession.getDetails().setPriorEquipmentId(clientSession.getEquipmentId());
|
||||||
}
|
}
|
||||||
|
if (clientSession.getDetails().getPriorSessionId() == null) {
|
||||||
String sessionId = clientSession.getDetails().getSessionId();
|
if (!Objects.equal(clientSession.getDetails().getSessionId(), Long.toUnsignedString(apEventClientSession.getSessionId())))
|
||||||
if (!Objects.equal(sessionId, Long.toUnsignedString(apEventClientSession.getSessionId()))) {
|
clientSession.getDetails().setPriorSessionId(clientSession.getDetails().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 (!Objects.equal(clientSession.getDetails().getSessionId(), Long.toUnsignedString(apEventClientSession.getSessionId()))) {
|
||||||
|
clientSession.getDetails().setPriorSessionId(clientSession.getDetails().getSessionId());
|
||||||
}
|
}
|
||||||
clientSession.getDetails().setSessionId(Long.toUnsignedString(apEventClientSession.getSessionId()));
|
clientSession.getDetails().setSessionId(Long.toUnsignedString(apEventClientSession.getSessionId()));
|
||||||
if (apClientEvent.hasIpAddr()) {
|
if (apClientEvent.hasIpAddr()) {
|
||||||
@@ -299,7 +294,7 @@ public class AsyncPublishService {
|
|||||||
realtimeEventPublisher.publishClientIpEvent(customerId, equipmentId, locationId, apEventClientSession.getClientIpEvent());
|
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) {
|
sts.OpensyncStats.EventReport.ClientSession apEventClientSession) {
|
||||||
ClientDisconnectEvent apClientEvent = apEventClientSession.getClientDisconnectEvent();
|
ClientDisconnectEvent apClientEvent = apEventClientSession.getClientDisconnectEvent();
|
||||||
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId, MacAddress.valueOf(apClientEvent.getStaMac()));
|
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())));
|
clientSession.getDetails().setDhcpDetails(new ClientDhcpDetails(Long.toUnsignedString(apEventClientSession.getSessionId())));
|
||||||
}
|
}
|
||||||
|
|
||||||
String sessionId = clientSession.getDetails().getSessionId();
|
if (clientSession.getDetails().getPriorSessionId() == null) {
|
||||||
if (!Objects.equal(sessionId, Long.toUnsignedString(apEventClientSession.getSessionId()))) {
|
if (!Objects.equal(clientSession.getDetails().getSessionId(), Long.toUnsignedString(apEventClientSession.getSessionId())))
|
||||||
if (sessionId != null && !sessionId.startsWith(OpensyncExternalIntegrationCloud.DERIVED_SESSION_ID_PREFIX)) {
|
clientSession.getDetails().setPriorSessionId(clientSession.getDetails().getSessionId());
|
||||||
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 (!Objects.equal(clientSession.getDetails().getSessionId(), Long.toUnsignedString(apEventClientSession.getSessionId()))) {
|
||||||
|
clientSession.getDetails().setPriorSessionId(clientSession.getDetails().getSessionId());
|
||||||
}
|
}
|
||||||
clientSession.getDetails().setSessionId(Long.toUnsignedString(apEventClientSession.getSessionId()));
|
clientSession.getDetails().setSessionId(Long.toUnsignedString(apEventClientSession.getSessionId()));
|
||||||
clientSession.getDetails().setRadioType(OvsdbToWlanCloudTypeMappingUtility.getRadioTypeFromOpensyncStatsRadioBandType(apClientEvent.getBand()));
|
clientSession.getDetails().setRadioType(OvsdbToWlanCloudTypeMappingUtility.getRadioTypeFromOpensyncStatsRadioBandType(apClientEvent.getBand()));
|
||||||
|
|||||||
Reference in New Issue
Block a user