openvidu-server: mediaServerId in Session, quarantined in Kms

pull/331/head
pabloFuente 2019-10-04 10:13:25 +02:00
parent 8624927a33
commit ba669573c4
4 changed files with 22 additions and 1 deletions

View File

@ -118,6 +118,10 @@ public class Session implements SessionInterface {
return closed;
}
public String getMediaServerId() {
return null;
}
protected void checkClosed() {
if (isClosed()) {
throw new OpenViduException(Code.ROOM_CLOSED_ERROR_CODE, "The session '" + sessionId + "' is closed");

View File

@ -45,6 +45,8 @@ public interface SessionInterface {
int getActivePublishers();
String getMediaServerId();
JsonObject toJson();
JsonObject withStatsToJson();

View File

@ -170,6 +170,11 @@ public class KurentoSession extends Session {
}
}
@Override
public String getMediaServerId() {
return this.kms.getId();
}
public void sendIceCandidate(String participantPrivateId, String senderPublicId, String endpointName,
IceCandidate candidate) {
this.kurentoSessionHandler.onIceCandidate(sessionId, participantPrivateId, senderPublicId, endpointName,

View File

@ -54,6 +54,7 @@ public class Kms {
private String id;
private String uri;
private String ip;
private boolean quarantined;
private KurentoClient client;
private LoadManager loadManager;
@ -66,6 +67,7 @@ public class Kms {
public Kms(KmsProperties props, LoadManager loadManager) {
this.id = props.getId();
this.uri = props.getUri();
this.quarantined = false;
String parsedUri = uri.replaceAll("^ws://", "http://").replaceAll("^wss://", "https://");
URL url = null;
@ -95,6 +97,14 @@ public class Kms {
return ip;
}
public synchronized boolean isQuarantined() {
return this.quarantined;
}
public synchronized void setQuarantined(boolean quarantined) {
this.quarantined = quarantined;
}
public KurentoClient getKurentoClient() {
return this.client;
}
@ -148,13 +158,13 @@ public class Kms {
json.addProperty("id", this.id);
json.addProperty("uri", this.uri);
json.addProperty("ip", this.ip);
json.addProperty("quarantined", this.quarantined);
final boolean connected = this.isKurentoClientConnected();
json.addProperty("connected", connected);
json.addProperty("connectionTime", this.getTimeOfKurentoClientConnection());
if (!connected) {
json.addProperty("disconnectionTime", this.getTimeOfKurentoClientDisconnection());
}
return json;
}