mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-03 12:08:07 +00:00
WIFI-1397 Cloud SDK: inconsistent treatment of active/manual/auto/backup channels
This commit is contained in:
@@ -24,6 +24,10 @@ import com.telecominfraproject.wlan.equipment.EquipmentServiceInterface;
|
|||||||
import com.telecominfraproject.wlan.equipment.models.ApElementConfiguration;
|
import com.telecominfraproject.wlan.equipment.models.ApElementConfiguration;
|
||||||
import com.telecominfraproject.wlan.equipment.models.Equipment;
|
import com.telecominfraproject.wlan.equipment.models.Equipment;
|
||||||
import com.telecominfraproject.wlan.opensync.util.OvsdbToWlanCloudTypeMappingUtility;
|
import com.telecominfraproject.wlan.opensync.util.OvsdbToWlanCloudTypeMappingUtility;
|
||||||
|
import com.telecominfraproject.wlan.profile.ProfileServiceInterface;
|
||||||
|
import com.telecominfraproject.wlan.profile.models.ProfileContainer;
|
||||||
|
import com.telecominfraproject.wlan.profile.models.ProfileType;
|
||||||
|
import com.telecominfraproject.wlan.profile.rf.models.RfConfiguration;
|
||||||
import com.telecominfraproject.wlan.systemevent.equipment.BaseDhcpEvent;
|
import com.telecominfraproject.wlan.systemevent.equipment.BaseDhcpEvent;
|
||||||
import com.telecominfraproject.wlan.systemevent.equipment.realtime.RealTimeChannelHopEvent;
|
import com.telecominfraproject.wlan.systemevent.equipment.realtime.RealTimeChannelHopEvent;
|
||||||
import com.telecominfraproject.wlan.systemevent.equipment.realtime.RealTimeEventType;
|
import com.telecominfraproject.wlan.systemevent.equipment.realtime.RealTimeEventType;
|
||||||
@@ -81,6 +85,9 @@ public class RealtimeEventPublisher {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private EquipmentServiceInterface equipmentServiceInterface;
|
private EquipmentServiceInterface equipmentServiceInterface;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProfileServiceInterface profileServiceInterface;
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(RealtimeEventPublisher.class);
|
private static final Logger LOG = LoggerFactory.getLogger(RealtimeEventPublisher.class);
|
||||||
|
|
||||||
void publishChannelHopEvents(int customerId, long equipmentId, long locationId, EventReport e) {
|
void publishChannelHopEvents(int customerId, long equipmentId, long locationId, EventReport e) {
|
||||||
@@ -94,6 +101,16 @@ public class RealtimeEventPublisher {
|
|||||||
if (equipment == null) {
|
if (equipment == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ProfileContainer profileContainer = new ProfileContainer(
|
||||||
|
profileServiceInterface.getProfileWithChildren(equipment.getProfileId()));
|
||||||
|
RfConfiguration rfConfig = null;
|
||||||
|
if (profileContainer != null) {
|
||||||
|
rfConfig = (RfConfiguration) profileContainer.getChildOfTypeOrNull(equipment.getProfileId(), ProfileType.rf).getDetails();
|
||||||
|
}
|
||||||
|
if (profileContainer == null || rfConfig == null) {
|
||||||
|
LOG.warn("publishChannelHopEvents:profileContainer {} or RfConfiguration {} is null for customerId {} equipmentId {}",
|
||||||
|
profileContainer, rfConfig, customerId, equipmentId);
|
||||||
|
}
|
||||||
|
|
||||||
for (sts.OpensyncStats.EventReport.ChannelSwitchEvent channelSwitchEvent : e.getChannelSwitchList()) {
|
for (sts.OpensyncStats.EventReport.ChannelSwitchEvent channelSwitchEvent : e.getChannelSwitchList()) {
|
||||||
|
|
||||||
@@ -141,10 +158,14 @@ public class RealtimeEventPublisher {
|
|||||||
channelSwitchEvent);
|
channelSwitchEvent);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
boolean autoChannelSelection = false;
|
||||||
|
if (rfConfig != null && rfConfig.getRfConfigMap() != null && rfConfig.getRfConfigMap().get(radioType) != null) {
|
||||||
|
autoChannelSelection = rfConfig.getRfConfigMap().get(radioType).getAutoChannelSelection();
|
||||||
|
}
|
||||||
|
|
||||||
RealTimeChannelHopEvent channelHopEvent = new RealTimeChannelHopEvent(RealTimeEventType.Channel_Hop,
|
RealTimeChannelHopEvent channelHopEvent = new RealTimeChannelHopEvent(RealTimeEventType.Channel_Hop,
|
||||||
customerId, locationId, equipmentId, radioType, channel,
|
customerId, locationId, equipmentId, radioType, channel,
|
||||||
((ApElementConfiguration) equipment.getDetails()).getRadioMap().get(radioType).getChannelNumber(),
|
((ApElementConfiguration) equipment.getDetails()).getRadioMap().get(radioType).getActiveChannel(autoChannelSelection),
|
||||||
reason, timestamp);
|
reason, timestamp);
|
||||||
|
|
||||||
events.add(channelHopEvent);
|
events.add(channelHopEvent);
|
||||||
|
|||||||
Reference in New Issue
Block a user