openvidu-server: add nodeRecovered flag to mediaNodeUsageRegistration method

pull/711/head
pabloFuente 2022-03-28 12:39:26 +02:00
parent 239b7e28bf
commit f70053c2f3
3 changed files with 6 additions and 6 deletions

View File

@ -140,16 +140,15 @@ public class Kms {
return this.isKurentoClientConnected.get(); return this.isKurentoClientConnected.get();
} }
public void setKurentoClientConnected(boolean isConnected, boolean reconnection) { public void setKurentoClientConnected(boolean isConnected, boolean nodeRecovered) {
final long timestamp = System.currentTimeMillis(); final long timestamp = System.currentTimeMillis();
this.isKurentoClientConnected.set(isConnected); this.isKurentoClientConnected.set(isConnected);
if (isConnected) { if (isConnected) {
this.setTimeOfKurentoClientConnection(timestamp); this.setTimeOfKurentoClientConnection(timestamp);
this.setTimeOfKurentoClientDisconnection(0); this.setTimeOfKurentoClientDisconnection(0);
this.setHasTriggeredNodeCrashedEvent(false); this.setHasTriggeredNodeCrashedEvent(false);
if (!reconnection) { kmsManager.getMediaNodeManager().mediaNodeUsageRegistration(this, timestamp, kmsManager.getKmss(),
kmsManager.getMediaNodeManager().mediaNodeUsageRegistration(this, timestamp, kmsManager.getKmss()); nodeRecovered);
}
if (this.mediaServer == null) { if (this.mediaServer == null) {
this.fetchMediaServerType(); this.fetchMediaServerType();
} }

View File

@ -6,7 +6,7 @@ import io.openvidu.server.kurento.kms.Kms;
public interface MediaNodeManager { public interface MediaNodeManager {
public void mediaNodeUsageRegistration(Kms kms, long timeOfConnection, Collection<Kms> existingKmss); public void mediaNodeUsageRegistration(Kms kms, long timeOfConnection, Collection<Kms> existingKmss, boolean nodeRecovered);
public void mediaNodeUsageDeregistration(String mediaNodeId, long timeOfDisconnection); public void mediaNodeUsageDeregistration(String mediaNodeId, long timeOfDisconnection);

View File

@ -7,7 +7,8 @@ import io.openvidu.server.kurento.kms.Kms;
public class MediaNodeManagerDummy implements MediaNodeManager { public class MediaNodeManagerDummy implements MediaNodeManager {
@Override @Override
public void mediaNodeUsageRegistration(Kms kms, long timeOfConnection, Collection<Kms> existingKmss) { public void mediaNodeUsageRegistration(Kms kms, long timeOfConnection, Collection<Kms> existingKmss,
boolean nodeRecovered) {
} }
@Override @Override