Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.bigbluebutton.common.messages;
 
 
 
 
 public class BroadcastLayoutRequestMessage implements ISubscribedMessage {
	public static final String BROADCAST_LAYOUT_REQUEST  = "broadcast_layout_request_message";
	public static final String VERSION = "0.0.1";
	public final static String LAYOUT = "layout";
	public final String meetingId;
	public final String userId;
	public final String layout;
	public BroadcastLayoutRequestMessage(String meetingIdString userIdString layout) {
		this. = meetingId;
		this. = userId;
		this. = layout;
	}
	public String toJson() {
		HashMap<StringObjectpayload = new HashMap<StringObject>();
		payload.put();
		java.util.HashMap<StringObjectheader = MessageBuilder.buildHeader(null);
		return MessageBuilder.buildJson(headerpayload);				
	}
	public static BroadcastLayoutRequestMessage 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 userid = payload.get(.).getAsString();
						String layout = payload.get().getAsString();
						return new BroadcastLayoutRequestMessage(iduseridlayout);					
					}
			}
		}
		return null;
	}
New to GrepCode? Check out our FAQ X