[WIFI-3129] set createTimestamp in Channel, ActiveBSSID, Lan, and Protocol status

This commit is contained in:
Thomas-Leung2021
2021-07-23 11:31:48 -04:00
committed by Mike Hansen
parent fb3963e750
commit a6cb5ae939

View File

@@ -37,7 +37,6 @@ import com.telecominfraproject.wlan.client.session.models.AssociationState;
import com.telecominfraproject.wlan.client.session.models.ClientDhcpDetails; import com.telecominfraproject.wlan.client.session.models.ClientDhcpDetails;
import com.telecominfraproject.wlan.client.session.models.ClientSession; 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.client.session.models.ClientSessionMetricDetails;
import com.telecominfraproject.wlan.core.model.entity.CountryCode; import com.telecominfraproject.wlan.core.model.entity.CountryCode;
import com.telecominfraproject.wlan.core.model.equipment.EquipmentType; import com.telecominfraproject.wlan.core.model.equipment.EquipmentType;
import com.telecominfraproject.wlan.core.model.equipment.MacAddress; import com.telecominfraproject.wlan.core.model.equipment.MacAddress;
@@ -1299,11 +1298,8 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
Status protocolStatus = null; Status protocolStatus = null;
Status channelStatus = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.RADIO_CHANNEL); Status currentChannelStatus = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.RADIO_CHANNEL);
Status channelStatusClone = null; Status newChannelStatus = null;
if (channelStatus != null) {
channelStatusClone = channelStatus.clone();
}
for (OpensyncAPRadioState radioState : radioStateTables) { for (OpensyncAPRadioState radioState : radioStateTables) {
LOG.debug("Processing Wifi_Radio_State table update for AP {} Radio {}", apId, radioState.freqBand); LOG.debug("Processing Wifi_Radio_State table update for AP {} Radio {}", apId, radioState.freqBand);
@@ -1316,17 +1312,17 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
protocolStatus = updateProtocolStatus(customerId, equipmentId, radioState); protocolStatus = updateProtocolStatus(customerId, equipmentId, radioState);
channelStatus = updateChannelStatus(customerId, equipmentId, channelStatus, radioState); newChannelStatus = updateChannelStatus(customerId, equipmentId, currentChannelStatus, radioState);
} }
if (protocolStatus != null) { if (protocolStatus != null) {
statusServiceInterface.update(protocolStatus); statusServiceInterface.update(protocolStatus);
} }
if (channelStatus != null && !Objects.equals(channelStatus, channelStatusClone)) { if (newChannelStatus != null && !Objects.equals(newChannelStatus, currentChannelStatus)) {
LOG.debug("wifiRadioStatusDbTableUpdate update Channel Status before {} after {}", channelStatusClone, LOG.debug("wifiRadioStatusDbTableUpdate update Channel Status before {} after {}", currentChannelStatus,
channelStatus); newChannelStatus);
statusServiceInterface.update(channelStatus); statusServiceInterface.update(newChannelStatus);
} }
if (configStateMismatch) { if (configStateMismatch) {
@@ -1389,6 +1385,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
channelStatus.setStatusDataType(StatusDataType.RADIO_CHANNEL); channelStatus.setStatusDataType(StatusDataType.RADIO_CHANNEL);
EquipmentChannelStatusData channelStatusData = new EquipmentChannelStatusData(); EquipmentChannelStatusData channelStatusData = new EquipmentChannelStatusData();
channelStatus.setDetails(channelStatusData); channelStatus.setDetails(channelStatusData);
channelStatus.setCreatedTimestamp(System.currentTimeMillis());
} }
((EquipmentChannelStatusData) channelStatus.getDetails()).getChannelNumberStatusDataMap() ((EquipmentChannelStatusData) channelStatus.getDetails()).getChannelNumberStatusDataMap()
.put(radioState.getFreqBand(), radioState.getChannel()); .put(radioState.getFreqBand(), radioState.getChannel());
@@ -1464,6 +1461,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
activeBssidsStatus.setCustomerId(customerId); activeBssidsStatus.setCustomerId(customerId);
activeBssidsStatus.setEquipmentId(equipmentId); activeBssidsStatus.setEquipmentId(equipmentId);
activeBssidsStatus.setStatusDataType(StatusDataType.ACTIVE_BSSIDS); activeBssidsStatus.setStatusDataType(StatusDataType.ACTIVE_BSSIDS);
activeBssidsStatus.setCreatedTimestamp(System.currentTimeMillis());
ActiveBSSIDs statusDetails = new ActiveBSSIDs(); ActiveBSSIDs statusDetails = new ActiveBSSIDs();
statusDetails.setActiveBSSIDs(new ArrayList<ActiveBSSID>()); statusDetails.setActiveBSSIDs(new ArrayList<ActiveBSSID>());
@@ -1542,6 +1540,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
lanStatus.setCustomerId(customerId); lanStatus.setCustomerId(customerId);
lanStatus.setEquipmentId(equipmentId); lanStatus.setEquipmentId(equipmentId);
lanStatus.setStatusDataType(StatusDataType.LANINFO); lanStatus.setStatusDataType(StatusDataType.LANINFO);
lanStatus.setCreatedTimestamp(System.currentTimeMillis());
lanStatus.setDetails(new EquipmentLANStatusData()); lanStatus.setDetails(new EquipmentLANStatusData());
lanStatus = statusServiceInterface.update(lanStatus); lanStatus = statusServiceInterface.update(lanStatus);
} }
@@ -1554,6 +1553,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
protocolStatus.setCustomerId(customerId); protocolStatus.setCustomerId(customerId);
protocolStatus.setEquipmentId(equipmentId); protocolStatus.setEquipmentId(equipmentId);
protocolStatus.setStatusDataType(StatusDataType.PROTOCOL); protocolStatus.setStatusDataType(StatusDataType.PROTOCOL);
protocolStatus.setCreatedTimestamp(System.currentTimeMillis());
protocolStatus.setDetails(new EquipmentProtocolStatusData()); protocolStatus.setDetails(new EquipmentProtocolStatusData());
protocolStatus = statusServiceInterface.update(protocolStatus); protocolStatus = statusServiceInterface.update(protocolStatus);
} }