openvidu-server: Network quality

- Added method to send notification with network quality
- Added double parser method
pull/546/head
csantosm 2020-09-18 15:13:52 +02:00
parent 70831114fe
commit 80a052fcea
2 changed files with 18 additions and 0 deletions

View File

@ -772,6 +772,20 @@ public class OpenviduConfig {
}
}
protected Double asNonNegativeDouble(String property) {
try {
Double doubleValue = Double.parseDouble(getValue(property));
if (doubleValue < 0) {
addError(property, "Is not a non negative double");
}
return doubleValue;
} catch (NumberFormatException e) {
addError(property, "Is not a non negative doubleValue");
return 0.0;
}
}
/*
* This method checks all types of Internet addresses (IPv4, IPv6 and Domains)
*/

View File

@ -311,6 +311,10 @@ public class SessionEventsHandler {
rpcNotificationService.sendResponse(participant.getParticipantPrivateId(), transactionId, new JsonObject());
}
public void onNetworkQualityChanged(Participant participant, JsonObject params ) {
rpcNotificationService.sendNotification(participant.getParticipantPrivateId(), ProtocolElements.NETWORKQUALITYCHANGED_METHOD, params);
}
public void onSendMessage(Participant participant, JsonObject message, Set<Participant> participants,
Integer transactionId, OpenViduException error) {