Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.bigbluebutton.common.messages;
 public class UndoWhiteboardReplyMessage implements ISubscribedMessage {
	// the name of this event should be undo_whiteboard_reply (as it corresponds
	// to undo_whiteboard_request which entered bbb-apps)
	// However, on the clients we use undo_whiteboard_request for both request and reply
	// The only difference is shapeId here. Plus this message is on channel FROM_WHITEBOARD_CHANNEL
	public static final String UNDO_WHITEBOARD_REPLY = "undo_whiteboard_request";//see note above
	public static final String VERSION = "0.0.1";
	public final String meetingId;
	public final String whiteboardId;
	public final String requesterId;
	public final String shapeId;
	public UndoWhiteboardReplyMessage(String meetingIdString requesterIdString whiteboardIdString shapeId) {
		this. = meetingId;
		this. = whiteboardId;
		this. = requesterId;
		this. = shapeId;
	public String toJson() {
		HashMap<StringObjectpayload = new HashMap<StringObject>();
		java.util.HashMap<StringObjectheader = MessageBuilder.buildHeader(null);
		return MessageBuilder.buildJson(headerpayload);
	public static UndoWhiteboardReplyMessage fromJson(String message) {
		JsonParser parser = new JsonParser();
		JsonObject obj = (JsonObjectparser.parse(message);
		if (obj.has("header") && obj.has("payload")) {
			JsonObject header = (JsonObjectobj.get("header");
			JsonObject payload = (JsonObjectobj.get("payload");
			if (header.has("name")) {
				String messageName = header.get("name").getAsString();
				if (.equals(messageName)) {
					if (payload.has(.
							&& payload.has(.)
							&& payload.has(.)) {
						String meetingId = payload.get(.).getAsString();
						String whiteboardId = payload.get(.).getAsString();
						String shapeId = payload.get(.).getAsString();
						String requesterId = payload.get(.).getAsString();
						return new UndoWhiteboardReplyMessage(meetingIdrequesterIdwhiteboardIdshapeId);
		return null;
New to GrepCode? Check out our FAQ X