mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: QuarantineKiller
parent
5f1f360a5b
commit
e8e85a2c58
|
@ -66,6 +66,8 @@ import io.openvidu.server.rpc.RpcNotificationService;
|
||||||
import io.openvidu.server.utils.CommandExecutor;
|
import io.openvidu.server.utils.CommandExecutor;
|
||||||
import io.openvidu.server.utils.GeoLocationByIp;
|
import io.openvidu.server.utils.GeoLocationByIp;
|
||||||
import io.openvidu.server.utils.GeoLocationByIpDummy;
|
import io.openvidu.server.utils.GeoLocationByIpDummy;
|
||||||
|
import io.openvidu.server.utils.QuarantineKiller;
|
||||||
|
import io.openvidu.server.utils.QuarantineKillerDummy;
|
||||||
import io.openvidu.server.webhook.CDRLoggerWebhook;
|
import io.openvidu.server.webhook.CDRLoggerWebhook;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -179,6 +181,12 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
||||||
return new GeoLocationByIpDummy();
|
return new GeoLocationByIpDummy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnMissingBean
|
||||||
|
public QuarantineKiller quarantineKiller() {
|
||||||
|
return new QuarantineKillerDummy();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerJsonRpcHandlers(JsonRpcHandlerRegistry registry) {
|
public void registerJsonRpcHandlers(JsonRpcHandlerRegistry registry) {
|
||||||
registry.addHandler(rpcHandler().withPingWatchdog(true).withInterceptors(new HttpHandshakeInterceptor()),
|
registry.addHandler(rpcHandler().withPingWatchdog(true).withInterceptors(new HttpHandshakeInterceptor()),
|
||||||
|
|
|
@ -51,6 +51,7 @@ import io.openvidu.server.kurento.core.KurentoTokenOptions;
|
||||||
import io.openvidu.server.recording.service.RecordingManager;
|
import io.openvidu.server.recording.service.RecordingManager;
|
||||||
import io.openvidu.server.utils.FormatChecker;
|
import io.openvidu.server.utils.FormatChecker;
|
||||||
import io.openvidu.server.utils.GeoLocation;
|
import io.openvidu.server.utils.GeoLocation;
|
||||||
|
import io.openvidu.server.utils.QuarantineKiller;
|
||||||
|
|
||||||
public abstract class SessionManager {
|
public abstract class SessionManager {
|
||||||
|
|
||||||
|
@ -71,6 +72,9 @@ public abstract class SessionManager {
|
||||||
@Autowired
|
@Autowired
|
||||||
protected TokenGenerator tokenGenerator;
|
protected TokenGenerator tokenGenerator;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected QuarantineKiller quarantineKiller;
|
||||||
|
|
||||||
public FormatChecker formatChecker = new FormatChecker();
|
public FormatChecker formatChecker = new FormatChecker();
|
||||||
|
|
||||||
protected ConcurrentMap<String, Session> sessions = new ConcurrentHashMap<>();
|
protected ConcurrentMap<String, Session> sessions = new ConcurrentHashMap<>();
|
||||||
|
@ -500,6 +504,8 @@ public abstract class SessionManager {
|
||||||
recordingManager.stopRecording(session, null, RecordingManager.finalReason(reason));
|
recordingManager.stopRecording(session, null, RecordingManager.finalReason(reason));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final String mediaServerId = session.getMediaServerId();
|
||||||
|
|
||||||
if (session.close(reason)) {
|
if (session.close(reason)) {
|
||||||
sessionEventsHandler.onSessionClosed(session.getSessionId(), reason);
|
sessionEventsHandler.onSessionClosed(session.getSessionId(), reason);
|
||||||
}
|
}
|
||||||
|
@ -507,6 +513,10 @@ public abstract class SessionManager {
|
||||||
this.cleanCollections(session.getSessionId());
|
this.cleanCollections(session.getSessionId());
|
||||||
|
|
||||||
log.info("Session '{}' removed and closed", session.getSessionId());
|
log.info("Session '{}' removed and closed", session.getSessionId());
|
||||||
|
|
||||||
|
if (mediaServerId != null) {
|
||||||
|
this.quarantineKiller.dropMediaServer(mediaServerId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void cleanCollections(String sessionId) {
|
protected void cleanCollections(String sessionId) {
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package io.openvidu.server.utils;
|
||||||
|
|
||||||
|
public interface QuarantineKiller {
|
||||||
|
|
||||||
|
public void dropMediaServer(String mediaServerId);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package io.openvidu.server.utils;
|
||||||
|
|
||||||
|
public class QuarantineKillerDummy implements QuarantineKiller {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dropMediaServer(String mediaServerId) {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue