mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: remove unused destroyWhenUnused
parent
021944801e
commit
5f1f360a5b
|
@ -58,15 +58,13 @@ public class KurentoSession extends Session {
|
|||
|
||||
private Object pipelineCreateLock = new Object();
|
||||
private Object pipelineReleaseLock = new Object();
|
||||
private boolean destroyKurentoClient;
|
||||
|
||||
public final ConcurrentHashMap<String, String> publishedStreamIds = new ConcurrentHashMap<>();
|
||||
|
||||
public KurentoSession(Session sessionNotActive, Kms kms, KurentoSessionEventsHandler kurentoSessionHandler,
|
||||
KurentoParticipantEndpointConfig kurentoEndpointConfig, boolean destroyKurentoClient) {
|
||||
KurentoParticipantEndpointConfig kurentoEndpointConfig) {
|
||||
super(sessionNotActive);
|
||||
this.kms = kms;
|
||||
this.destroyKurentoClient = destroyKurentoClient;
|
||||
this.kurentoSessionHandler = kurentoSessionHandler;
|
||||
this.kurentoEndpointConfig = kurentoEndpointConfig;
|
||||
log.debug("New SESSION instance with id '{}'", sessionId);
|
||||
|
@ -155,10 +153,6 @@ public class KurentoSession extends Session {
|
|||
|
||||
log.debug("Session {} closed", this.sessionId);
|
||||
|
||||
if (destroyKurentoClient) {
|
||||
kms.getKurentoClient().destroy();
|
||||
}
|
||||
|
||||
// Also disassociate the KurentoSession from the Kms
|
||||
kms.removeKurentoSession(this.sessionId);
|
||||
|
||||
|
|
|
@ -496,8 +496,7 @@ public class KurentoSessionManager extends SessionManager {
|
|||
throw new OpenViduException(Code.ROOM_CANNOT_BE_CREATED_ERROR_CODE,
|
||||
"Session '" + session.getSessionId() + "' already exists");
|
||||
}
|
||||
session = new KurentoSession(sessionNotActive, kms, kurentoSessionEventsHandler, kurentoEndpointConfig,
|
||||
kmsManager.destroyWhenUnused());
|
||||
session = new KurentoSession(sessionNotActive, kms, kurentoSessionEventsHandler, kurentoEndpointConfig);
|
||||
|
||||
KurentoSession oldSession = (KurentoSession) sessions.putIfAbsent(session.getSessionId(), session);
|
||||
if (oldSession != null) {
|
||||
|
@ -845,10 +844,6 @@ public class KurentoSessionManager extends SessionManager {
|
|||
return ((KurentoSession) session).getParticipantPrivateIdFromStreamId(streamId);
|
||||
}
|
||||
|
||||
public KmsManager getKmsManager() {
|
||||
return this.kmsManager;
|
||||
}
|
||||
|
||||
private void applyFilterInPublisher(KurentoParticipant kParticipant, KurentoFilter filter)
|
||||
throws OpenViduException {
|
||||
GenericMediaElement.Builder builder = new GenericMediaElement.Builder(kParticipant.getPipeline(),
|
||||
|
|
|
@ -40,7 +40,7 @@ public class SubscriberEndpoint extends MediaEndpoint {
|
|||
|
||||
private AtomicBoolean connectedToPublisher = new AtomicBoolean(false);
|
||||
|
||||
private PublisherEndpoint publisher = null;
|
||||
private String publisherStreamId;
|
||||
|
||||
public SubscriberEndpoint(boolean web, KurentoParticipant owner, String endpointName, MediaPipeline pipeline,
|
||||
OpenviduConfig openviduConfig) {
|
||||
|
@ -54,7 +54,7 @@ public class SubscriberEndpoint extends MediaEndpoint {
|
|||
gatherCandidates();
|
||||
publisher.connect(this.getEndpoint());
|
||||
setConnectedToPublisher(true);
|
||||
setPublisher(publisher);
|
||||
this.publisherStreamId = publisher.getStreamId();
|
||||
return sdpAnswer;
|
||||
}
|
||||
|
||||
|
@ -66,15 +66,11 @@ public class SubscriberEndpoint extends MediaEndpoint {
|
|||
this.connectedToPublisher.set(connectedToPublisher);
|
||||
}
|
||||
|
||||
public void setPublisher(PublisherEndpoint publisher) {
|
||||
this.publisher = publisher;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonObject toJson() {
|
||||
JsonObject json = super.toJson();
|
||||
try {
|
||||
json.addProperty("streamId", this.publisher.getStreamId());
|
||||
json.addProperty("streamId", this.publisherStreamId);
|
||||
} catch (NullPointerException ex) {
|
||||
json.addProperty("streamId", "NOT_FOUND");
|
||||
}
|
||||
|
|
|
@ -132,10 +132,6 @@ public abstract class KmsManager {
|
|||
return kmsLoads;
|
||||
}
|
||||
|
||||
public boolean destroyWhenUnused() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected KurentoConnectionListener generateKurentoConnectionListener(String kmsId) {
|
||||
return new KurentoConnectionListener() {
|
||||
|
||||
|
|
Loading…
Reference in New Issue