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.GeoLocationByIp;
|
||||
import io.openvidu.server.utils.GeoLocationByIpDummy;
|
||||
import io.openvidu.server.utils.QuarantineKiller;
|
||||
import io.openvidu.server.utils.QuarantineKillerDummy;
|
||||
import io.openvidu.server.webhook.CDRLoggerWebhook;
|
||||
|
||||
/**
|
||||
|
@ -179,6 +181,12 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
|||
return new GeoLocationByIpDummy();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public QuarantineKiller quarantineKiller() {
|
||||
return new QuarantineKillerDummy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerJsonRpcHandlers(JsonRpcHandlerRegistry registry) {
|
||||
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.utils.FormatChecker;
|
||||
import io.openvidu.server.utils.GeoLocation;
|
||||
import io.openvidu.server.utils.QuarantineKiller;
|
||||
|
||||
public abstract class SessionManager {
|
||||
|
||||
|
@ -71,6 +72,9 @@ public abstract class SessionManager {
|
|||
@Autowired
|
||||
protected TokenGenerator tokenGenerator;
|
||||
|
||||
@Autowired
|
||||
protected QuarantineKiller quarantineKiller;
|
||||
|
||||
public FormatChecker formatChecker = new FormatChecker();
|
||||
|
||||
protected ConcurrentMap<String, Session> sessions = new ConcurrentHashMap<>();
|
||||
|
@ -500,6 +504,8 @@ public abstract class SessionManager {
|
|||
recordingManager.stopRecording(session, null, RecordingManager.finalReason(reason));
|
||||
}
|
||||
|
||||
final String mediaServerId = session.getMediaServerId();
|
||||
|
||||
if (session.close(reason)) {
|
||||
sessionEventsHandler.onSessionClosed(session.getSessionId(), reason);
|
||||
}
|
||||
|
@ -507,6 +513,10 @@ public abstract class SessionManager {
|
|||
this.cleanCollections(session.getSessionId());
|
||||
|
||||
log.info("Session '{}' removed and closed", session.getSessionId());
|
||||
|
||||
if (mediaServerId != null) {
|
||||
this.quarantineKiller.dropMediaServer(mediaServerId);
|
||||
}
|
||||
}
|
||||
|
||||
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