mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: mediaServerId in Session, quarantined in Kms
parent
8624927a33
commit
ba669573c4
|
@ -118,6 +118,10 @@ public class Session implements SessionInterface {
|
||||||
return closed;
|
return closed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMediaServerId() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
protected void checkClosed() {
|
protected void checkClosed() {
|
||||||
if (isClosed()) {
|
if (isClosed()) {
|
||||||
throw new OpenViduException(Code.ROOM_CLOSED_ERROR_CODE, "The session '" + sessionId + "' is closed");
|
throw new OpenViduException(Code.ROOM_CLOSED_ERROR_CODE, "The session '" + sessionId + "' is closed");
|
||||||
|
|
|
@ -45,6 +45,8 @@ public interface SessionInterface {
|
||||||
|
|
||||||
int getActivePublishers();
|
int getActivePublishers();
|
||||||
|
|
||||||
|
String getMediaServerId();
|
||||||
|
|
||||||
JsonObject toJson();
|
JsonObject toJson();
|
||||||
|
|
||||||
JsonObject withStatsToJson();
|
JsonObject withStatsToJson();
|
||||||
|
|
|
@ -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,
|
public void sendIceCandidate(String participantPrivateId, String senderPublicId, String endpointName,
|
||||||
IceCandidate candidate) {
|
IceCandidate candidate) {
|
||||||
this.kurentoSessionHandler.onIceCandidate(sessionId, participantPrivateId, senderPublicId, endpointName,
|
this.kurentoSessionHandler.onIceCandidate(sessionId, participantPrivateId, senderPublicId, endpointName,
|
||||||
|
|
|
@ -54,6 +54,7 @@ public class Kms {
|
||||||
private String id;
|
private String id;
|
||||||
private String uri;
|
private String uri;
|
||||||
private String ip;
|
private String ip;
|
||||||
|
private boolean quarantined;
|
||||||
private KurentoClient client;
|
private KurentoClient client;
|
||||||
private LoadManager loadManager;
|
private LoadManager loadManager;
|
||||||
|
|
||||||
|
@ -66,6 +67,7 @@ public class Kms {
|
||||||
public Kms(KmsProperties props, LoadManager loadManager) {
|
public Kms(KmsProperties props, LoadManager loadManager) {
|
||||||
this.id = props.getId();
|
this.id = props.getId();
|
||||||
this.uri = props.getUri();
|
this.uri = props.getUri();
|
||||||
|
this.quarantined = false;
|
||||||
|
|
||||||
String parsedUri = uri.replaceAll("^ws://", "http://").replaceAll("^wss://", "https://");
|
String parsedUri = uri.replaceAll("^ws://", "http://").replaceAll("^wss://", "https://");
|
||||||
URL url = null;
|
URL url = null;
|
||||||
|
@ -95,6 +97,14 @@ public class Kms {
|
||||||
return ip;
|
return ip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public synchronized boolean isQuarantined() {
|
||||||
|
return this.quarantined;
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void setQuarantined(boolean quarantined) {
|
||||||
|
this.quarantined = quarantined;
|
||||||
|
}
|
||||||
|
|
||||||
public KurentoClient getKurentoClient() {
|
public KurentoClient getKurentoClient() {
|
||||||
return this.client;
|
return this.client;
|
||||||
}
|
}
|
||||||
|
@ -148,13 +158,13 @@ public class Kms {
|
||||||
json.addProperty("id", this.id);
|
json.addProperty("id", this.id);
|
||||||
json.addProperty("uri", this.uri);
|
json.addProperty("uri", this.uri);
|
||||||
json.addProperty("ip", this.ip);
|
json.addProperty("ip", this.ip);
|
||||||
|
json.addProperty("quarantined", this.quarantined);
|
||||||
final boolean connected = this.isKurentoClientConnected();
|
final boolean connected = this.isKurentoClientConnected();
|
||||||
json.addProperty("connected", connected);
|
json.addProperty("connected", connected);
|
||||||
json.addProperty("connectionTime", this.getTimeOfKurentoClientConnection());
|
json.addProperty("connectionTime", this.getTimeOfKurentoClientConnection());
|
||||||
if (!connected) {
|
if (!connected) {
|
||||||
json.addProperty("disconnectionTime", this.getTimeOfKurentoClientDisconnection());
|
json.addProperty("disconnectionTime", this.getTimeOfKurentoClientDisconnection());
|
||||||
}
|
}
|
||||||
|
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue