mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: fix deprecations and remove warnings
parent
4c4bf277e2
commit
bf56fe02a7
|
|
@ -544,6 +544,7 @@ public class RecordingProperties {
|
||||||
Boolean ignoreFailedStreamsParam;
|
Boolean ignoreFailedStreamsParam;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@SuppressWarnings("unused")
|
||||||
String session = (String) params.get("session");
|
String session = (String) params.get("session");
|
||||||
nameParam = (String) params.get("name");
|
nameParam = (String) params.get("name");
|
||||||
hasAudioParam = (Boolean) params.get("hasAudio");
|
hasAudioParam = (Boolean) params.get("hasAudio");
|
||||||
|
|
|
||||||
|
|
@ -353,7 +353,7 @@ public class PublisherEndpoint extends MediaEndpoint {
|
||||||
|
|
||||||
public JsonElement execMethod(String method, JsonObject params) throws OpenViduException {
|
public JsonElement execMethod(String method, JsonObject params) throws OpenViduException {
|
||||||
Props props = new JsonUtils().fromJsonObjectToProps(params);
|
Props props = new JsonUtils().fromJsonObjectToProps(params);
|
||||||
return (JsonElement) ((GenericMediaElement) this.filter).invoke(method, props, JsonElement.class);
|
return (JsonElement) this.filter.invoke(method, props, JsonElement.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void mute(TrackType muteType) {
|
public synchronized void mute(TrackType muteType) {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ package io.openvidu.server.kurento.kms;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ public class Recording {
|
||||||
try {
|
try {
|
||||||
this.duration = json.get("duration").getAsDouble();
|
this.duration = json.get("duration").getAsDouble();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
this.duration = Long.valueOf((long) json.get("duration").getAsLong()).doubleValue();
|
this.duration = Long.valueOf(json.get("duration").getAsLong()).doubleValue();
|
||||||
}
|
}
|
||||||
if (json.get("url").isJsonNull()) {
|
if (json.get("url").isJsonNull()) {
|
||||||
this.url = null;
|
this.url = null;
|
||||||
|
|
|
||||||
|
|
@ -165,14 +165,16 @@ public class SingleStreamRecordingService extends RecordingService {
|
||||||
});
|
});
|
||||||
final CountDownLatch stoppedCountDown = new CountDownLatch(wrappers.size());
|
final CountDownLatch stoppedCountDown = new CountDownLatch(wrappers.size());
|
||||||
|
|
||||||
ForkJoinPool customThreadPool = new ForkJoinPool(4);
|
try (ForkJoinPool customThreadPool = new ForkJoinPool(4)) {
|
||||||
try {
|
|
||||||
customThreadPool.submit(() -> wrappers.parallelStream().forEach(wrapper -> {
|
customThreadPool.submit(() -> wrappers.parallelStream().forEach(wrapper -> {
|
||||||
this.stopRecorderEndpointOfPublisherEndpoint(recording.getId(), wrapper.getStreamId(), stoppedCountDown,
|
this.stopRecorderEndpointOfPublisherEndpoint(recording.getId(), wrapper.getStreamId(), stoppedCountDown,
|
||||||
kmsDisconnectionTime);
|
kmsDisconnectionTime);
|
||||||
}));
|
}));
|
||||||
} finally {
|
|
||||||
customThreadPool.shutdown();
|
customThreadPool.shutdown();
|
||||||
|
customThreadPool.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
recording.setStatus(io.openvidu.java.client.Recording.Status.failed);
|
||||||
|
log.error("Exception while stopping recorder endpoints", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -253,7 +255,8 @@ public class SingleStreamRecordingService extends RecordingService {
|
||||||
|
|
||||||
RecorderEndpoint recorder = new RecorderEndpoint.Builder(pipeline,
|
RecorderEndpoint recorder = new RecorderEndpoint.Builder(pipeline,
|
||||||
"file://" + openviduConfig.getOpenViduRecordingPath(kmsUri) + recordingId + "/" + fileName
|
"file://" + openviduConfig.getOpenViduRecordingPath(kmsUri) + recordingId + "/" + fileName
|
||||||
+ fileExtension).withMediaProfile(profile).build();
|
+ fileExtension)
|
||||||
|
.withMediaProfile(profile).build();
|
||||||
|
|
||||||
recorder.addRecordingListener(new EventListener<RecordingEvent>() {
|
recorder.addRecordingListener(new EventListener<RecordingEvent>() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package io.openvidu.server.test.integration.config;
|
package io.openvidu.server.test.integration.config;
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.anyBoolean;
|
||||||
|
import static org.mockito.ArgumentMatchers.anyList;
|
||||||
import static org.mockito.Mockito.doAnswer;
|
import static org.mockito.Mockito.doAnswer;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
@ -44,7 +45,7 @@ public class IntegrationTestConfiguration {
|
||||||
List<Kms> successfullyConnectedKmss = new ArrayList<>();
|
List<Kms> successfullyConnectedKmss = new ArrayList<>();
|
||||||
List<KmsProperties> kmsProperties = null;
|
List<KmsProperties> kmsProperties = null;
|
||||||
try {
|
try {
|
||||||
kmsProperties = invocation.getArgument(0);
|
kmsProperties = invocation.<List<KmsProperties>>getArgument(0);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Assertions.fail("Error getting argument from stubbed method: " + e.getMessage());
|
Assertions.fail("Error getting argument from stubbed method: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -63,13 +64,13 @@ public class IntegrationTestConfiguration {
|
||||||
Thread.sleep((long) (Math.random() * 1000));
|
Thread.sleep((long) (Math.random() * 1000));
|
||||||
Continuation<MediaPipeline> continuation = null;
|
Continuation<MediaPipeline> continuation = null;
|
||||||
try {
|
try {
|
||||||
continuation = i.getArgument(0);
|
continuation = i.<Continuation<MediaPipeline>>getArgument(0);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.err.println("Error getting argument from stubbed method: " + e.getMessage());
|
System.err.println("Error getting argument from stubbed method: " + e.getMessage());
|
||||||
}
|
}
|
||||||
continuation.onSuccess(mock(MediaPipeline.class));
|
continuation.onSuccess(mock(MediaPipeline.class));
|
||||||
return null;
|
return null;
|
||||||
}).when(kClient).createMediaPipeline((Continuation<MediaPipeline>) any());
|
}).when(kClient).createMediaPipeline(Mockito.<Continuation<MediaPipeline>>any());
|
||||||
|
|
||||||
ServerManager serverManagerMock = mock(ServerManager.class);
|
ServerManager serverManagerMock = mock(ServerManager.class);
|
||||||
ServerInfo serverInfoMock = new ServerInfo("6.16.0", new ArrayList<>(), ServerType.KMS,
|
ServerInfo serverInfoMock = new ServerInfo("6.16.0", new ArrayList<>(), ServerType.KMS,
|
||||||
|
|
@ -85,7 +86,7 @@ public class IntegrationTestConfiguration {
|
||||||
successfullyConnectedKmss.add(kms);
|
successfullyConnectedKmss.add(kms);
|
||||||
}
|
}
|
||||||
return successfullyConnectedKmss;
|
return successfullyConnectedKmss;
|
||||||
}).when(spy).initializeKurentoClients(any(List.class), any(Boolean.class));
|
}).when(spy).initializeKurentoClients(anyList(), anyBoolean());
|
||||||
return spy;
|
return spy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue