WIFI-1195: JsonSerializedException for MacAddress with Client Interface

This commit is contained in:
Mike Hansen
2020-12-13 15:42:04 -05:00
parent 01c75f8175
commit 14cc34ef75
7 changed files with 165 additions and 68 deletions

View File

@@ -21,6 +21,7 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.telecominfraproject.wlan.client.ClientServiceInterface;
import com.telecominfraproject.wlan.client.info.models.ClientInfoDetails;
import com.telecominfraproject.wlan.client.models.Client;
import com.telecominfraproject.wlan.client.models.ClientType;
import com.telecominfraproject.wlan.client.session.models.AssociationState;
import com.telecominfraproject.wlan.client.session.models.ClientDhcpDetails;
@@ -92,6 +93,9 @@ import com.telecominfraproject.wlan.status.equipment.models.VLANStatusData;
import com.telecominfraproject.wlan.status.equipment.report.models.ActiveBSSID;
import com.telecominfraproject.wlan.status.equipment.report.models.ActiveBSSIDs;
import com.telecominfraproject.wlan.status.equipment.report.models.ClientConnectionDetails;
import com.telecominfraproject.wlan.status.equipment.report.models.EquipmentScanDetails;
import com.telecominfraproject.wlan.status.equipment.report.models.OperatingSystemPerformance;
import com.telecominfraproject.wlan.status.equipment.report.models.RadioUtilizationReport;
import com.telecominfraproject.wlan.status.models.Status;
import com.telecominfraproject.wlan.status.models.StatusCode;
import com.telecominfraproject.wlan.status.models.StatusDataType;
@@ -186,7 +190,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
ce.setEquipmentType(EquipmentType.AP);
ce.setInventoryId(apId);
try {
ce.setBaseMacAddress(new MacAddress(connectNodeInfo.macAddress));
ce.setBaseMacAddress(MacAddress.valueOf(connectNodeInfo.macAddress));
} catch (RuntimeException e) {
LOG.warn("Auto-provisioning: cannot parse equipment mac address {}", connectNodeInfo.macAddress);
}
@@ -280,7 +284,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
MacAddress reportedMacAddress = null;
try {
reportedMacAddress = new MacAddress(connectNodeInfo.macAddress);
reportedMacAddress = MacAddress.valueOf(connectNodeInfo.macAddress);
} catch (RuntimeException e) {
LOG.warn("AP connect: cannot parse equipment mac address {}", connectNodeInfo.macAddress);
}
@@ -569,7 +573,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
// need to make sure that this AP didn't accidentally get registered as
// a client previously via a partial DHCP lease event
LOG.info("Checking for non-wifi client types for Equipment {}", ce);
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(ce.getCustomerId(),
Client client = clientServiceInterface.getOrNull(ce.getCustomerId(),
ce.getBaseMacAddress());
if (client != null) {
@@ -874,7 +878,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
ret.setCaptiveProfiles(profileServiceInterface.get(captiveProfileIds));
ret.setBonjourGatewayProfiles(profileServiceInterface.get(bonjourGatewayProfileIds));
List<com.telecominfraproject.wlan.client.models.Client> blockedClients = clientServiceInterface
List<Client> blockedClients = clientServiceInterface
.getBlockedClients(customerId);
List<MacAddress> blockList = Lists.newArrayList();
if ((blockedClients != null) && !blockedClients.isEmpty()) {
@@ -1395,15 +1399,21 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
}
for (OpensyncWifiAssociatedClients opensyncWifiAssociatedClients : wifiAssociatedClients) {
com.telecominfraproject.wlan.client.models.Client clientInstance = clientServiceInterface
.getOrNull(customerId, new MacAddress(opensyncWifiAssociatedClients.getMac()));
LOG.info("opensyncWifiAssociatedClients {}", opensyncWifiAssociatedClients.toPrettyString());
String mMac = opensyncWifiAssociatedClients.mac;
MacAddress macAddress = MacAddress.valueOf(mMac);
Client clientInstance = clientServiceInterface
.getOrNull(customerId, macAddress);
boolean isReassociation = true;
if (clientInstance == null) {
clientInstance = new com.telecominfraproject.wlan.client.models.Client();
clientInstance = new Client();
clientInstance.setCustomerId(customerId);
clientInstance.setMacAddress(new MacAddress(opensyncWifiAssociatedClients.getMac()));
clientInstance.setMacAddress(MacAddress.valueOf(mMac));
clientInstance.setDetails(new ClientInfoDetails());
clientInstance = clientServiceInterface.create(clientInstance);
@@ -1715,10 +1725,10 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
return;
}
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId,
new MacAddress(deletedClientMac));
Client client = clientServiceInterface.getOrNull(customerId,
MacAddress.valueOf(deletedClientMac));
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId,
new MacAddress(deletedClientMac));
MacAddress.valueOf(deletedClientMac));
if (client != null) {
if (clientSession != null && clientSession.getDetails() != null
@@ -1734,9 +1744,9 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
if (clientSession != null) {
clientSession = clientServiceInterface.deleteSession(customerId, equipmentId,
new MacAddress(deletedClientMac));
MacAddress.valueOf(deletedClientMac));
LOG.info("No client {} found, delete session {}", new MacAddress(deletedClientMac), clientSession);
LOG.info("No client {} found, delete session {}", MacAddress.valueOf(deletedClientMac), clientSession);
}
}
@@ -1783,9 +1793,9 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
continue;
}
MacAddress clientMacAddress = new MacAddress(dhcpLeasedIps.get("hwaddr"));
MacAddress clientMacAddress = MacAddress.valueOf(dhcpLeasedIps.get("hwaddr"));
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId,
Client client = clientServiceInterface.getOrNull(customerId,
clientMacAddress);
if (client == null) {
@@ -1875,9 +1885,9 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
}
MacAddress clientMacAddress = new MacAddress(dhcpLeasedIps.get("hwaddr"));
MacAddress clientMacAddress = MacAddress.valueOf(dhcpLeasedIps.get("hwaddr"));
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId,
Client client = clientServiceInterface.getOrNull(customerId,
clientMacAddress);
if (client == null) {
LOG.info("Cannot find client instance for {}", clientMacAddress);
@@ -2107,4 +2117,77 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
// TODO: will handle changes from Command_State table
}
@Override
public void clearEquipmentStatus(String apId) {
OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId);
if (ovsdbSession == null) {
LOG.debug("clearEquipmentStatus::Cannot get Session for AP {}", apId);
return;
}
int customerId = ovsdbSession.getCustomerId();
long equipmentId = ovsdbSession.getEquipmentId();
if ((customerId < 0) || (equipmentId < 0)) {
LOG.debug("clearEquipmentStatus::Cannot get valid CustomerId {} or EquipmentId {} for AP {}",
customerId, equipmentId, apId);
return;
}
Equipment ce = equipmentServiceInterface.getOrNull(equipmentId);
if (ce == null) {
LOG.debug("clearEquipmentStatus Cannot get customer Equipment for {}", apId);
return;
}
List<Status> statusesToClear = new ArrayList<>();
Status activeBssids = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.ACTIVE_BSSIDS);
if (activeBssids != null) {
activeBssids.setDetails(new ActiveBSSIDs());
statusesToClear.add(activeBssids);
}
Status clientDetails = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.CLIENT_DETAILS);
if (clientDetails != null) {
clientDetails.setDetails(new ClientConnectionDetails());
statusesToClear.add(clientDetails);
}
Status radioUtilization = statusServiceInterface.getOrNull(customerId, equipmentId,
StatusDataType.RADIO_UTILIZATION);
if (radioUtilization != null) {
radioUtilization.setDetails(new RadioUtilizationReport());
statusesToClear.add(radioUtilization);
}
Status neighbourScanDetails = statusServiceInterface.getOrNull(customerId, equipmentId,
StatusDataType.NEIGHBOUR_SCAN);
if (neighbourScanDetails != null) {
neighbourScanDetails.setDetails(new EquipmentScanDetails());
statusesToClear.add(neighbourScanDetails);
}
Status operatingSystemPerformance = statusServiceInterface.getOrNull(customerId, equipmentId,
StatusDataType.OS_PERFORMANCE);
if (operatingSystemPerformance != null) {
operatingSystemPerformance.setDetails(new OperatingSystemPerformance());
statusesToClear.add(operatingSystemPerformance);
}
List<Status> clearedStatus = statusServiceInterface.update(statusesToClear);
clearedStatus.stream().forEach(s -> {
LOG.info("Cleared Status {}", s.toPrettyString());
});
List<Status> customerDashboardStatus = statusServiceInterface.getForEquipment(customerId, Set.of(equipmentId), Set.of(StatusDataType.CUSTOMER_DASHBOARD));
for (Status status : customerDashboardStatus) {
LOG.info("Updated status {}", statusServiceInterface.update(status) );
}
}
}

View File

@@ -396,12 +396,12 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
if (clientConnectEvent.hasStaMac()) {
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId,
new MacAddress(clientConnectEvent.getStaMac()));
MacAddress.valueOf(clientConnectEvent.getStaMac()));
if (client == null) {
client = new com.telecominfraproject.wlan.client.models.Client();
client.setCustomerId(customerId);
client.setMacAddress(new MacAddress(clientConnectEvent.getStaMac()));
client.setMacAddress(MacAddress.valueOf(clientConnectEvent.getStaMac()));
client.setDetails(new ClientInfoDetails());
@@ -410,7 +410,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
}
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId,
new MacAddress(clientConnectEvent.getStaMac()));
MacAddress.valueOf(clientConnectEvent.getStaMac()));
if (clientSession == null) {
clientSession = new ClientSession();
@@ -419,7 +419,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
clientSession.setCustomerId(customerId);
clientSession.setEquipmentId(equipmentId);
clientSession.setLocationId(locationId);
clientSession.setMacAddress(new MacAddress(clientConnectEvent.getStaMac()));
clientSession.setMacAddress(MacAddress.valueOf(clientConnectEvent.getStaMac()));
ClientSessionDetails clientSessionDetails = new ClientSessionDetails();
clientSessionDetails.setSessionId(apEventClientSession.getSessionId());
@@ -530,12 +530,12 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
if (clientDisconnectEvent.hasStaMac()) {
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId,
new MacAddress(clientDisconnectEvent.getStaMac()));
MacAddress.valueOf(clientDisconnectEvent.getStaMac()));
if (client == null) {
client = new com.telecominfraproject.wlan.client.models.Client();
client.setCustomerId(customerId);
client.setMacAddress(new MacAddress(clientDisconnectEvent.getStaMac()));
client.setMacAddress(MacAddress.valueOf(clientDisconnectEvent.getStaMac()));
client.setDetails(new ClientInfoDetails());
@@ -544,7 +544,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
}
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId,
new MacAddress(clientDisconnectEvent.getStaMac()));
MacAddress.valueOf(clientDisconnectEvent.getStaMac()));
if (clientSession == null) {
clientSession = new ClientSession();
@@ -553,7 +553,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
clientSession.setCustomerId(customerId);
clientSession.setEquipmentId(equipmentId);
clientSession.setLocationId(locationId);
clientSession.setMacAddress(new MacAddress(clientDisconnectEvent.getStaMac()));
clientSession.setMacAddress(MacAddress.valueOf(clientDisconnectEvent.getStaMac()));
ClientSessionDetails clientSessionDetails = new ClientSessionDetails();
@@ -612,12 +612,12 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
if (clientAuthEvent.hasStaMac()) {
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId,
new MacAddress(clientAuthEvent.getStaMac()));
MacAddress.valueOf(clientAuthEvent.getStaMac()));
if (client == null) {
client = new com.telecominfraproject.wlan.client.models.Client();
client.setCustomerId(customerId);
client.setMacAddress(new MacAddress(clientAuthEvent.getStaMac()));
client.setMacAddress(MacAddress.valueOf(clientAuthEvent.getStaMac()));
client.setDetails(new ClientInfoDetails());
@@ -626,7 +626,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
}
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId,
new MacAddress(clientAuthEvent.getStaMac()));
MacAddress.valueOf(clientAuthEvent.getStaMac()));
if (clientSession == null) {
clientSession = new ClientSession();
@@ -635,7 +635,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
clientSession.setCustomerId(customerId);
clientSession.setEquipmentId(equipmentId);
clientSession.setLocationId(locationId);
clientSession.setMacAddress(new MacAddress(clientAuthEvent.getStaMac()));
clientSession.setMacAddress(MacAddress.valueOf(clientAuthEvent.getStaMac()));
ClientSessionDetails clientSessionDetails = new ClientSessionDetails();
@@ -671,12 +671,12 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
for (ClientAssocEvent clientAssocEvent : apEventClientSession.getClientAssocEventList()) {
if (clientAssocEvent.hasStaMac()) {
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId,
new MacAddress(clientAssocEvent.getStaMac()));
MacAddress.valueOf(clientAssocEvent.getStaMac()));
if (client == null) {
client = new com.telecominfraproject.wlan.client.models.Client();
client.setCustomerId(customerId);
client.setMacAddress(new MacAddress(clientAssocEvent.getStaMac()));
client.setMacAddress(MacAddress.valueOf(clientAssocEvent.getStaMac()));
client.setDetails(new ClientInfoDetails());
@@ -685,7 +685,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
}
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId,
new MacAddress(clientAssocEvent.getStaMac()));
MacAddress.valueOf(clientAssocEvent.getStaMac()));
if (clientSession == null) {
clientSession = new ClientSession();
@@ -693,7 +693,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
clientSession.setCustomerId(customerId);
clientSession.setEquipmentId(equipmentId);
clientSession.setLocationId(locationId);
clientSession.setMacAddress(new MacAddress(clientAssocEvent.getStaMac()));
clientSession.setMacAddress(MacAddress.valueOf(clientAssocEvent.getStaMac()));
ClientSessionDetails clientSessionDetails = new ClientSessionDetails();
if (clientAssocEvent.hasUsing11K()) {
@@ -745,12 +745,12 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
if (clientFailureEvent.hasStaMac()) {
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId,
new MacAddress(clientFailureEvent.getStaMac()));
MacAddress.valueOf(clientFailureEvent.getStaMac()));
if (client == null) {
client = new com.telecominfraproject.wlan.client.models.Client();
client.setCustomerId(customerId);
client.setMacAddress(new MacAddress(clientFailureEvent.getStaMac()));
client.setMacAddress(MacAddress.valueOf(clientFailureEvent.getStaMac()));
client.setDetails(new ClientInfoDetails());
@@ -759,7 +759,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
}
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId,
new MacAddress(clientFailureEvent.getStaMac()));
MacAddress.valueOf(clientFailureEvent.getStaMac()));
if (clientSession == null) {
clientSession = new ClientSession();
@@ -768,7 +768,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
clientSession.setCustomerId(customerId);
clientSession.setEquipmentId(equipmentId);
clientSession.setLocationId(locationId);
clientSession.setMacAddress(new MacAddress(clientFailureEvent.getStaMac()));
clientSession.setMacAddress(MacAddress.valueOf(clientFailureEvent.getStaMac()));
ClientSessionDetails clientSessionDetails = new ClientSessionDetails();
@@ -807,12 +807,12 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
if (clientFirstDataEvent.hasStaMac()) {
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId,
new MacAddress(clientFirstDataEvent.getStaMac()));
MacAddress.valueOf(clientFirstDataEvent.getStaMac()));
if (client == null) {
client = new com.telecominfraproject.wlan.client.models.Client();
client.setCustomerId(customerId);
client.setMacAddress(new MacAddress(clientFirstDataEvent.getStaMac()));
client.setMacAddress(MacAddress.valueOf(clientFirstDataEvent.getStaMac()));
client.setDetails(new ClientInfoDetails());
@@ -821,7 +821,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
}
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId,
new MacAddress(clientFirstDataEvent.getStaMac()));
MacAddress.valueOf(clientFirstDataEvent.getStaMac()));
if (clientSession == null) {
clientSession = new ClientSession();
@@ -830,7 +830,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
clientSession.setCustomerId(customerId);
clientSession.setEquipmentId(equipmentId);
clientSession.setLocationId(locationId);
clientSession.setMacAddress(new MacAddress(clientFirstDataEvent.getStaMac()));
clientSession.setMacAddress(MacAddress.valueOf(clientFirstDataEvent.getStaMac()));
ClientSessionDetails clientSessionDetails = new ClientSessionDetails();
@@ -866,12 +866,12 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
if (clientIdEvent.hasCltMac()) {
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId,
new MacAddress(clientIdEvent.getCltMac()));
MacAddress.valueOf(clientIdEvent.getCltMac()));
if (client == null) {
client = new com.telecominfraproject.wlan.client.models.Client();
client.setCustomerId(customerId);
client.setMacAddress(new MacAddress(clientIdEvent.getCltMac()));
client.setMacAddress(MacAddress.valueOf(clientIdEvent.getCltMac()));
client.setDetails(new ClientInfoDetails());
@@ -880,7 +880,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
}
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId,
new MacAddress(clientIdEvent.getCltMac()));
MacAddress.valueOf(clientIdEvent.getCltMac()));
if (clientSession == null) {
clientSession = new ClientSession();
@@ -889,7 +889,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
clientSession.setCustomerId(customerId);
clientSession.setEquipmentId(equipmentId);
clientSession.setLocationId(locationId);
clientSession.setMacAddress(new MacAddress(clientIdEvent.getCltMac()));
clientSession.setMacAddress(MacAddress.valueOf(clientIdEvent.getCltMac()));
ClientSessionDetails clientSessionDetails = new ClientSessionDetails();
@@ -915,12 +915,12 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
if (clientIpEvent.hasStaMac()) {
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId,
new MacAddress(clientIpEvent.getStaMac()));
MacAddress.valueOf(clientIpEvent.getStaMac()));
if (client == null) {
client = new com.telecominfraproject.wlan.client.models.Client();
client.setCustomerId(customerId);
client.setMacAddress(new MacAddress(clientIpEvent.getStaMac()));
client.setMacAddress(MacAddress.valueOf(clientIpEvent.getStaMac()));
client.setDetails(new ClientInfoDetails());
@@ -929,7 +929,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
}
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId,
new MacAddress(clientIpEvent.getStaMac()));
MacAddress.valueOf(clientIpEvent.getStaMac()));
if (clientSession == null) {
clientSession = new ClientSession();
@@ -938,7 +938,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
clientSession.setCustomerId(customerId);
clientSession.setEquipmentId(equipmentId);
clientSession.setLocationId(locationId);
clientSession.setMacAddress(new MacAddress(clientIpEvent.getStaMac()));
clientSession.setMacAddress(MacAddress.valueOf(clientIpEvent.getStaMac()));
ClientSessionDetails clientSessionDetails = new ClientSessionDetails();
@@ -972,12 +972,12 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
if (clientTimeoutEvent.hasStaMac()) {
com.telecominfraproject.wlan.client.models.Client client = clientServiceInterface.getOrNull(customerId,
new MacAddress(clientTimeoutEvent.getStaMac()));
MacAddress.valueOf(clientTimeoutEvent.getStaMac()));
if (client == null) {
client = new com.telecominfraproject.wlan.client.models.Client();
client.setCustomerId(customerId);
client.setMacAddress(new MacAddress(clientTimeoutEvent.getStaMac()));
client.setMacAddress(MacAddress.valueOf(clientTimeoutEvent.getStaMac()));
client.setDetails(new ClientInfoDetails());
@@ -986,7 +986,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
}
ClientSession clientSession = clientServiceInterface.getSessionOrNull(customerId, equipmentId,
new MacAddress(clientTimeoutEvent.getStaMac()));
MacAddress.valueOf(clientTimeoutEvent.getStaMac()));
if (clientSession == null) {
clientSession = new ClientSession();
@@ -995,7 +995,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
clientSession.setCustomerId(customerId);
clientSession.setEquipmentId(equipmentId);
clientSession.setLocationId(locationId);
clientSession.setMacAddress(new MacAddress(clientTimeoutEvent.getStaMac()));
clientSession.setMacAddress(MacAddress.valueOf(clientTimeoutEvent.getStaMac()));
ClientSessionDetails clientSessionDetails = new ClientSessionDetails();
@@ -1621,7 +1621,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
List<MacAddress> clientMacList = new ArrayList<>();
clientMacs.forEach(macStr -> {
try {
clientMacList.add(new MacAddress(macStr));
clientMacList.add(MacAddress.valueOf(macStr));
} catch (RuntimeException e) {
LOG.warn("Cannot parse mac address from MQTT ClientReport {} ", macStr);
}
@@ -1926,12 +1926,12 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
LOG.debug("Processing ClientReport from AP {}", cl.getMacAddress());
ServiceMetric smr = new ServiceMetric(customerId, equipmentId, new MacAddress(cl.getMacAddress()));
ServiceMetric smr = new ServiceMetric(customerId, equipmentId, MacAddress.valueOf(cl.getMacAddress()));
smr.setLocationId(locationId);
metricRecordList.add(smr);
smr.setCreatedTimestamp(clReport.getTimestampMs());
smr.setClientMac(new MacAddress(cl.getMacAddress()).getAddressAsLong());
smr.setClientMac(MacAddress.valueOf(cl.getMacAddress()).getAddressAsLong());
// clReport.getChannel();
ClientMetrics cMetrics = new ClientMetrics();
@@ -2058,7 +2058,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
}
nr.setChannel(nBss.getChannel());
nr.setMacAddress(new MacAddress(nBss.getBssid()));
nr.setMacAddress(MacAddress.valueOf(nBss.getBssid()));
nr.setNetworkType(NetworkType.AP);
nr.setPacketType(NeighborScanPacketType.BEACON);
nr.setPrivacy(((nBss.getSsid() == null) || nBss.getSsid().isEmpty()) ? true : false);
@@ -2085,7 +2085,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
equipmentId, locationId, client.getMacAddress());
com.telecominfraproject.wlan.client.models.Client clientInstance = clientServiceInterface
.getOrNull(customerId, new MacAddress(client.getMacAddress()));
.getOrNull(customerId, MacAddress.valueOf(client.getMacAddress()));
boolean isReassociation = true;
if (clientInstance == null) {
@@ -2293,7 +2293,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
statusDetails = (ActiveBSSIDs) activeBssidsStatus.getDetails();
for (ActiveBSSID activeBSSID : ((ActiveBSSIDs) activeBssidsStatus.getDetails()).getActiveBSSIDs()) {
if (activeBSSID.getRadioType().equals(radioType)) {
ssidStatistics.setBssid(new MacAddress(activeBSSID.getBssid()));
ssidStatistics.setBssid(MacAddress.valueOf(activeBSSID.getBssid()));
// ssid value, in case not in stats, else will take
// stats value after
ssid = activeBSSID.getSsid();
@@ -2346,7 +2346,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
// disconnect occured during this window
if (client.hasMacAddress()) {
ClientSession session = clientServiceInterface.getSessionOrNull(customerId, equipmentId,
new MacAddress(client.getMacAddress()));
MacAddress.valueOf(client.getMacAddress()));
if (session != null) {
if ((session.getDetails().getAssociationState() != null) && !session.getDetails()

View File

@@ -493,10 +493,10 @@ public class OpensyncExternalIntegrationCloudTest {
Mockito.when(statusServiceInterface.update(ArgumentMatchers.any(Status.class))).thenReturn(bssidStatus);
com.telecominfraproject.wlan.client.models.Client clientInstance = new com.telecominfraproject.wlan.client.models.Client();
clientInstance.setMacAddress(new MacAddress("7C:AB:60:E6:EA:4D"));
clientInstance.setMacAddress(MacAddress.valueOf("7C:AB:60:E6:EA:4D"));
clientInstance.setDetails(new ClientInfoDetails());
com.telecominfraproject.wlan.client.models.Client clientInstance2 = new com.telecominfraproject.wlan.client.models.Client();
clientInstance2.setMacAddress(new MacAddress("C0:9A:D0:76:A9:69"));
clientInstance2.setMacAddress(MacAddress.valueOf("C0:9A:D0:76:A9:69"));
clientInstance2.setDetails(new ClientInfoDetails());
Mockito.when(
clientServiceInterface.getOrNull(ArgumentMatchers.anyInt(), ArgumentMatchers.any(MacAddress.class)))
@@ -506,10 +506,10 @@ public class OpensyncExternalIntegrationCloudTest {
.thenReturn(clientInstance).thenReturn(clientInstance2);
ClientSession clientSession = new ClientSession();
clientSession.setMacAddress(new MacAddress("7C:AB:60:E6:EA:4D"));
clientSession.setMacAddress(MacAddress.valueOf("7C:AB:60:E6:EA:4D"));
clientSession.setDetails(new ClientSessionDetails());
ClientSession clientSession2 = new ClientSession();
clientSession2.setMacAddress(new MacAddress("C0:9A:D0:76:A9:69"));
clientSession2.setMacAddress(MacAddress.valueOf("C0:9A:D0:76:A9:69"));
clientSession2.setDetails(new ClientSessionDetails());
Mockito.when(clientServiceInterface.getSessionOrNull(ArgumentMatchers.anyInt(), ArgumentMatchers.anyLong(),
ArgumentMatchers.any(MacAddress.class))).thenReturn(clientSession).thenReturn(clientSession2);

View File

@@ -210,10 +210,10 @@ public class OpensyncExternalIntegrationMqttMessageProcessorTest {
Mockito.when(statusServiceInterface.update(ArgumentMatchers.any(Status.class))).thenReturn(bssidStatus);
com.telecominfraproject.wlan.client.models.Client clientInstance = new com.telecominfraproject.wlan.client.models.Client();
clientInstance.setMacAddress(new MacAddress("7C:AB:60:E6:EA:4D"));
clientInstance.setMacAddress(MacAddress.valueOf("7C:AB:60:E6:EA:4D"));
clientInstance.setDetails(new ClientInfoDetails());
com.telecominfraproject.wlan.client.models.Client clientInstance2 = new com.telecominfraproject.wlan.client.models.Client();
clientInstance2.setMacAddress(new MacAddress("C0:9A:D0:76:A9:69"));
clientInstance2.setMacAddress(MacAddress.valueOf("C0:9A:D0:76:A9:69"));
clientInstance2.setDetails(new ClientInfoDetails());
Mockito.when(
clientServiceInterface.getOrNull(ArgumentMatchers.anyInt(), ArgumentMatchers.any(MacAddress.class)))
@@ -223,10 +223,10 @@ public class OpensyncExternalIntegrationMqttMessageProcessorTest {
.thenReturn(clientInstance).thenReturn(clientInstance2);
ClientSession clientSession = new ClientSession();
clientSession.setMacAddress(new MacAddress("7C:AB:60:E6:EA:4D"));
clientSession.setMacAddress(MacAddress.valueOf("7C:AB:60:E6:EA:4D"));
clientSession.setDetails(new ClientSessionDetails());
ClientSession clientSession2 = new ClientSession();
clientSession2.setMacAddress(new MacAddress("C0:9A:D0:76:A9:69"));
clientSession2.setMacAddress(MacAddress.valueOf("C0:9A:D0:76:A9:69"));
clientSession2.setDetails(new ClientSessionDetails());
Mockito.when(clientServiceInterface.getSessionOrNull(ArgumentMatchers.anyInt(), ArgumentMatchers.anyLong(),
ArgumentMatchers.any(MacAddress.class))).thenReturn(clientSession).thenReturn(clientSession2);

View File

@@ -51,4 +51,6 @@ public interface OpensyncExternalIntegrationInterface {
void dhcpLeasedIpDbTableUpdate(List<Map<String,String>> dhcpAttributes, String apId, RowUpdateOperation rowUpdateOperation);
void commandStateDbTableUpdate(List<Map<String,String>> commandStateAttributes, String apId, RowUpdateOperation rowUpdateOperation);
void clearEquipmentStatus(String apId);
}

View File

@@ -275,4 +275,10 @@ public class OpensyncExternalIntegrationSimple implements OpensyncExternalIntegr
}
@Override
public void clearEquipmentStatus(String apId) {
LOG.info("Received clearEquipmentStatus for ap {}",apId);
}
}

View File

@@ -199,6 +199,8 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
ovsdbDao.removeWifiRrm(ovsdbClient);
ovsdbDao.removeAllStatsConfigs(ovsdbClient); // always
extIntegrationInterface.clearEquipmentStatus(apId);
OpensyncAPConfig opensyncAPConfig = extIntegrationInterface.getApConfig(apId);
if (opensyncAPConfig != null) {
@@ -273,6 +275,10 @@ public class TipWlanOvsdbClient implements OvsdbClientInterface {
ovsdbDao.removeWifiRrm(ovsdbClient);
ovsdbDao.removeAllStatsConfigs(ovsdbClient); // always
extIntegrationInterface.clearEquipmentStatus(apId);
ovsdbDao.configureWifiRadios(ovsdbClient, opensyncAPConfig);
ovsdbDao.configureWifiRrm(ovsdbClient, opensyncAPConfig);
ovsdbDao.configureGreTunnels(ovsdbClient, opensyncAPConfig);