Server SDKs: Connection ip property

pull/648/head
pabloFuente 2021-08-10 18:04:44 +02:00
parent 2cba879541
commit 58c4d565f6
2 changed files with 19 additions and 0 deletions

View File

@ -37,6 +37,7 @@ public class Connection {
private Long createdAt;
private Long activeAt;
private String location;
private String ip;
private String platform;
private String clientData;
private ConnectionProperties connectionProperties;
@ -215,6 +216,13 @@ public class Connection {
return location;
}
/**
* Returns the IP of the connection, as seen by OpenVidu Server
*/
public String getIp() {
return ip;
}
/**
* Returns a complete description of the platform used by the participant to
* connect to the session
@ -262,6 +270,7 @@ public class Connection {
json.addProperty("createdAt", this.createdAt());
json.addProperty("activeAt", this.activeAt());
json.addProperty("location", this.getLocation());
json.addProperty("ip", this.getIp());
json.addProperty("platform", this.getPlatform());
json.addProperty("clientData", this.getClientData());
json.addProperty("token", this.getToken());
@ -383,6 +392,9 @@ public class Connection {
if (!json.get("location").isJsonNull()) {
this.location = json.get("location").getAsString();
}
if (!json.get("ip").isJsonNull()) {
this.ip = json.get("ip").getAsString();
}
if (!json.get("platform").isJsonNull()) {
this.platform = json.get("platform").getAsString();
}

View File

@ -59,6 +59,11 @@ export class Connection {
*/
location: string;
/**
* IP of the Connection, as seen by OpenVidu Server
*/
ip: string;
/**
* A complete description of the platform used by the participant to connect to the session
*/
@ -119,6 +124,7 @@ export class Connection {
this.createdAt = json.createdAt;
this.activeAt = json.activeAt;
this.location = json.location;
this.ip = json.ip;
this.platform = json.platform;
this.clientData = json.clientData;
this.token = json.token;
@ -220,6 +226,7 @@ export class Connection {
this.connectionProperties.networkCache === other.connectionProperties.networkCache &&
this.token === other.token &&
this.location === other.location &&
this.ip === other.ip &&
this.platform === other.platform &&
this.clientData === other.clientData &&
this.subscribers.length === other.subscribers.length &&