use of com.google.gson.JsonObject in project bigbluebutton by bigbluebutton.
the class DeskShareStoppedEventMessage method fromJson.
public static DeskShareStoppedEventMessage 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 (DESK_SHARE_STOPPED_MESSAGE.equals(messageName)) {
if (payload.has(CONFERENCE_NAME) && payload.has(CALLER_ID) && payload.has(CALLER_ID_NAME)) {
String conferenceName = payload.get(CONFERENCE_NAME).getAsString();
String callerId = payload.get(CALLER_ID_NAME).getAsString();
String callerIdName = payload.get(CALLER_ID_NAME).getAsString();
return new DeskShareStoppedEventMessage(conferenceName, callerId, callerIdName);
}
}
}
}
return null;
}
use of com.google.gson.JsonObject in project bigbluebutton by bigbluebutton.
the class DisconnectAllUsersMessage method fromJson.
public static DisconnectAllUsersMessage 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 (DISCONNECT_All_USERS.equals(messageName)) {
if (payload.has(Constants.MEETING_ID)) {
String meetingId = payload.get(Constants.MEETING_ID).getAsString();
return new DisconnectAllUsersMessage(meetingId);
}
}
}
}
return null;
}
use of com.google.gson.JsonObject in project bigbluebutton by bigbluebutton.
the class ClearWhiteboardReplyMessage method fromJson.
public static ClearWhiteboardReplyMessage 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 (WHITEBOARD_CLEARED_MESSAGE.equals(messageName)) {
if (payload.has(Constants.MEETING_ID) && payload.has(Constants.WHITEBOARD_ID) && payload.has(Constants.REQUESTER_ID)) {
String meetingId = payload.get(Constants.MEETING_ID).getAsString();
String whiteboardId = payload.get(Constants.WHITEBOARD_ID).getAsString();
String requesterId = payload.get(Constants.REQUESTER_ID).getAsString();
return new ClearWhiteboardReplyMessage(meetingId, requesterId, whiteboardId);
}
}
}
}
return null;
}
use of com.google.gson.JsonObject in project bigbluebutton by bigbluebutton.
the class ClearWhiteboardRequestMessage method fromJson.
public static ClearWhiteboardRequestMessage 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 (CLEAR_WHITEBOARD_REQUEST.equals(messageName)) {
if (payload.has(Constants.MEETING_ID) && payload.has(Constants.WHITEBOARD_ID) && payload.has(Constants.REQUESTER_ID)) {
String meetingId = payload.get(Constants.MEETING_ID).getAsString();
String whiteboardId = payload.get(Constants.WHITEBOARD_ID).getAsString();
String requesterId = payload.get(Constants.REQUESTER_ID).getAsString();
return new ClearWhiteboardRequestMessage(meetingId, requesterId, whiteboardId);
}
}
}
}
return null;
}
use of com.google.gson.JsonObject in project bigbluebutton by bigbluebutton.
the class CreatePollRequestMessage method fromJson.
public static CreatePollRequestMessage 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 (CREATE_POLL_REQUEST.equals(messageName)) {
if (payload.has(Constants.MEETING_ID) && payload.has(REQUESTER_ID) && payload.has(POLL_ID) && payload.has(POLL_TYPE)) {
String id = payload.get(Constants.MEETING_ID).getAsString();
String requesterId = payload.get(REQUESTER_ID).getAsString();
String pollId = payload.get(POLL_ID).getAsString();
String pollType = payload.get(POLL_TYPE).getAsString();
return new CreatePollRequestMessage(id, requesterId, pollId, pollType);
}
}
}
}
return null;
}
Aggregations