lock settings to redis

This commit is contained in:
Anton Georgiev 2015-05-22 16:12:01 -04:00
parent 40a45bb09d
commit a79c5f4122
15 changed files with 545 additions and 211 deletions

View File

@ -0,0 +1,48 @@
package org.bigbluebutton.conference.service.lock;
import org.bigbluebutton.conference.service.messaging.MessagingConstants;
import org.bigbluebutton.conference.service.messaging.GetLockSettings;
import org.bigbluebutton.conference.service.messaging.LockUser;
import org.bigbluebutton.conference.service.messaging.SendLockSettings;
import org.bigbluebutton.conference.service.messaging.redis.MessageHandler;
import org.bigbluebutton.core.api.IBigBlueButtonInGW;
import com.google.gson.JsonParser;
import com.google.gson.JsonObject;
public class LockMessageListener implements MessageHandler{
private IBigBlueButtonInGW bbbGW;
public void setBigBlueButtonInGW(IBigBlueButtonInGW bbbGW) {
this.bbbGW = bbbGW;
}
@Override
public void handleMessage(String pattern, String channel, String message) {
if (channel.equalsIgnoreCase(MessagingConstants.TO_MEETING_CHANNEL)) {
JsonParser parser = new JsonParser();
JsonObject obj = (JsonObject) parser.parse(message);
if (obj.has("header") && obj.has("payload")) {
JsonObject header = (JsonObject) obj.get("header");
if (header.has("name")) {
String messageName = header.get("name").getAsString();
if (GetLockSettings.GET_LOCK_SETTINGS.equals(messageName)) {
GetLockSettings msg = GetLockSettings.fromJson(message);
bbbGW.getLockSettings(msg.meetingId, msg.userId);
} else if(LockUser.LOCK_USER.equals(messageName)) {
LockUser msg = LockUser.fromJson(message);
bbbGW.lockUser(msg.meetingId, msg.requesterId, msg.lock, msg.internalUserId);
} else if(SendLockSettings.SEND_LOCK_SETTINGS.equals(messageName)) {
SendLockSettings msg = SendLockSettings.fromJson(message);
System.out.println("\n\n(("+message);
bbbGW.sendLockSettings(msg.meetingId, msg.userId, msg.newSettings);
}
}
}
}
}
}

View File

@ -23,7 +23,7 @@ import java.util.Map;
import org.bigbluebutton.conference.BigBlueButtonSession; import org.bigbluebutton.conference.BigBlueButtonSession;
import org.bigbluebutton.conference.Constants; import org.bigbluebutton.conference.Constants;
import org.bigbluebutton.core.api.IBigBlueButtonInGW; import org.bigbluebutton.core.api.Red5BBBInGw;
import org.red5.logging.Red5LoggerFactory; import org.red5.logging.Red5LoggerFactory;
import org.red5.server.api.Red5; import org.red5.server.api.Red5;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -31,7 +31,7 @@ import org.slf4j.Logger;
public class LockService { public class LockService {
private static Logger log = Red5LoggerFactory.getLogger( LockService.class, "bigbluebutton" ); private static Logger log = Red5LoggerFactory.getLogger( LockService.class, "bigbluebutton" );
private IBigBlueButtonInGW bbbInGW; private Red5BBBInGw red5BBBInGW;
/** /**
* Internal function used to get the session * Internal function used to get the session
@ -40,8 +40,8 @@ public class LockService {
return (BigBlueButtonSession) Red5.getConnectionLocal().getAttribute(Constants.SESSION); return (BigBlueButtonSession) Red5.getConnectionLocal().getAttribute(Constants.SESSION);
} }
public void setBigBlueButtonInGW(IBigBlueButtonInGW inGW) { public void setRed5BBBInGW(Red5BBBInGw inGW) {
bbbInGW = inGW; red5BBBInGW = inGW;
} }
/** /**
@ -50,7 +50,8 @@ public class LockService {
public void getLockSettings(){ public void getLockSettings(){
String meetingId = getBbbSession().getRoom(); String meetingId = getBbbSession().getRoom();
String userId = getMyUserId(); String userId = getMyUserId();
bbbInGW.getLockSettings(meetingId, userId);
red5BBBInGW.getLockSettings(meetingId, userId);
} }
/** /**
@ -64,7 +65,7 @@ public class LockService {
public void setLockSettings(Map<String, Boolean> newSettings){ public void setLockSettings(Map<String, Boolean> newSettings){
String meetingId = getBbbSession().getRoom(); String meetingId = getBbbSession().getRoom();
String userId = getMyUserId(); String userId = getMyUserId();
bbbInGW.sendLockSettings(meetingId, userId, newSettings); red5BBBInGW.sendLockSettings(meetingId, userId, newSettings);
} }
/** /**
@ -87,7 +88,7 @@ public class LockService {
String userId = (String) msg.get("userId"); String userId = (String) msg.get("userId");
log.info("setUserLock ({}, {})", new Object[] { lock, userId }); log.info("setUserLock ({}, {})", new Object[] { lock, userId });
bbbInGW.lockUser(meetingID, requesterID, lock, userId); red5BBBInGW.lockUser(meetingID, requesterID, lock, userId);
} }
public String getMyUserId() { public String getMyUserId() {

View File

@ -94,4 +94,11 @@ public class Constants {
public static final String CREATE_TIME = "create_time"; public static final String CREATE_TIME = "create_time";
public static final String CREATE_DATE = "create_date"; public static final String CREATE_DATE = "create_date";
public static final String PRESENTATION_BASE_URL = "presentation_base_url"; public static final String PRESENTATION_BASE_URL = "presentation_base_url";
public static final String DISABLE_CAMERA = "disable_camera";
public static final String LOCK_ON_JOIN_CONFIGURABLE = "lock_on_join_configurable";
public static final String DISABLE_MICROPHONE = "disable_microphone";
public static final String DISABLE_PRIVATE_CHAT = "disable_private_chat";
public static final String DISABLE_PUBLIC_CHAT = "disable_public_chat";
public static final String LOCK_ON_JOIN = "lock_on_join";
public static final String LOCKED_LAYOUT = "locked_layout";
} }

View File

@ -0,0 +1,54 @@
package org.bigbluebutton.conference.service.messaging;
import java.util.HashMap;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
public class GetLockSettings implements IMessage {
public static final String GET_LOCK_SETTINGS = "get_lock_settings";
public static final String VERSION = "0.0.1";
public final String meetingId;
public final String userId;
public GetLockSettings(String meetingId, String userId) {
this.meetingId = meetingId;
this.userId = userId;
}
public String toJson() {
HashMap<String, Object> payload = new HashMap<String, Object>();
payload.put(Constants.MEETING_ID, meetingId);
payload.put(Constants.USER_ID, userId);
System.out.println("GetLockSettings toJson");
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(GET_LOCK_SETTINGS, VERSION, null);
return MessageBuilder.buildJson(header, payload);
}
public static GetLockSettings 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_LOCK_SETTINGS.equals(messageName)) {
if (payload.has(Constants.MEETING_ID)
&& payload.has(Constants.USER_ID)) {
String meetingId = payload.get(Constants.MEETING_ID).getAsString();
String userId = payload.get(Constants.USER_ID).getAsString();
System.out.println("GetLockSettings fromJson");
return new GetLockSettings(meetingId, userId);
}
}
}
}
return null;
}
}

View File

@ -0,0 +1,65 @@
package org.bigbluebutton.conference.service.messaging;
import java.util.HashMap;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
public class LockUser implements IMessage {
public static final String LOCK_USER = "lock_user";
public static final String VERSION = "0.0.1";
public final String meetingId;
public final String requesterId;
public final boolean lock;
public final String internalUserId;
public LockUser(String meetingId, String requesterId, boolean lock, String internalUserId) {
this.meetingId = meetingId;
this.requesterId = requesterId;
this.lock = lock;
this.internalUserId = internalUserId;
}
public String toJson() {
HashMap<String, Object> payload = new HashMap<String, Object>();
payload.put(Constants.MEETING_ID, meetingId);
payload.put(Constants.REQUESTER_ID, requesterId);
payload.put(Constants.LOCK, lock);
payload.put(Constants.INTERNAL_USER_ID, internalUserId);
System.out.println("LockUser toJson");
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(LOCK_USER, VERSION, null);
return MessageBuilder.buildJson(header, payload);
}
public static LockUser 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 (LOCK_USER.equals(messageName)) {
if (payload.has(Constants.MEETING_ID)
&& payload.has(Constants.REQUESTER_ID)
&& payload.has(Constants.LOCK)
&& payload.has(Constants.INTERNAL_USER_ID)) {
String meetingId = payload.get(Constants.MEETING_ID).getAsString();
String requesterId = payload.get(Constants.REQUESTER_ID).getAsString();
boolean lock = payload.get(Constants.LOCK).getAsBoolean();
String internalUserId = payload.get(Constants.INTERNAL_USER_ID).getAsString();
System.out.println("LockUser fromJson");
return new LockUser(meetingId, requesterId, lock, internalUserId);
}
}
}
}
return null;
}
}

View File

@ -26,7 +26,7 @@ public class SendCursorUpdate implements IMessage {
payload.put(Constants.Y_PERCENT, yPercent); payload.put(Constants.Y_PERCENT, yPercent);
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(SEND_CURSOR_UPDATE, VERSION, null); java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(SEND_CURSOR_UPDATE, VERSION, null);
System.out.println("SendCursorUpdate toJson");
return MessageBuilder.buildJson(header, payload); return MessageBuilder.buildJson(header, payload);
} }
@ -48,7 +48,6 @@ public class SendCursorUpdate implements IMessage {
double xPercent = payload.get(Constants.X_PERCENT).getAsDouble(); double xPercent = payload.get(Constants.X_PERCENT).getAsDouble();
double yPercent = payload.get(Constants.Y_PERCENT).getAsDouble(); double yPercent = payload.get(Constants.Y_PERCENT).getAsDouble();
System.out.println("SendCursorUpdate fromJson");
return new SendCursorUpdate(meetingId, xPercent, yPercent); return new SendCursorUpdate(meetingId, xPercent, yPercent);
} }
} }

View File

@ -0,0 +1,120 @@
package org.bigbluebutton.conference.service.messaging;
import java.util.HashMap;
import java.util.Map;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
public class SendLockSettings implements IMessage {
public static final String SEND_LOCK_SETTINGS = "send_lock_settings";
public static final String VERSION = "0.0.1";
public final String meetingId;
public final String userId;
public final Map<String, Boolean> newSettings;
public SendLockSettings(String meetingId, String userId, Map<String, Boolean> newSettings) {
this.meetingId = meetingId;
this.userId = userId;
this.newSettings = newSettings;
}
public String toJson() {
HashMap<String, Object> payload = new HashMap<String, Object>();
Map<String, Boolean> settingsMap = new HashMap<String, Boolean>();
settingsMap.put(Constants.DISABLE_CAMERA, newSettings.get("disableCam"));
settingsMap.put(Constants.DISABLE_MICROPHONE, newSettings.get("disableMic"));
settingsMap.put(Constants.DISABLE_PRIVATE_CHAT, newSettings.get("disablePrivateChat"));
settingsMap.put(Constants.DISABLE_PUBLIC_CHAT, newSettings.get("disablePublicChat"));
settingsMap.put(Constants.LOCKED_LAYOUT, newSettings.get("lockedLayout"));
settingsMap.put(Constants.LOCK_ON_JOIN, newSettings.get("lockOnJoin"));
settingsMap.put(Constants.LOCK_ON_JOIN_CONFIGURABLE, newSettings.get("lockOnJoinConfigurable"));
// System.out.println("\n\n" + newSettings.toString() + "\n\n");
// settingsMap.put(Constants.DISABLE_CAMERA, newSettings.get(Constants.DISABLE_CAMERA));
// settingsMap.put(Constants.DISABLE_MICROPHONE, newSettings.get(Constants.DISABLE_MICROPHONE));
// settingsMap.put(Constants.DISABLE_PRIVATE_CHAT, newSettings.get(Constants.DISABLE_PRIVATE_CHAT));
// settingsMap.put(Constants.DISABLE_PUBLIC_CHAT, newSettings.get(Constants.DISABLE_PUBLIC_CHAT));
// settingsMap.put(Constants.LOCKED_LAYOUT, newSettings.get(Constants.LOCKED_LAYOUT));
// settingsMap.put(Constants.LOCK_ON_JOIN, newSettings.get(Constants.LOCK_ON_JOIN));
// settingsMap.put(Constants.LOCK_ON_JOIN_CONFIGURABLE, newSettings.get(Constants.LOCK_ON_JOIN_CONFIGURABLE));
payload.put(Constants.MEETING_ID, meetingId);
payload.put(Constants.USER_ID, userId);
payload.put(Constants.SETTINGS, settingsMap);
System.out.println("SendLockSettings toJson");
java.util.HashMap<String, Object> header = MessageBuilder.buildHeader(SEND_LOCK_SETTINGS, VERSION, null);
return MessageBuilder.buildJson(header, payload);
}
public static SendLockSettings 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 (SEND_LOCK_SETTINGS.equals(messageName)) {
if (payload.has(Constants.MEETING_ID)
&& payload.has(Constants.USER_ID)
&& payload.has(Constants.SETTINGS)) {
JsonObject settingsObj = (JsonObject) payload.get(Constants.SETTINGS).getAsJsonObject();
if (settingsObj.has(Constants.DISABLE_CAMERA)
&& settingsObj.has(Constants.DISABLE_CAMERA)
&& settingsObj.has(Constants.DISABLE_MICROPHONE)
&& settingsObj.has(Constants.DISABLE_PRIVATE_CHAT)
&& settingsObj.has(Constants.DISABLE_PUBLIC_CHAT)
&& settingsObj.has(Constants.LOCKED_LAYOUT)
&& settingsObj.has(Constants.LOCK_ON_JOIN)
&& settingsObj.has(Constants.LOCK_ON_JOIN_CONFIGURABLE)) {
Map<String, Boolean> settingsMap = new HashMap<String, Boolean>();
// settingsMap.put(Constants.DISABLE_CAMERA, settingsObj.get(Constants.DISABLE_CAMERA).getAsBoolean());
// settingsMap.put(Constants.DISABLE_MICROPHONE, settingsObj.get(Constants.DISABLE_MICROPHONE).getAsBoolean());
// settingsMap.put(Constants.DISABLE_PRIVATE_CHAT, settingsObj.get(Constants.DISABLE_PRIVATE_CHAT).getAsBoolean());
// settingsMap.put(Constants.DISABLE_PUBLIC_CHAT, settingsObj.get(Constants.DISABLE_PUBLIC_CHAT).getAsBoolean());
// settingsMap.put(Constants.LOCKED_LAYOUT, settingsObj.get(Constants.LOCKED_LAYOUT).getAsBoolean());
// settingsMap.put(Constants.LOCK_ON_JOIN, settingsObj.get(Constants.LOCK_ON_JOIN).getAsBoolean());
// settingsMap.put(Constants.LOCK_ON_JOIN_CONFIGURABLE, settingsObj.get(Constants.LOCK_ON_JOIN_CONFIGURABLE).getAsBoolean());
// settingsMap.put("disableCam", settingsObj.get(Constants.DISABLE_CAMERA).getAsBoolean());
// settingsMap.put("disableMic", settingsObj.get(Constants.DISABLE_MICROPHONE).getAsBoolean());
// settingsMap.put("disablePrivateChat", settingsObj.get(Constants.DISABLE_PRIVATE_CHAT).getAsBoolean());
// settingsMap.put("disablePublicChat", settingsObj.get(Constants.DISABLE_PUBLIC_CHAT).getAsBoolean());
// settingsMap.put("lockedLayout", settingsObj.get(Constants.LOCKED_LAYOUT).getAsBoolean());
// settingsMap.put("lockOnJoin", settingsObj.get(Constants.LOCK_ON_JOIN).getAsBoolean());
// settingsMap.put("lockOnJoinConfigurable", settingsObj.get(Constants.LOCK_ON_JOIN_CONFIGURABLE).getAsBoolean());
System.out.println("AAAAAAAAAAAA:"+settingsObj.toString());
settingsMap.put("disableCam", settingsObj.get(Constants.DISABLE_CAMERA).getAsBoolean());
settingsMap.put("disableMic", settingsObj.get(Constants.DISABLE_MICROPHONE).getAsBoolean());
settingsMap.put("disablePrivateChat", settingsObj.get(Constants.DISABLE_PRIVATE_CHAT).getAsBoolean());
settingsMap.put("disablePublicChat", settingsObj.get(Constants.DISABLE_PUBLIC_CHAT).getAsBoolean());
settingsMap.put("lockedLayout", settingsObj.get(Constants.LOCKED_LAYOUT).getAsBoolean());
settingsMap.put("lockOnJoin", settingsObj.get(Constants.LOCK_ON_JOIN).getAsBoolean());
settingsMap.put("lockOnJoinConfigurable", settingsObj.get(Constants.LOCK_ON_JOIN_CONFIGURABLE).getAsBoolean());
String meetingId = payload.get(Constants.MEETING_ID).getAsString();
String userId = payload.get(Constants.USER_ID).getAsString();
System.out.println("SendLockSettings fromJson");
return new SendLockSettings(meetingId, userId, settingsMap);
}
}
}
}
}
return null;
}
}

View File

@ -36,7 +36,7 @@ public class PresentationApplication {
public void sendConversionUpdate(String messageKey, String meetingId, public void sendConversionUpdate(String messageKey, String meetingId,
String code, String presentationId, String presName) { String code, String presentationId, String presName) {
System.out.println("-----sendConversionUpdate---");
red5BBBInGW.sendConversionUpdate(messageKey, meetingId, code, red5BBBInGW.sendConversionUpdate(messageKey, meetingId, code,
presentationId, presName); presentationId, presName);
} }
@ -44,7 +44,7 @@ public class PresentationApplication {
public void sendPageCountError(String messageKey, String meetingId, public void sendPageCountError(String messageKey, String meetingId,
String code, String presentationId, int numberOfPages, String code, String presentationId, int numberOfPages,
int maxNumberPages, String presName) { int maxNumberPages, String presName) {
System.out.println("-----sendPageCountError---");
red5BBBInGW.sendPageCountError(messageKey, meetingId, code, red5BBBInGW.sendPageCountError(messageKey, meetingId, code,
presentationId, numberOfPages, maxNumberPages, presName); presentationId, numberOfPages, maxNumberPages, presName);
} }
@ -52,7 +52,7 @@ public class PresentationApplication {
public void sendSlideGenerated(String messageKey, String meetingId, public void sendSlideGenerated(String messageKey, String meetingId,
String code, String presentationId, int numberOfPages, String code, String presentationId, int numberOfPages,
int pagesCompleted, String presName) { int pagesCompleted, String presName) {
System.out.println("-----sendSlideGenerated---");
red5BBBInGW.sendSlideGenerated(messageKey, meetingId, code, red5BBBInGW.sendSlideGenerated(messageKey, meetingId, code,
presentationId, numberOfPages, pagesCompleted, presName); presentationId, numberOfPages, pagesCompleted, presName);
} }
@ -60,46 +60,46 @@ public class PresentationApplication {
public void sendConversionCompleted(String messageKey, String meetingId, public void sendConversionCompleted(String messageKey, String meetingId,
String code, String presentation, int numberOfPages, String code, String presentation, int numberOfPages,
String presName, String presBaseUrl) { String presName, String presBaseUrl) {
System.out.println("-----sendConversionCompleted---");
red5BBBInGW.sendConversionCompleted(messageKey, meetingId, red5BBBInGW.sendConversionCompleted(messageKey, meetingId,
code, presentation, numberOfPages, presName, presBaseUrl); code, presentation, numberOfPages, presName, presBaseUrl);
} }
public void removePresentation(String meetingID, String presentationID){ public void removePresentation(String meetingID, String presentationID){
System.out.println("----removePresentation----");
red5BBBInGW.removePresentation(meetingID, presentationID); red5BBBInGW.removePresentation(meetingID, presentationID);
} }
public void getPresentationInfo(String meetingID, String requesterID) { public void getPresentationInfo(String meetingID, String requesterID) {
// Just hardcode as we don't really need it for flash client. (ralam may 7, 2014) // Just hardcode as we don't really need it for flash client. (ralam may 7, 2014)
String replyTo = meetingID + "/" + requesterID; String replyTo = meetingID + "/" + requesterID;
System.out.println("----getPresentationInfo----");
red5BBBInGW.getPresentationInfo(meetingID, requesterID, replyTo); red5BBBInGW.getPresentationInfo(meetingID, requesterID, replyTo);
} }
public void sendCursorUpdate(String meetingID, Double xPercent, Double yPercent) { public void sendCursorUpdate(String meetingID, Double xPercent, Double yPercent) {
System.out.println("----sendCursorUpdate----");
red5BBBInGW.sendCursorUpdate(meetingID, xPercent, yPercent); red5BBBInGW.sendCursorUpdate(meetingID, xPercent, yPercent);
} }
public void resizeAndMoveSlide(String meetingID, Double xOffset, Double yOffset, Double widthRatio, Double heightRatio) { public void resizeAndMoveSlide(String meetingID, Double xOffset, Double yOffset, Double widthRatio, Double heightRatio) {
System.out.println("-----resizeAndMoveSlide---");
red5BBBInGW.resizeAndMoveSlide(meetingID, xOffset, yOffset, widthRatio, heightRatio); red5BBBInGW.resizeAndMoveSlide(meetingID, xOffset, yOffset, widthRatio, heightRatio);
} }
public void gotoSlide(String meetingID, String pageId){ public void gotoSlide(String meetingID, String pageId){
System.out.println("----gotoSlide----");
red5BBBInGW.gotoSlide(meetingID, pageId); red5BBBInGW.gotoSlide(meetingID, pageId);
} }
public void sharePresentation(String meetingID, String presentationID, Boolean share){ public void sharePresentation(String meetingID, String presentationID, Boolean share){
System.out.println("-----sharePresentation---");
red5BBBInGW.sharePresentation(meetingID, presentationID, share); red5BBBInGW.sharePresentation(meetingID, presentationID, share);
} }
public void getSlideInfo(String meetingID, String requesterID) { public void getSlideInfo(String meetingID, String requesterID) {
// Just hardcode as we don't really need it for flash client. (ralam may 7, 2014) // Just hardcode as we don't really need it for flash client. (ralam may 7, 2014)
System.out.println("----getSlideInfo----");
String replyTo = meetingID + "/" + requesterID; String replyTo = meetingID + "/" + requesterID;
red5BBBInGW.getSlideInfo(meetingID, requesterID, replyTo); red5BBBInGW.getSlideInfo(meetingID, requesterID, replyTo);
} }

View File

@ -139,7 +139,6 @@ public class PresentationMessageListener implements MessageHandler {
bbbInGW.removePresentation(msg.meetingId, msg.presentationId); bbbInGW.removePresentation(msg.meetingId, msg.presentationId);
} else if (SendCursorUpdate.SEND_CURSOR_UPDATE.equals(messageName)) { } else if (SendCursorUpdate.SEND_CURSOR_UPDATE.equals(messageName)) {
System.out.println("in messageHandler - sendCursorUpdate");
SendCursorUpdate msg = SendCursorUpdate.fromJson(message); SendCursorUpdate msg = SendCursorUpdate.fromJson(message);
bbbInGW.sendCursorUpdate(msg.meetingId, msg.xPercent, msg.yPercent); bbbInGW.sendCursorUpdate(msg.meetingId, msg.xPercent, msg.yPercent);

View File

@ -18,6 +18,9 @@ import org.bigbluebutton.conference.service.messaging.SharePresentation;
import org.bigbluebutton.conference.service.messaging.SendPrivateChatMessage; import org.bigbluebutton.conference.service.messaging.SendPrivateChatMessage;
import org.bigbluebutton.conference.service.messaging.SendPublicChatMessage; import org.bigbluebutton.conference.service.messaging.SendPublicChatMessage;
import org.bigbluebutton.conference.service.messaging.GetChatHistory; import org.bigbluebutton.conference.service.messaging.GetChatHistory;
import org.bigbluebutton.conference.service.messaging.GetLockSettings;
import org.bigbluebutton.conference.service.messaging.LockUser;
import org.bigbluebutton.conference.service.messaging.SendLockSettings;
import org.bigbluebutton.conference.service.messaging.redis.MessageSender; import org.bigbluebutton.conference.service.messaging.redis.MessageSender;
import com.google.gson.Gson; import com.google.gson.Gson;
@ -93,21 +96,27 @@ public class Red5BBBInGw implements IBigBlueButtonInGW {
@Override @Override
public void sendLockSettings(String meetingID, String userId, public void sendLockSettings(String meetingID, String userId,
Map<String, Boolean> settings) { Map<String, Boolean> settings) {
// TODO Auto-generated method stub SendLockSettings msg = new SendLockSettings(meetingID, userId, settings);
System.out.println("~~~sendLockSettings in Red5BBBInGw");
sender.send(MessagingConstants.TO_MEETING_CHANNEL, msg.toJson());
} }
@Override @Override
public void getLockSettings(String meetingId, String userId) { public void getLockSettings(String meetingId, String userId) {
// TODO Auto-generated method stub GetLockSettings msg = new GetLockSettings(meetingId, userId);
System.out.println("~~~GetLockSettings in Red5BBBInGw");
sender.send(MessagingConstants.TO_MEETING_CHANNEL, msg.toJson());
} }
@Override @Override
public void lockUser(String meetingId, String requesterID, boolean lock, public void lockUser(String meetingId, String requesterID, boolean lock,
String internalUserID) { String internalUserID) {
// TODO Auto-generated method stub LockUser msg = new LockUser(meetingId, requesterID, lock, internalUserID);
System.out.println("~~~LockUser in Red5BBBInGw");
sender.send(MessagingConstants.TO_MEETING_CHANNEL, msg.toJson());
} }
@Override @Override
@ -335,7 +344,7 @@ public class Red5BBBInGw implements IBigBlueButtonInGW {
double yPercent) { double yPercent) {
SendCursorUpdate msg = new SendCursorUpdate(meetingID, SendCursorUpdate msg = new SendCursorUpdate(meetingID,
xPercent, yPercent); xPercent, yPercent);
System.out.println("~~SendCursorUpdate in Red5BBBInGw");
sender.send(MessagingConstants.TO_PRESENTATION_CHANNEL, msg.toJson()); sender.send(MessagingConstants.TO_PRESENTATION_CHANNEL, msg.toJson());
} }

View File

@ -85,7 +85,7 @@ object UsersMessageToJsonConverter {
payload.put("disablePubChat", msg.permissions.disablePubChat) payload.put("disablePubChat", msg.permissions.disablePubChat)
payload.put("lockedLayout", msg.permissions.lockedLayout) payload.put("lockedLayout", msg.permissions.lockedLayout)
payload.put("lockOnJoin", msg.permissions.lockOnJoin) payload.put("lockOnJoin", msg.permissions.lockOnJoin)
payload.put("lockOnJoinConfigurable", msg.permissions.lockOnJoin) payload.put("lockOnJoinConfigurable", msg.permissions.lockOnJoinConfigurable)
val users = new java.util.ArrayList[java.util.Map[String, Any]] val users = new java.util.ArrayList[java.util.Map[String, Any]]
msg.applyTo.foreach(uvo => { msg.applyTo.foreach(uvo => {

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
Copyright (c) 2015 BigBlueButton Inc. and by respective authors (see below).
This program is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 3.0 of the License, or (at your option) any later
version.
BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.0.xsd
">
<bean id="lock.service" class="org.bigbluebutton.conference.service.lock.LockService">
<property name="red5BBBInGW"><ref bean="red5BbbInGW"/></property>
</bean>
<bean id="lockMessageListener" class="org.bigbluebutton.conference.service.lock.LockMessageListener">
<property name="bigBlueButtonInGW"> <ref bean="bbbInGW"/></property>
</bean>
</beans>

View File

@ -54,6 +54,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<ref bean="participantsListener" /> <ref bean="participantsListener" />
<ref bean="voiceMessageListener" /> <ref bean="voiceMessageListener" />
<ref bean="whiteboardListener" /> <ref bean="whiteboardListener" />
<ref bean="lockMessageListener" />
<ref bean="redisPubSubMessageHandler" /> <ref bean="redisPubSubMessageHandler" />
</set> </set>
</property> </property>

View File

@ -3,7 +3,7 @@
BigBlueButton open source conferencing system - http://www.bigbluebutton.org/ BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
Copyright (c) 2014 BigBlueButton Inc. and by respective authors (see below). Copyright (c) 2015 BigBlueButton Inc. and by respective authors (see below).
This program is free software; you can redistribute it and/or modify it under the This program is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software terms of the GNU Lesser General Public License as published by the Free Software
@ -72,10 +72,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<bean id="connInvokerService" class="org.bigbluebutton.conference.meeting.messaging.red5.ConnectionInvokerService" <bean id="connInvokerService" class="org.bigbluebutton.conference.meeting.messaging.red5.ConnectionInvokerService"
init-method="start" destroy-method="stop"/> init-method="start" destroy-method="stop"/>
<bean id="lock.service" class="org.bigbluebutton.conference.service.lock.LockService">
<property name="bigBlueButtonInGW"> <ref bean="bbbInGW"/></property>
</bean>
<bean id="bbbInGW" class="org.bigbluebutton.core.BigBlueButtonInGW"> <bean id="bbbInGW" class="org.bigbluebutton.core.BigBlueButtonInGW">
<constructor-arg index="0" ref="bbbGW"/> <constructor-arg index="0" ref="bbbGW"/>
<constructor-arg index="1" ref="preuploadedPresentationsUtil"/> <constructor-arg index="1" ref="preuploadedPresentationsUtil"/>
@ -212,21 +208,19 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
</bean> </bean>
<import resource="bbb-redis-pool.xml"/> <import resource="bbb-redis-pool.xml"/>
<import resource="bbb-redis-recorder.xml"/> <import resource="bbb-redis-recorder.xml"/>
<import resource="bbb-app-lock.xml" />
<import resource="bbb-app-chat.xml" /> <import resource="bbb-app-chat.xml" />
<import resource="bbb-app-layout.xml" /> <import resource="bbb-app-layout.xml" />
<import resource="bbb-app-poll.xml" /> <import resource="bbb-app-poll.xml" />
<import resource="bbb-app-presentation.xml" /> <import resource="bbb-app-presentation.xml" />
<import resource="bbb-app-whiteboard.xml" /> <import resource="bbb-app-whiteboard.xml" />
<import resource="bbb-app-users.xml" /> <import resource="bbb-app-users.xml" />
<import resource="bbb-voice-app.xml" /> <import resource="bbb-voice-app.xml" />
<import resource="bbb-voice-freeswitch.xml" /> <import resource="bbb-voice-freeswitch.xml" />
<import resource="bbb-redis-messaging.xml"/> <import resource="bbb-redis-messaging.xml"/>
<!-- <!--
<import resource="spring/applicationContext-redis.xml"/> <import resource="spring/applicationContext-redis.xml"/>
--> -->
</beans> </beans>