Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.bigbluebutton.common.messages;
 
 
 
 public class PresentationRemovedMessage implements ISubscribedMessage {
 	public static final String PRESENTATION_REMOVED = "presentation_removed_message";
	public final String VERSION = "0.0.1";
	public static final String PRESENTATION_ID = "presentation_id";
	public static final String MEETING_ID = "meeting_id";
	public final String meetingId;
	public final String presentationId;
	public PresentationRemovedMessage(String meetingIdString presentationId) {
		this. = meetingId;
		this. = presentationId;
	}
	public String toJson() {
		HashMap<StringObjectpayload = new HashMap<StringObject>();
		java.util.HashMap<StringObjectheader = MessageBuilder.buildHeader(null);
		return MessageBuilder.buildJson(headerpayload);				
	}
	public static PresentationRemovedMessage 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()) {
						String meetingId = payload.get().getAsString();
						String presentationId = payload.get().getAsString();
						return new 	PresentationRemovedMessage(meetingIdpresentationId);					
					}
				}
			}
		}
		return null;
	}
New to GrepCode? Check out our FAQ X