[WIFI-3165] Keep last stats received timestamp in gateway client session map

Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
This commit is contained in:
Mike Hansen
2021-07-19 11:01:13 -04:00
parent 1070708b44
commit 6264a8c490
6 changed files with 80 additions and 59 deletions

View File

@@ -210,10 +210,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
}
long locationId = autoProvisionedLocationId;
if ((customer.getDetails() != null) && (customer.getDetails().getAutoProvisioning() != null)
&& customer.getDetails().getAutoProvisioning().isEnabled()) {
locationId = customer.getDetails().getAutoProvisioning().getLocationId();
}
locationId = customer.getDetails().getAutoProvisioning().getLocationId();
try {
Location location = locationServiceInterface.get(locationId);
@@ -221,7 +218,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
} catch (Exception e) {
LOG.error("Cannot auto-provision equipment because customer location with id {} cannot be found", locationId);
throw new IllegalStateException("Cannot auto-provision equipment because customer location cannot be found : " + locationId);
}
ce.setSerial(connectNodeInfo.serialNumber);
@@ -250,7 +246,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
}
if (!radioType.equals(RadioType.UNSUPPORTED)) {
advancedRadioConfiguration = RadioConfiguration.createWithDefaults(radioType);
advancedRadioMap.put(radioType, advancedRadioConfiguration);
radioConfiguration = ElementRadioConfiguration.createWithDefaults(radioType);
radioMap.put(radioType, radioConfiguration);
@@ -386,7 +381,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
}
}
EquipmentRoutingRecord equipmentRoutingRecord = gatewayController.registerCustomerEquipment(ce.getName(), ce.getCustomerId(), ce.getId());
// Status and client cleanup, when AP reconnects or has been
@@ -497,7 +492,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
private void updateApStatus(Equipment ce, ConnectNodeInfo connectNodeInfo) {
try {
Status statusRecord = statusServiceInterface.getOrNull(ce.getCustomerId(), ce.getId(), StatusDataType.EQUIPMENT_ADMIN);
if (statusRecord == null) {
statusRecord = new Status();

View File

@@ -51,6 +51,7 @@ import com.telecominfraproject.wlan.equipment.EquipmentServiceInterface;
import com.telecominfraproject.wlan.equipment.models.Equipment;
import com.telecominfraproject.wlan.opensync.external.integration.OvsdbSession;
import com.telecominfraproject.wlan.opensync.external.integration.OvsdbSessionMapInterface;
import com.telecominfraproject.wlan.opensync.external.integration.controller.OpensyncCloudGatewayController;
import com.telecominfraproject.wlan.opensync.util.OvsdbToWlanCloudTypeMappingUtility;
import com.telecominfraproject.wlan.profile.ProfileServiceInterface;
import com.telecominfraproject.wlan.profile.models.Profile;
@@ -138,7 +139,9 @@ public class MqttStatsPublisher implements StatsPublisherInterface {
private RealtimeEventPublisher realtimeEventPublisher;
@Autowired
private AlarmServiceInterface alarmServiceInterface;
@Autowired
private OpensyncCloudGatewayController gatewayController;
@Value("${tip.wlan.mqttStatsPublisher.temperatureThresholdInC:80}")
private int temperatureThresholdInC;
@@ -170,7 +173,9 @@ public class MqttStatsPublisher implements StatsPublisherInterface {
long equipmentId = ce.getId();
long locationId = ce.getLocationId();
long profileId = ce.getProfileId();
// update timestamp for active customer equipment
gatewayController.updateActiveCustomer(customerId);
List<ServiceMetric> metricRecordList = new ArrayList<>();
try {
@@ -260,6 +265,7 @@ public class MqttStatsPublisher implements StatsPublisherInterface {
@Override
public void publishSystemEventFromTableStateMonitor(SystemEvent event) {
LOG.info("Publishing SystemEvent received by TableStateMonitor {}", event);
gatewayController.updateActiveCustomer(event.getCustomerId());
cloudEventDispatcherInterface.publishEvent(event);
}