mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: "participantId" to "connectionId"
parent
8de0f838fd
commit
b60466f8ee
|
@ -8,15 +8,15 @@ import com.google.gson.JsonObject;
|
|||
public class CDREventFilterEvent extends CDREvent {
|
||||
|
||||
private GenericMediaEvent event;
|
||||
private String participantId;
|
||||
private String connectionId;
|
||||
private String streamId;
|
||||
private String filterType;
|
||||
|
||||
public CDREventFilterEvent(String sessionId, String participantId, String streamId, String filterType,
|
||||
public CDREventFilterEvent(String sessionId, String connectionId, String streamId, String filterType,
|
||||
GenericMediaEvent event) {
|
||||
super(CDREventName.filterEventDispatched, sessionId, Long.parseLong(event.getTimestampMillis()));
|
||||
this.event = event;
|
||||
this.participantId = participantId;
|
||||
this.connectionId = connectionId;
|
||||
this.streamId = streamId;
|
||||
this.filterType = filterType;
|
||||
}
|
||||
|
@ -32,7 +32,9 @@ public class CDREventFilterEvent extends CDREvent {
|
|||
@Override
|
||||
public JsonObject toJson() {
|
||||
JsonObject json = super.toJson();
|
||||
json.addProperty("participantId", this.participantId);
|
||||
// TODO: remove deprecated "participantId" when possible
|
||||
json.addProperty("participantId", this.connectionId);
|
||||
json.addProperty("connectionId", this.connectionId);
|
||||
json.addProperty("streamId", this.streamId);
|
||||
json.addProperty("filterType", this.filterType);
|
||||
json.addProperty("eventType", this.event.getType());
|
||||
|
|
|
@ -41,7 +41,9 @@ public class CDREventParticipant extends CDREventEnd {
|
|||
@Override
|
||||
public JsonObject toJson() {
|
||||
JsonObject json = super.toJson();
|
||||
// TODO: remove deprecated "participantId" when possible
|
||||
json.addProperty("participantId", this.participant.getParticipantPublicId());
|
||||
json.addProperty("connectionId", this.participant.getParticipantPublicId());
|
||||
json.addProperty("location",
|
||||
this.participant.getLocation() != null ? this.participant.getLocation().toString() : "unknown");
|
||||
json.addProperty("platform", this.participant.getPlatform());
|
||||
|
|
|
@ -58,7 +58,9 @@ public class CDREventWebrtcConnection extends CDREventEnd implements Comparable<
|
|||
public JsonObject toJson() {
|
||||
JsonObject json = super.toJson();
|
||||
json.addProperty("streamId", this.streamId);
|
||||
// TODO: remove deprecated "participantId" when possible
|
||||
json.addProperty("participantId", this.participant.getParticipantPublicId());
|
||||
json.addProperty("connectionId", this.participant.getParticipantPublicId());
|
||||
if (this.receivingFrom != null) {
|
||||
json.addProperty("connection", "INBOUND");
|
||||
json.addProperty("receivingFrom", this.receivingFrom);
|
||||
|
|
|
@ -180,9 +180,9 @@ public class CallDetailRecord {
|
|||
this.log(new CDREventRecordingStatus(recording, recording.getCreatedAt(), finalReason, timestamp, status));
|
||||
}
|
||||
|
||||
public void recordFilterEventDispatched(String sessionId, String participantId, String streamId, String filterType,
|
||||
public void recordFilterEventDispatched(String sessionId, String connectionId, String streamId, String filterType,
|
||||
GenericMediaEvent event) {
|
||||
this.log(new CDREventFilterEvent(sessionId, participantId, streamId, filterType, event));
|
||||
this.log(new CDREventFilterEvent(sessionId, connectionId, streamId, filterType, event));
|
||||
}
|
||||
|
||||
public void recordSignalSent(String sessionId, String from, String[] to, String type, String data) {
|
||||
|
|
|
@ -44,7 +44,7 @@ public class Participant {
|
|||
}
|
||||
|
||||
protected String finalUserId; // ID to match this connection with a final user (HttpSession id)
|
||||
protected String participantPrivatetId; // ID to identify the user on server (org.kurento.jsonrpc.Session.id)
|
||||
protected String participantPrivateId; // ID to identify the user on server (org.kurento.jsonrpc.Session.id)
|
||||
protected String participantPublicId; // ID to identify the user on clients
|
||||
protected String sessionId; // ID of the session to which the participant belongs
|
||||
protected ParticipantStatus status; // Status of the connection
|
||||
|
@ -75,11 +75,11 @@ public class Participant {
|
|||
*/
|
||||
public Lock singleRecordingLock = new ReentrantLock();
|
||||
|
||||
public Participant(String finalUserId, String participantPrivatetId, String participantPublicId, String sessionId,
|
||||
public Participant(String finalUserId, String participantPrivateId, String participantPublicId, String sessionId,
|
||||
Token token, String clientMetadata, GeoLocation location, String platform, EndpointType endpointType,
|
||||
Long activeAt) {
|
||||
this.finalUserId = finalUserId;
|
||||
this.participantPrivatetId = participantPrivatetId;
|
||||
this.participantPrivateId = participantPrivateId;
|
||||
this.participantPublicId = participantPublicId;
|
||||
this.sessionId = sessionId;
|
||||
this.status = ParticipantStatus.active;
|
||||
|
@ -102,11 +102,11 @@ public class Participant {
|
|||
}
|
||||
|
||||
public String getParticipantPrivateId() {
|
||||
return participantPrivatetId;
|
||||
return participantPrivateId;
|
||||
}
|
||||
|
||||
public void setParticipantPrivateId(String participantPrivateId) {
|
||||
this.participantPrivatetId = participantPrivateId;
|
||||
this.participantPrivateId = participantPrivateId;
|
||||
}
|
||||
|
||||
public String getParticipantPublicId() {
|
||||
|
@ -210,7 +210,7 @@ public class Participant {
|
|||
}
|
||||
|
||||
public boolean isIpcam() {
|
||||
return this.platform != null && this.platform.equals("IPCAM") && this.participantPrivatetId.startsWith(IdentifierPrefixes.IPCAM_ID);
|
||||
return this.platform != null && this.platform.equals("IPCAM") && this.participantPrivateId.startsWith(IdentifierPrefixes.IPCAM_ID);
|
||||
}
|
||||
|
||||
public String getPublisherStreamId() {
|
||||
|
@ -245,7 +245,7 @@ public class Participant {
|
|||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + (participantPrivatetId == null ? 0 : participantPrivatetId.hashCode());
|
||||
result = prime * result + (participantPrivateId == null ? 0 : participantPrivateId.hashCode());
|
||||
result = prime * result + (streaming ? 1231 : 1237);
|
||||
result = prime * result + (participantPublicId == null ? 0 : participantPublicId.hashCode());
|
||||
return result;
|
||||
|
@ -263,11 +263,11 @@ public class Participant {
|
|||
return false;
|
||||
}
|
||||
Participant other = (Participant) obj;
|
||||
if (participantPrivatetId == null) {
|
||||
if (other.participantPrivatetId != null) {
|
||||
if (participantPrivateId == null) {
|
||||
if (other.participantPrivateId != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!participantPrivatetId.equals(other.participantPrivatetId)) {
|
||||
} else if (!participantPrivateId.equals(other.participantPrivateId)) {
|
||||
return false;
|
||||
}
|
||||
if (streaming != other.streaming) {
|
||||
|
@ -287,8 +287,8 @@ public class Participant {
|
|||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("[");
|
||||
if (participantPrivatetId != null) {
|
||||
builder.append("participantPrivateId=").append(participantPrivatetId).append(", ");
|
||||
if (participantPrivateId != null) {
|
||||
builder.append("participantPrivateId=").append(participantPrivateId).append(", ");
|
||||
}
|
||||
if (participantPublicId != null) {
|
||||
builder.append("participantPublicId=").append(participantPublicId).append(", ");
|
||||
|
|
|
@ -358,12 +358,12 @@ public abstract class SessionManager {
|
|||
this.insecureUsers.put(participantPrivateId, true);
|
||||
}
|
||||
|
||||
public Participant newParticipant(String sessionId, String participantPrivatetId, Token token,
|
||||
public Participant newParticipant(String sessionId, String participantPrivateId, Token token,
|
||||
String clientMetadata, GeoLocation location, String platform, String finalUserId) {
|
||||
|
||||
if (this.sessionidParticipantpublicidParticipant.get(sessionId) != null) {
|
||||
|
||||
Participant p = new Participant(finalUserId, participantPrivatetId, token.getConnectionId(), sessionId,
|
||||
Participant p = new Participant(finalUserId, participantPrivateId, token.getConnectionId(), sessionId,
|
||||
token, clientMetadata, location, platform, EndpointType.WEBRTC_ENDPOINT, null);
|
||||
|
||||
this.sessionidParticipantpublicidParticipant.get(sessionId).put(p.getParticipantPublicId(), p);
|
||||
|
@ -381,10 +381,10 @@ public abstract class SessionManager {
|
|||
}
|
||||
}
|
||||
|
||||
public Participant newRecorderParticipant(String sessionId, String participantPrivatetId, Token token,
|
||||
public Participant newRecorderParticipant(String sessionId, String participantPrivateId, Token token,
|
||||
String clientMetadata) {
|
||||
if (this.sessionidParticipantpublicidParticipant.get(sessionId) != null) {
|
||||
Participant p = new Participant(null, participantPrivatetId, ProtocolElements.RECORDER_PARTICIPANT_PUBLICID,
|
||||
Participant p = new Participant(null, participantPrivateId, ProtocolElements.RECORDER_PARTICIPANT_PUBLICID,
|
||||
sessionId, token, clientMetadata, null, null, EndpointType.WEBRTC_ENDPOINT, null);
|
||||
this.sessionidParticipantpublicidParticipant.get(sessionId)
|
||||
.put(ProtocolElements.RECORDER_PARTICIPANT_PUBLICID, p);
|
||||
|
|
|
@ -164,8 +164,8 @@ public class KurentoSession extends Session {
|
|||
candidate);
|
||||
}
|
||||
|
||||
public void sendMediaError(String participantId, String description) {
|
||||
this.kurentoSessionHandler.onMediaElementError(sessionId, participantId, description);
|
||||
public void sendMediaError(String connectionId, String description) {
|
||||
this.kurentoSessionHandler.onMediaElementError(sessionId, connectionId, description);
|
||||
}
|
||||
|
||||
private void removeParticipant(Participant participant, EndReason reason) {
|
||||
|
|
|
@ -50,10 +50,10 @@ public class KurentoSessionEventsHandler extends SessionEventsHandler {
|
|||
}
|
||||
}
|
||||
|
||||
public void onMediaElementError(String roomName, String participantId, String description) {
|
||||
public void onMediaElementError(String roomName, String connectionId, String description) {
|
||||
JsonObject notifParams = new JsonObject();
|
||||
notifParams.addProperty(ProtocolElements.MEDIAERROR_ERROR_PARAM, description);
|
||||
rpcNotificationService.sendNotification(participantId, ProtocolElements.MEDIAERROR_METHOD, notifParams);
|
||||
rpcNotificationService.sendNotification(connectionId, ProtocolElements.MEDIAERROR_METHOD, notifParams);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ public class RpcHandler extends DefaultJsonRpcHandler<JsonObject> {
|
|||
String token = getStringParam(request, ProtocolElements.JOINROOM_TOKEN_PARAM);
|
||||
String secret = getStringParam(request, ProtocolElements.JOINROOM_SECRET_PARAM);
|
||||
String platform = getStringParam(request, ProtocolElements.JOINROOM_PLATFORM_PARAM);
|
||||
String participantPrivatetId = rpcConnection.getParticipantPrivateId();
|
||||
String participantPrivateId = rpcConnection.getParticipantPrivateId();
|
||||
|
||||
final io.openvidu.server.core.Session session = sessionManager.getSessionWithNotActive(sessionId);
|
||||
if (session == null) {
|
||||
|
@ -245,7 +245,7 @@ public class RpcHandler extends DefaultJsonRpcHandler<JsonObject> {
|
|||
boolean generateRecorderParticipant = false;
|
||||
|
||||
if (openviduConfig.isOpenViduSecret(secret)) {
|
||||
sessionManager.newInsecureParticipant(participantPrivatetId);
|
||||
sessionManager.newInsecureParticipant(participantPrivateId);
|
||||
token = IdentifierPrefixes.TOKEN_ID + RandomStringUtils.randomAlphabetic(1).toUpperCase()
|
||||
+ RandomStringUtils.randomAlphanumeric(15);
|
||||
try {
|
||||
|
@ -274,10 +274,10 @@ public class RpcHandler extends DefaultJsonRpcHandler<JsonObject> {
|
|||
}
|
||||
Participant participant;
|
||||
if (generateRecorderParticipant) {
|
||||
participant = sessionManager.newRecorderParticipant(sessionId, participantPrivatetId,
|
||||
participant = sessionManager.newRecorderParticipant(sessionId, participantPrivateId,
|
||||
tokenObj, clientMetadata);
|
||||
} else {
|
||||
participant = sessionManager.newParticipant(sessionId, participantPrivatetId, tokenObj,
|
||||
participant = sessionManager.newParticipant(sessionId, participantPrivateId, tokenObj,
|
||||
clientMetadata, location, platform,
|
||||
httpSession.getId().substring(0, Math.min(16, httpSession.getId().length())));
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ public class RpcHandler extends DefaultJsonRpcHandler<JsonObject> {
|
|||
} else {
|
||||
log.error(
|
||||
"ERROR: The session {} is in the process of closing while participant {} (privateId) was joining",
|
||||
sessionId, participantPrivatetId);
|
||||
sessionId, participantPrivateId);
|
||||
throw new OpenViduException(Code.ROOM_CLOSED_ERROR_CODE,
|
||||
"Unable to join the session. Session " + sessionId + " was in the process of closing");
|
||||
}
|
||||
|
|
|
@ -3333,7 +3333,7 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestAppE2eTest {
|
|||
event = CustomWebhook.waitForEvent("webrtcConnectionCreated", 2);
|
||||
Assert.assertEquals("Wrong number of properties in event 'webrtcConnectionCreated'", 10 + 1,
|
||||
event.keySet().size());
|
||||
String connectionId1 = event.get("participantId").getAsString();
|
||||
String connectionId1 = event.get("connectionId").getAsString();
|
||||
|
||||
event = CustomWebhook.waitForEvent("recordingStatusChanged", 10);
|
||||
Assert.assertEquals("Wrong number of properties in event 'recordingStatusChanged'", 11 + 1,
|
||||
|
@ -3380,7 +3380,7 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestAppE2eTest {
|
|||
CustomWebhook.waitForEvent("webrtcConnectionCreated", 2);
|
||||
CustomWebhook.waitForEvent("webrtcConnectionCreated", 2);
|
||||
|
||||
String connectionId2 = event.get("participantId").getAsString();
|
||||
String connectionId2 = event.get("connectionId").getAsString();
|
||||
|
||||
// signalSent from client
|
||||
long timestamp = System.currentTimeMillis();
|
||||
|
|
Loading…
Reference in New Issue