mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-01 11:07:49 +00:00
Adding Classification type for Client based on DHCP_leased_IP
Adding translation utility to map between ovsdb and wlan cloud for firmware upgrade state and failure state (if required)
This commit is contained in:
@@ -1207,109 +1207,15 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EquipmentUpgradeState fwUpgradeState = EquipmentUpgradeState.undefined;
|
int upgradeStatusFromAp = opensyncAPState.getUpgradeStatus();
|
||||||
|
|
||||||
|
EquipmentUpgradeState fwUpgradeState = OvsdbToWlanCloudTypeMappingUtility
|
||||||
|
.getCloudEquipmentUpgradeStateFromOpensyncUpgradeStatus(upgradeStatusFromAp);
|
||||||
FailureReason fwUpgradeFailureReason = null;
|
FailureReason fwUpgradeFailureReason = null;
|
||||||
switch (opensyncAPState.getUpgradeStatus()) {
|
|
||||||
case 0:
|
|
||||||
break; // nothing
|
|
||||||
case -1:
|
|
||||||
LOG.error("upgrade_status: Wrong arguments (app error)");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.download_failed;
|
|
||||||
fwUpgradeFailureReason = FailureReason.downloadRequestRejected;
|
|
||||||
break;
|
|
||||||
case -3:
|
|
||||||
LOG.error("upgrade_status: Incorrect URL)");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.download_failed;
|
|
||||||
fwUpgradeFailureReason = FailureReason.unreachableUrl;
|
|
||||||
break;
|
|
||||||
case -4:
|
|
||||||
LOG.error("upgrade_status: Failed firmware image download");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.download_failed;
|
|
||||||
fwUpgradeFailureReason = FailureReason.downloadFailed;
|
|
||||||
break;
|
|
||||||
case -5:
|
|
||||||
LOG.error("upgrade_status: Error while downloading firmware md5 sum file");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.download_failed;
|
|
||||||
fwUpgradeFailureReason = FailureReason.downloadFailed;
|
|
||||||
break;
|
|
||||||
case -6:
|
|
||||||
LOG.error("upgrade_status: md5 checksum file error");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.download_failed;
|
|
||||||
fwUpgradeFailureReason = FailureReason.validationFailed;
|
|
||||||
break;
|
|
||||||
case -7:
|
|
||||||
LOG.error("upgrade_status: Firmware image error");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.apply_failed;
|
|
||||||
fwUpgradeFailureReason = FailureReason.validationFailed;
|
|
||||||
break;
|
|
||||||
case -8:
|
|
||||||
LOG.error("upgrade_status: Flash erase failed");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.apply_failed;
|
|
||||||
fwUpgradeFailureReason = FailureReason.applyFailed;
|
|
||||||
break;
|
|
||||||
case -9:
|
|
||||||
LOG.error("upgrade_status: Flash write failed");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.apply_failed;
|
|
||||||
fwUpgradeFailureReason = FailureReason.applyFailed;
|
|
||||||
break;
|
|
||||||
case -10:
|
|
||||||
LOG.error("upgrade_status: Flash verification failed");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.apply_failed;
|
|
||||||
fwUpgradeFailureReason = FailureReason.validationFailed;
|
|
||||||
break;
|
|
||||||
case -11:
|
|
||||||
LOG.error("upgrade_status: Set new bootconfig failed");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.apply_failed;
|
|
||||||
fwUpgradeFailureReason = FailureReason.applyFailed;
|
|
||||||
break;
|
|
||||||
case -12:
|
|
||||||
LOG.error("upgrade_status: Device restart failed");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.reboot_failed;
|
|
||||||
fwUpgradeFailureReason = FailureReason.rebootTimedout;
|
|
||||||
break;
|
|
||||||
case -14:
|
|
||||||
LOG.error("upgrade_status: Flash BootConfig erase failed");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.apply_failed;
|
|
||||||
fwUpgradeFailureReason = FailureReason.applyFailed;
|
|
||||||
break;
|
|
||||||
case -15:
|
|
||||||
LOG.error("upgrade_status: Safe update is running");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.apply_failed;
|
|
||||||
fwUpgradeFailureReason = FailureReason.applyFailed;
|
|
||||||
break;
|
|
||||||
case -16:
|
|
||||||
LOG.error("upgrade_status: Not enough free space on device");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.download_failed;
|
|
||||||
fwUpgradeFailureReason = FailureReason.downloadRequestFailedFlashFull;
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
LOG.info("upgrade_status: Firmware download started for AP {}", apId);
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.download_initiated;
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
LOG.info("upgrade_status: Firmware download successful, triggering upgrade.");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.download_complete;
|
|
||||||
break;
|
|
||||||
case 20:
|
|
||||||
LOG.info("upgrade_status: FW write on alt partition started");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.apply_initiated;
|
|
||||||
break;
|
|
||||||
case 21:
|
|
||||||
LOG.info("upgrade_status: FW image write successfully completed");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.apply_complete;
|
|
||||||
break;
|
|
||||||
case 30:
|
|
||||||
LOG.info("upgrade_status: Bootconfig partition update started");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.apply_initiated;
|
|
||||||
break;
|
|
||||||
case 31:
|
|
||||||
LOG.info("upgrade_status: Bootconfig partition update completed");
|
|
||||||
fwUpgradeState = EquipmentUpgradeState.apply_complete;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
LOG.debug("upgrade_status: {}", opensyncAPState.getUpgradeStatus());
|
|
||||||
|
|
||||||
|
if (upgradeStatusFromAp < 0) {
|
||||||
|
fwUpgradeFailureReason = OvsdbToWlanCloudTypeMappingUtility
|
||||||
|
.getCloudEquipmentUpgradeFailureReasonFromOpensyncUpgradeStatus(upgradeStatusFromAp);
|
||||||
}
|
}
|
||||||
|
|
||||||
Status protocolStatus = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.PROTOCOL);
|
Status protocolStatus = statusServiceInterface.getOrNull(customerId, equipmentId, StatusDataType.PROTOCOL);
|
||||||
@@ -1687,7 +1593,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
|
|
||||||
DhcpFpDeviceType dhcpFpDeviceType = DhcpFpDeviceType
|
DhcpFpDeviceType dhcpFpDeviceType = DhcpFpDeviceType
|
||||||
.getById(Integer.valueOf(dhcpLeasedIps.get("device_type")));
|
.getByName(dhcpLeasedIps.get("device_type"));
|
||||||
ClientType clientType = OvsdbToWlanCloudTypeMappingUtility
|
ClientType clientType = OvsdbToWlanCloudTypeMappingUtility
|
||||||
.getClientTypeForDhcpFpDeviceType(dhcpFpDeviceType);
|
.getClientTypeForDhcpFpDeviceType(dhcpFpDeviceType);
|
||||||
|
|
||||||
@@ -1733,6 +1639,20 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
clientDetails.setApFingerprint(dhcpLeasedIps.get("fingerprint"));
|
clientDetails.setApFingerprint(dhcpLeasedIps.get("fingerprint"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dhcpLeasedIps.containsKey("device_type")) {
|
||||||
|
|
||||||
|
|
||||||
|
DhcpFpDeviceType dhcpFpDeviceType = DhcpFpDeviceType
|
||||||
|
.getByName(dhcpLeasedIps.get("device_type"));
|
||||||
|
ClientType clientType = OvsdbToWlanCloudTypeMappingUtility
|
||||||
|
.getClientTypeForDhcpFpDeviceType(dhcpFpDeviceType);
|
||||||
|
|
||||||
|
LOG.debug("Translate from ovsdb {} to cloud {}", dhcpFpDeviceType, clientType);
|
||||||
|
|
||||||
|
clientDetails.setClientType(clientType.getId());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
client.setDetails(clientDetails);
|
client.setDetails(clientDetails);
|
||||||
|
|
||||||
client = clientServiceInterface.create(client);
|
client = clientServiceInterface.create(client);
|
||||||
@@ -1792,6 +1712,19 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
clientDetails.setApFingerprint(dhcpLeasedIps.get("fingerprint"));
|
clientDetails.setApFingerprint(dhcpLeasedIps.get("fingerprint"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dhcpLeasedIps.containsKey("device_type")) {
|
||||||
|
|
||||||
|
|
||||||
|
DhcpFpDeviceType dhcpFpDeviceType = DhcpFpDeviceType.getByName(dhcpLeasedIps.get("device_type"));
|
||||||
|
ClientType clientType = OvsdbToWlanCloudTypeMappingUtility
|
||||||
|
.getClientTypeForDhcpFpDeviceType(dhcpFpDeviceType);
|
||||||
|
|
||||||
|
LOG.debug("Translate from ovsdb {} to cloud {}", dhcpFpDeviceType, clientType);
|
||||||
|
|
||||||
|
clientDetails.setClientType(clientType.getId());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
client.setDetails(clientDetails);
|
client.setDetails(clientDetails);
|
||||||
|
|
||||||
client = clientServiceInterface.update(client);
|
client = clientServiceInterface.update(client);
|
||||||
@@ -1870,6 +1803,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (dhcpLeasedIps.containsKey("hostname")) {
|
if (dhcpLeasedIps.containsKey("hostname")) {
|
||||||
|
|
||||||
clientSessionDetails.setHostname(dhcpLeasedIps.get("hostname"));
|
clientSessionDetails.setHostname(dhcpLeasedIps.get("hostname"));
|
||||||
@@ -1928,23 +1862,9 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (dhcpLeasedIps.containsKey("vendor_class")) {
|
|
||||||
clientSessionDetails.setClassificationName(dhcpLeasedIps.get("vendor_class"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dhcpLeasedIps.containsKey("db_status")) {
|
|
||||||
LOG.info("DHCP_leased_IP db_status {}", dhcpLeasedIps.get("db_status"));
|
|
||||||
}
|
|
||||||
if (dhcpLeasedIps.containsKey("device_name")) {
|
if (dhcpLeasedIps.containsKey("device_name")) {
|
||||||
LOG.info("DHCP_leased_IP device_name {}", dhcpLeasedIps.get("device_name"));
|
clientSessionDetails.setClassificationName(dhcpLeasedIps.get("device_name"));
|
||||||
}
|
}
|
||||||
if (dhcpLeasedIps.containsKey("device_type")) {
|
|
||||||
LOG.info("DHCP_leased_IP device_type {}", dhcpLeasedIps.get("device_type"));
|
|
||||||
}
|
|
||||||
if (dhcpLeasedIps.containsKey("manuf_id")) {
|
|
||||||
LOG.info("DHCP_leased_IP manuf_id {}", dhcpLeasedIps.get("manuf_id"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
clientSessionDetails.setDhcpDetails(clientDhcpDetails);
|
clientSessionDetails.setDhcpDetails(clientDhcpDetails);
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ import com.telecominfraproject.wlan.systemevent.equipment.realtime.RealTimeStrea
|
|||||||
import com.telecominfraproject.wlan.systemevent.equipment.realtime.RealTimeStreamingStopEvent;
|
import com.telecominfraproject.wlan.systemevent.equipment.realtime.RealTimeStreamingStopEvent;
|
||||||
import com.telecominfraproject.wlan.systemevent.equipment.realtime.SIPCallReportReason;
|
import com.telecominfraproject.wlan.systemevent.equipment.realtime.SIPCallReportReason;
|
||||||
import com.telecominfraproject.wlan.systemevent.equipment.realtime.SipCallStopReason;
|
import com.telecominfraproject.wlan.systemevent.equipment.realtime.SipCallStopReason;
|
||||||
import com.telecominfraproject.wlan.systemevent.equipment.realtime.StreamingVideoType;
|
|
||||||
import com.telecominfraproject.wlan.systemevent.models.SystemEvent;
|
import com.telecominfraproject.wlan.systemevent.models.SystemEvent;
|
||||||
|
|
||||||
import sts.OpensyncStats;
|
import sts.OpensyncStats;
|
||||||
@@ -1087,8 +1086,8 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (apStreamVideoServer.hasStreamingVideoType()) {
|
if (apStreamVideoServer.hasStreamingVideoType()) {
|
||||||
rtsStartEvent
|
rtsStartEvent.setType(OvsdbToWlanCloudTypeMappingUtility
|
||||||
.setType(getCloudStreamingVideoTypeFromApReport(apStreamVideoServer.getStreamingVideoType()));
|
.getCloudStreamingVideoTypeFromApReport(apStreamVideoServer.getStreamingVideoType()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (apStreamVideoServer.hasServerDnsName()) {
|
if (apStreamVideoServer.hasServerDnsName()) {
|
||||||
@@ -1140,8 +1139,8 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (apStreamVideoSessionStart.hasStreamingVideoType()) {
|
if (apStreamVideoSessionStart.hasStreamingVideoType()) {
|
||||||
rtsStartSessionEvent.setType(
|
rtsStartSessionEvent.setType(OvsdbToWlanCloudTypeMappingUtility
|
||||||
getCloudStreamingVideoTypeFromApReport(apStreamVideoSessionStart.getStreamingVideoType()));
|
.getCloudStreamingVideoTypeFromApReport(apStreamVideoSessionStart.getStreamingVideoType()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1181,7 +1180,8 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
|
|||||||
|
|
||||||
if (apStreamVideoStop.hasStreamingVideoType()) {
|
if (apStreamVideoStop.hasStreamingVideoType()) {
|
||||||
|
|
||||||
rtsStopEvent.setType(getCloudStreamingVideoTypeFromApReport(apStreamVideoStop.getStreamingVideoType()));
|
rtsStopEvent.setType(OvsdbToWlanCloudTypeMappingUtility
|
||||||
|
.getCloudStreamingVideoTypeFromApReport(apStreamVideoStop.getStreamingVideoType()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1198,24 +1198,6 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private StreamingVideoType getCloudStreamingVideoTypeFromApReport(
|
|
||||||
sts.OpensyncStats.StreamingVideoType apReportStreamingVideoType) {
|
|
||||||
switch (apReportStreamingVideoType) {
|
|
||||||
case NETFLIX:
|
|
||||||
return StreamingVideoType.NETFLIX;
|
|
||||||
case YOUTUBE:
|
|
||||||
return StreamingVideoType.YOUTUBE;
|
|
||||||
|
|
||||||
case PLEX:
|
|
||||||
return StreamingVideoType.PLEX;
|
|
||||||
|
|
||||||
case UNKNOWN:
|
|
||||||
return StreamingVideoType.UNKNOWN;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return StreamingVideoType.UNSUPPORTED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void populateApNodeMetrics(List<ServiceMetric> metricRecordList, Report report, int customerId, long equipmentId,
|
void populateApNodeMetrics(List<ServiceMetric> metricRecordList, Report report, int customerId, long equipmentId,
|
||||||
long locationId) {
|
long locationId) {
|
||||||
@@ -1255,7 +1237,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
|
|||||||
|
|
||||||
if (deviceReport.hasCpuUtil() && deviceReport.getCpuUtil().hasCpuUtil()) {
|
if (deviceReport.hasCpuUtil() && deviceReport.getCpuUtil().hasCpuUtil()) {
|
||||||
Integer cpuUtilization = deviceReport.getCpuUtil().getCpuUtil();
|
Integer cpuUtilization = deviceReport.getCpuUtil().getCpuUtil();
|
||||||
apPerformance.setCpuUtilized(new int[] { cpuUtilization.intValue() });
|
apPerformance.setCpuUtilized(new int[] { cpuUtilization });
|
||||||
}
|
}
|
||||||
|
|
||||||
apPerformance.setEthLinkState(EthernetLinkState.UP1000_FULL_DUPLEX);
|
apPerformance.setEthLinkState(EthernetLinkState.UP1000_FULL_DUPLEX);
|
||||||
@@ -1451,20 +1433,8 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
|
|||||||
// TODO not totally correct, NonWifi = totalBusy - iBSS - oBSS
|
// TODO not totally correct, NonWifi = totalBusy - iBSS - oBSS
|
||||||
radioUtil.setNonWifi(surveySample.getBusy() - surveySample.getBusyTx() - surveySample.getBusySelf());
|
radioUtil.setNonWifi(surveySample.getBusy() - surveySample.getBusyTx() - surveySample.getBusySelf());
|
||||||
|
|
||||||
switch (survey.getBand()) {
|
radioType = OvsdbToWlanCloudTypeMappingUtility
|
||||||
case BAND2G:
|
.getRadioTypeFromOpensyncStatsRadioBandType(survey.getBand());
|
||||||
radioType = RadioType.is2dot4GHz;
|
|
||||||
break;
|
|
||||||
case BAND5G:
|
|
||||||
radioType = RadioType.is5GHz;
|
|
||||||
break;
|
|
||||||
case BAND5GL:
|
|
||||||
radioType = RadioType.is5GHzL;
|
|
||||||
break;
|
|
||||||
case BAND5GU:
|
|
||||||
radioType = RadioType.is5GHzU;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (radioType != RadioType.UNSUPPORTED) {
|
if (radioType != RadioType.UNSUPPORTED) {
|
||||||
|
|
||||||
@@ -1485,7 +1455,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
|
|||||||
}
|
}
|
||||||
if (totalDurationMs > 0) {
|
if (totalDurationMs > 0) {
|
||||||
Long totalUtilization = Math.round((double) totalBusy / totalDurationMs);
|
Long totalUtilization = Math.round((double) totalBusy / totalDurationMs);
|
||||||
Long totalNonWifi = Math.round((double) totalBusy - (double) iBSS - (double) oBSS / totalDurationMs);
|
Long totalNonWifi = Math.round((double) totalBusy - (double) iBSS - ((double) oBSS / totalDurationMs));
|
||||||
|
|
||||||
EquipmentCapacityDetails cap = new EquipmentCapacityDetails();
|
EquipmentCapacityDetails cap = new EquipmentCapacityDetails();
|
||||||
cap.setUnavailableCapacity(totalNonWifi.intValue());
|
cap.setUnavailableCapacity(totalNonWifi.intValue());
|
||||||
@@ -1555,7 +1525,7 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
|
|||||||
|
|
||||||
if (dnsProbeMetricFromAp.hasState()) {
|
if (dnsProbeMetricFromAp.hasState()) {
|
||||||
StateUpDownError dnsState = OvsdbToWlanCloudTypeMappingUtility
|
StateUpDownError dnsState = OvsdbToWlanCloudTypeMappingUtility
|
||||||
.getCloudDnsStateFromOpensyncStatsStateUpDown(dnsProbeMetricFromAp.getState());
|
.getCloudMetricsStateFromOpensyncStatsStateUpDown(dnsProbeMetricFromAp.getState());
|
||||||
|
|
||||||
networkProbeMetrics.setDnsState(dnsState);
|
networkProbeMetrics.setDnsState(dnsState);
|
||||||
cloudDnsProbeMetric.setDnsState(dnsState);
|
cloudDnsProbeMetric.setDnsState(dnsState);
|
||||||
@@ -1584,18 +1554,12 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
|
|||||||
}
|
}
|
||||||
if (radiusMetrics.hasRadiusState()) {
|
if (radiusMetrics.hasRadiusState()) {
|
||||||
|
|
||||||
switch (radiusMetrics.getRadiusState()) {
|
if (radiusMetrics.hasRadiusState()) {
|
||||||
case SUD_down:
|
StateUpDownError radiusState = OvsdbToWlanCloudTypeMappingUtility
|
||||||
networkProbeMetrics.setRadiusState(StateUpDownError.disabled);
|
.getCloudMetricsStateFromOpensyncStatsStateUpDown(radiusMetrics.getRadiusState());
|
||||||
break;
|
|
||||||
case SUD_up:
|
networkProbeMetrics.setRadiusState(radiusState);
|
||||||
networkProbeMetrics.setRadiusState(StateUpDownError.enabled);
|
|
||||||
break;
|
|
||||||
case SUD_error:
|
|
||||||
networkProbeMetrics.setRadiusState(StateUpDownError.error);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
networkProbeMetrics.setRadiusState(StateUpDownError.UNSUPPORTED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1607,20 +1571,12 @@ public class OpensyncExternalIntegrationMqttMessageProcessor {
|
|||||||
networkProbeMetrics.setVlanIF(vlanMetrics.getVlanIF());
|
networkProbeMetrics.setVlanIF(vlanMetrics.getVlanIF());
|
||||||
}
|
}
|
||||||
if (vlanMetrics.hasDhcpState()) {
|
if (vlanMetrics.hasDhcpState()) {
|
||||||
|
StateUpDownError dhcpState = OvsdbToWlanCloudTypeMappingUtility
|
||||||
|
.getCloudMetricsStateFromOpensyncStatsStateUpDown(vlanMetrics.getDhcpState());
|
||||||
|
|
||||||
|
|
||||||
|
networkProbeMetrics.setDhcpState(dhcpState);
|
||||||
|
|
||||||
switch (vlanMetrics.getDhcpState()) {
|
|
||||||
case SUD_down:
|
|
||||||
networkProbeMetrics.setDhcpState(StateUpDownError.disabled);
|
|
||||||
break;
|
|
||||||
case SUD_up:
|
|
||||||
networkProbeMetrics.setDhcpState(StateUpDownError.enabled);
|
|
||||||
break;
|
|
||||||
case SUD_error:
|
|
||||||
networkProbeMetrics.setDhcpState(StateUpDownError.error);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
networkProbeMetrics.setDhcpState(StateUpDownError.UNSUPPORTED);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (vlanMetrics.hasLatency()) {
|
if (vlanMetrics.hasLatency()) {
|
||||||
networkProbeMetrics.setDhcpLatencyMs(vlanMetrics.getLatency());
|
networkProbeMetrics.setDhcpLatencyMs(vlanMetrics.getLatency());
|
||||||
|
|||||||
@@ -49,6 +49,12 @@
|
|||||||
<version>${tip-wlan-cloud.release.version}</version>
|
<version>${tip-wlan-cloud.release.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<artifactId>status-service-interface</artifactId>
|
||||||
|
<groupId>com.telecominfraproject.wlan</groupId>
|
||||||
|
<version>${tip-wlan-cloud.release.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java-util -->
|
<!-- https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java-util -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.protobuf</groupId>
|
<groupId>com.google.protobuf</groupId>
|
||||||
|
|||||||
@@ -3,8 +3,11 @@ package com.telecominfraproject.wlan.opensync.ovsdb.dao.utilities;
|
|||||||
import com.telecominfraproject.wlan.client.models.ClientType;
|
import com.telecominfraproject.wlan.client.models.ClientType;
|
||||||
import com.telecominfraproject.wlan.core.model.equipment.RadioType;
|
import com.telecominfraproject.wlan.core.model.equipment.RadioType;
|
||||||
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.enumerations.DhcpFpDeviceType;
|
import com.telecominfraproject.wlan.opensync.ovsdb.dao.models.enumerations.DhcpFpDeviceType;
|
||||||
//import com.telecominfraproject.wlan.servicemetric.apnode.models.StateUpDownError;
|
|
||||||
import com.telecominfraproject.wlan.servicemetric.apnode.models.StateUpDownError;
|
import com.telecominfraproject.wlan.servicemetric.apnode.models.StateUpDownError;
|
||||||
|
import com.telecominfraproject.wlan.status.equipment.models.EquipmentUpgradeState;
|
||||||
|
import com.telecominfraproject.wlan.status.equipment.models.EquipmentUpgradeState.FailureReason;
|
||||||
|
import com.telecominfraproject.wlan.systemevent.equipment.realtime.StreamingVideoType;
|
||||||
|
|
||||||
import sts.OpensyncStats.RadioBandType;
|
import sts.OpensyncStats.RadioBandType;
|
||||||
import sts.OpensyncStats.StateUpDown;
|
import sts.OpensyncStats.StateUpDown;
|
||||||
@@ -76,7 +79,7 @@ public class OvsdbToWlanCloudTypeMappingUtility {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static StateUpDownError getCloudDnsStateFromOpensyncStatsStateUpDown(StateUpDown apNetworkProbeState) {
|
public static StateUpDownError getCloudMetricsStateFromOpensyncStatsStateUpDown(StateUpDown apNetworkProbeState) {
|
||||||
switch (apNetworkProbeState) {
|
switch (apNetworkProbeState) {
|
||||||
case SUD_down:
|
case SUD_down:
|
||||||
return StateUpDownError.disabled;
|
return StateUpDownError.disabled;
|
||||||
@@ -92,4 +95,157 @@ public class OvsdbToWlanCloudTypeMappingUtility {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static StreamingVideoType getCloudStreamingVideoTypeFromApReport(
|
||||||
|
sts.OpensyncStats.StreamingVideoType apReportStreamingVideoType) {
|
||||||
|
switch (apReportStreamingVideoType) {
|
||||||
|
case NETFLIX:
|
||||||
|
return StreamingVideoType.NETFLIX;
|
||||||
|
case YOUTUBE:
|
||||||
|
return StreamingVideoType.YOUTUBE;
|
||||||
|
|
||||||
|
case PLEX:
|
||||||
|
return StreamingVideoType.PLEX;
|
||||||
|
|
||||||
|
case UNKNOWN:
|
||||||
|
return StreamingVideoType.UNKNOWN;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return StreamingVideoType.UNSUPPORTED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EquipmentUpgradeState getCloudEquipmentUpgradeStateFromOpensyncUpgradeStatus(int upgradeStatus) {
|
||||||
|
|
||||||
|
EquipmentUpgradeState ret = EquipmentUpgradeState.undefined;
|
||||||
|
|
||||||
|
switch (upgradeStatus) {
|
||||||
|
case 0:
|
||||||
|
break; // nothing
|
||||||
|
case -1:
|
||||||
|
ret = EquipmentUpgradeState.download_failed;
|
||||||
|
break;
|
||||||
|
case -3:
|
||||||
|
ret = EquipmentUpgradeState.download_failed;
|
||||||
|
break;
|
||||||
|
case -4:
|
||||||
|
ret = EquipmentUpgradeState.download_failed;
|
||||||
|
break;
|
||||||
|
case -5:
|
||||||
|
ret = EquipmentUpgradeState.download_failed;
|
||||||
|
break;
|
||||||
|
case -6:
|
||||||
|
ret = EquipmentUpgradeState.download_failed;
|
||||||
|
break;
|
||||||
|
case -7:
|
||||||
|
ret = EquipmentUpgradeState.apply_failed;
|
||||||
|
break;
|
||||||
|
case -8:
|
||||||
|
ret = EquipmentUpgradeState.apply_failed;
|
||||||
|
break;
|
||||||
|
case -9:
|
||||||
|
ret = EquipmentUpgradeState.apply_failed;
|
||||||
|
break;
|
||||||
|
case -10:
|
||||||
|
ret = EquipmentUpgradeState.apply_failed;
|
||||||
|
break;
|
||||||
|
case -11:
|
||||||
|
ret = EquipmentUpgradeState.apply_failed;
|
||||||
|
break;
|
||||||
|
case -12:
|
||||||
|
ret = EquipmentUpgradeState.reboot_failed;
|
||||||
|
break;
|
||||||
|
case -14:
|
||||||
|
ret = EquipmentUpgradeState.apply_failed;
|
||||||
|
break;
|
||||||
|
case -15:
|
||||||
|
ret = EquipmentUpgradeState.apply_failed;
|
||||||
|
break;
|
||||||
|
case -16:
|
||||||
|
ret = EquipmentUpgradeState.download_failed;
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
ret = EquipmentUpgradeState.download_initiated;
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
ret = EquipmentUpgradeState.download_complete;
|
||||||
|
break;
|
||||||
|
case 20:
|
||||||
|
ret = EquipmentUpgradeState.apply_initiated;
|
||||||
|
break;
|
||||||
|
case 21:
|
||||||
|
ret = EquipmentUpgradeState.apply_complete;
|
||||||
|
break;
|
||||||
|
case 30:
|
||||||
|
ret = EquipmentUpgradeState.apply_initiated;
|
||||||
|
break;
|
||||||
|
case 31:
|
||||||
|
ret = EquipmentUpgradeState.apply_complete;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EquipmentUpgradeState.FailureReason getCloudEquipmentUpgradeFailureReasonFromOpensyncUpgradeStatus(
|
||||||
|
int upgradeStatus) {
|
||||||
|
|
||||||
|
EquipmentUpgradeState.FailureReason ret = null;
|
||||||
|
|
||||||
|
switch (upgradeStatus) {
|
||||||
|
case 0:
|
||||||
|
break; // nothing
|
||||||
|
case -1:
|
||||||
|
ret = FailureReason.downloadRequestRejected;
|
||||||
|
break;
|
||||||
|
case -3:
|
||||||
|
ret = FailureReason.unreachableUrl;
|
||||||
|
break;
|
||||||
|
case -4:
|
||||||
|
ret = FailureReason.downloadFailed;
|
||||||
|
break;
|
||||||
|
case -5:
|
||||||
|
ret = FailureReason.downloadFailed;
|
||||||
|
break;
|
||||||
|
case -6:
|
||||||
|
ret = FailureReason.validationFailed;
|
||||||
|
break;
|
||||||
|
case -7:
|
||||||
|
ret = FailureReason.validationFailed;
|
||||||
|
break;
|
||||||
|
case -8:
|
||||||
|
ret = FailureReason.applyFailed;
|
||||||
|
break;
|
||||||
|
case -9:
|
||||||
|
ret = FailureReason.applyFailed;
|
||||||
|
break;
|
||||||
|
case -10:
|
||||||
|
ret = FailureReason.validationFailed;
|
||||||
|
break;
|
||||||
|
case -11:
|
||||||
|
ret = FailureReason.applyFailed;
|
||||||
|
break;
|
||||||
|
case -12:
|
||||||
|
ret = FailureReason.rebootTimedout;
|
||||||
|
break;
|
||||||
|
case -14:
|
||||||
|
ret = FailureReason.applyFailed;
|
||||||
|
break;
|
||||||
|
case -15:
|
||||||
|
ret = FailureReason.applyFailed;
|
||||||
|
break;
|
||||||
|
case -16:
|
||||||
|
ret = FailureReason.downloadRequestFailedFlashFull;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user