use of com.google.gson.JsonObject in project bigbluebutton by bigbluebutton.
the class GetCurrentLayoutRequestMessage method fromJson.
public static GetCurrentLayoutRequestMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (GET_CURRENT_LAYOUT_REQUEST.equals(messageName)) {
if (payload.has(Constants.MEETING_ID) && payload.has(Constants.USER_ID)) {
String id = payload.get(Constants.MEETING_ID).getAsString();
String userid = payload.get(Constants.USER_ID).getAsString();
return new GetCurrentLayoutRequestMessage(id, userid);
}
}
}
}
return null;
}
use of com.google.gson.JsonObject in project bigbluebutton by bigbluebutton.
the class GetPresentationInfoMessage method fromJson.
public static GetPresentationInfoMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (GET_PRESENTATION_INFO.equals(messageName)) {
if (payload.has(Constants.MEETING_ID) && payload.has(Constants.REQUESTER_ID) && payload.has(Constants.REPLY_TO)) {
String meetingId = payload.get(Constants.MEETING_ID).getAsString();
String requesterId = payload.get(Constants.REQUESTER_ID).getAsString();
String replyTo = payload.get(Constants.REPLY_TO).getAsString();
return new GetPresentationInfoMessage(meetingId, requesterId, replyTo);
}
}
}
}
return null;
}
use of com.google.gson.JsonObject in project bigbluebutton by bigbluebutton.
the class DeskShareRTMPBroadcastStartedEventMessage method fromJson.
public static DeskShareRTMPBroadcastStartedEventMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (DESKSHARE_RTMP_BROADCAST_STARTED_MESSAGE.equals(messageName)) {
if (payload.has(CONFERENCE_NAME) && payload.has(TIMESTAMP) && payload.has(VIDEO_HEIGHT) && payload.has(VIDEO_WIDTH) && payload.has(STREAMNAME)) {
String conferenceName = payload.get(CONFERENCE_NAME).getAsString();
String streamname = payload.get(STREAMNAME).getAsString();
String timestamp = payload.get(TIMESTAMP).getAsString();
int vh = payload.get(VIDEO_HEIGHT).getAsInt();
int vw = payload.get(VIDEO_WIDTH).getAsInt();
return new DeskShareRTMPBroadcastStartedEventMessage(conferenceName, streamname, vw, vh, timestamp);
}
}
}
}
return null;
}
use of com.google.gson.JsonObject in project bigbluebutton by bigbluebutton.
the class DeskShareRTMPBroadcastStoppedEventMessage method fromJson.
public static DeskShareRTMPBroadcastStoppedEventMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (DESKSHARE_RTMP_BROADCAST_STOPPED_MESSAGE.equals(messageName)) {
if (payload.has(CONFERENCE_NAME) && payload.has(TIMESTAMP) && payload.has(VIDEO_HEIGHT) && payload.has(VIDEO_WIDTH) && payload.has(STREAMNAME)) {
String conferenceName = payload.get(CONFERENCE_NAME).getAsString();
String streamname = payload.get(STREAMNAME).getAsString();
String timestamp = payload.get(TIMESTAMP).getAsString();
int vh = payload.get(VIDEO_HEIGHT).getAsInt();
int vw = payload.get(VIDEO_WIDTH).getAsInt();
return new DeskShareRTMPBroadcastStoppedEventMessage(conferenceName, streamname, vw, vh, timestamp);
}
}
}
}
return null;
}
use of com.google.gson.JsonObject in project bigbluebutton by bigbluebutton.
the class DeskShareStopRTMPBroadcastEventMessage method fromJson.
public static DeskShareStopRTMPBroadcastEventMessage fromJson(String message) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
JsonObject payload = (JsonObject) obj.get("payload");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (DESKSHARE_STOP_RTMP_BROADCAST_MESSAGE.equals(messageName)) {
if (payload.has(CONFERENCE_NAME) && payload.has(TIMESTAMP) && payload.has(STREAMURL)) {
String conferenceName = payload.get(CONFERENCE_NAME).getAsString();
String streamUrl = payload.get(STREAMURL).getAsString();
String timestamp = payload.get(TIMESTAMP).getAsString();
return new DeskShareStopRTMPBroadcastEventMessage(conferenceName, streamUrl, timestamp);
}
}
}
}
return null;
}
Aggregations