Skip to content

Commit

Permalink
Added EndAllBreakoutRoomsRequest broadcast from client to bigbluebutt…
Browse files Browse the repository at this point in the history
…on-apps.
  • Loading branch information
GhaziTriki committed Nov 12, 2015
1 parent 2914e91 commit 8b1f0d4
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 7 deletions.
@@ -0,0 +1,41 @@
/**
* 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/>.
*
*/
package org.bigbluebutton.messages;

import org.bigbluebutton.common.messages.IBigBlueButtonMessage;
import org.bigbluebutton.messages.payload.EndAllBreakoutRoomsRequestPayload;

import com.google.gson.Gson;

public class EndAllBreakoutRoomsRequest implements IBigBlueButtonMessage {
public final static String NAME = "EndAllBreakoutRoomsRequest";

public final Header header;
public final EndAllBreakoutRoomsRequestPayload payload;

public EndAllBreakoutRoomsRequest(EndAllBreakoutRoomsRequestPayload payload) {
this.header = new Header(NAME);
this.payload = payload;
}

public String toJson() {
Gson gson = new Gson();
return gson.toJson(this);
}
}
@@ -0,0 +1,27 @@
/**
* 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/>.
*
*/
package org.bigbluebutton.messages.payload;

public class EndAllBreakoutRoomsRequestPayload {
public final String meetingId;

public EndAllBreakoutRoomsRequestPayload(String meetingId) {
this.meetingId = meetingId;
}
}
Expand Up @@ -4,7 +4,9 @@

import org.bigbluebutton.common.messages.*;
import org.bigbluebutton.messages.CreateBreakoutRoomsRequest;
import org.bigbluebutton.messages.EndAllBreakoutRoomsRequest;
import org.bigbluebutton.messages.payload.CreateBreakoutRoomsRequestPayload;
import org.bigbluebutton.messages.payload.EndAllBreakoutRoomsRequestPayload;
import org.bigbluebutton.red5.pubsub.redis.MessageSender;

public class MessagePublisher {
Expand Down Expand Up @@ -271,9 +273,14 @@ public void lockLayout(String meetingID, String setById, boolean lock, boolean v
LockLayoutRequestMessage msg = new LockLayoutRequestMessage(meetingID, setById, lock, viewersOnly, layout);
sender.send(MessagingConstants.TO_USERS_CHANNEL, msg.toJson());
}

public void createBreakoutRooms(CreateBreakoutRoomsRequestPayload playload) {
CreateBreakoutRoomsRequest msg = new CreateBreakoutRoomsRequest(playload);

public void createBreakoutRooms(CreateBreakoutRoomsRequestPayload payload) {
CreateBreakoutRoomsRequest msg = new CreateBreakoutRoomsRequest(payload);
sender.send(MessagingConstants.TO_USERS_CHANNEL, msg.toJson());
}

public void endAllBreakoutRooms(EndAllBreakoutRoomsRequestPayload payload){
EndAllBreakoutRoomsRequest msg = new EndAllBreakoutRoomsRequest(payload);
sender.send(MessagingConstants.TO_USERS_CHANNEL, msg.toJson());
}
}
Expand Up @@ -23,6 +23,7 @@

import org.bigbluebutton.messages.payload.BreakoutRoomRequestPayload;
import org.bigbluebutton.messages.payload.CreateBreakoutRoomsRequestPayload;
import org.bigbluebutton.messages.payload.EndAllBreakoutRoomsRequestPayload;
import org.bigbluebutton.red5.pubsub.MessagePublisher;
import org.red5.logging.Red5LoggerFactory;
import org.red5.server.api.Red5;
Expand All @@ -47,8 +48,17 @@ public void createBreakoutRooms(Map<String, Object> msg) {
ArrayList<BreakoutRoomRequestPayload> breakoutRooms = (ArrayList<BreakoutRoomRequestPayload>) msg
.get("rooms");

CreateBreakoutRoomsRequestPayload playload = new CreateBreakoutRoomsRequestPayload(
CreateBreakoutRoomsRequestPayload payload = new CreateBreakoutRoomsRequestPayload(
meetingId, breakoutRooms, duration);
red5GW.createBreakoutRooms(playload);
red5GW.createBreakoutRooms(payload);
}

public void endAllBreakoutRooms(Map<String, Object> msg) {
IScope scope = Red5.getConnectionLocal().getScope();
String meetingId = (String) msg.get("meetingId");

EndAllBreakoutRoomsRequestPayload payload = new EndAllBreakoutRoomsRequestPayload(
meetingId);
red5GW.endAllBreakoutRooms(payload);
}
}
Expand Up @@ -27,6 +27,8 @@ package org.bigbluebutton.main.events {

public static const REQUEST_BREAKOUT_JOIN_URL:String = "REQUEST_BREAKOUT_JOIN_URL";

public static const END_ALL_BREAKOUT_ROOMS:String = "END_ALL_BREAKOUT_ROOMS";

public var meetingId:String;

public var breakoutId:String;
Expand Down
Expand Up @@ -212,7 +212,7 @@ package org.bigbluebutton.main.model.users
}

public function endAllBreakoutRooms(e:BreakoutRoomEvent):void{
// TODO
sender.endAllBreakoutRooms(_conferenceParameters.meetingID);
}

public function kickUser(e:KickUserEvent):void{
Expand Down
Expand Up @@ -72,6 +72,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<MethodInvoker generator="{UserService}" method="requestBreakoutJoinUrl" arguments="{event}" />
</EventHandlers>

<EventHandlers type="{BreakoutRoomEvent.END_ALL_BREAKOUT_ROOMS}" >
<MethodInvoker generator="{UserService}" method="endAllBreakoutRooms" arguments="{event}" />
</EventHandlers>

<!-- Viewers Stuff -->
<EventHandlers type="{EmojiStatusEvent.EMOJI_STATUS}" >
<MethodInvoker generator="{UserService}" method="emojiStatus" arguments="{event}" />
Expand Down
Expand Up @@ -20,6 +20,9 @@ package org.bigbluebutton.modules.users.services
{
import com.asfusion.mate.events.Dispatcher;

import flash.net.URLRequest;
import flash.net.navigateToURL;

import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.BBB;
Expand Down Expand Up @@ -590,6 +593,7 @@ package org.bigbluebutton.modules.users.services
private function handleBreakoutRoomJoinURL(msg:Object):void{
var map:Object = JSON.parse(msg.msg);
// TODO : BreakoutRoom : display Join button to the user
navigateToURL(new URLRequest(map.joinURL));
}

private function handleUpdateBreakoutUsers(msg:Object):void{
Expand Down
Expand Up @@ -120,6 +120,22 @@ package org.bigbluebutton.modules.users.services
message
);
}

public function endAllBreakoutRooms(meetingId:String):void{
var message:Object = new Object();
message["meetingId"] = meetingId;

var _nc:ConnectionManager = BBB.initConnectionManager();
_nc.sendMessage("breakoutroom.endAllBreakoutRooms", function(result:String):void
{
// On successful result
}, function(status:String):void
{ // status - On error occurred
LOGGER.error(status);
},
message
);
}

public function addStream(userID:String, streamName:String):void {
var _nc:ConnectionManager = BBB.initConnectionManager();
Expand Down
Expand Up @@ -439,6 +439,10 @@
}
}
private function endAllBreakoutRoomsHandler(event:MouseEvent):void{
dispatcher.dispatchEvent(new BreakoutRoomEvent(BreakoutRoomEvent.END_ALL_BREAKOUT_ROOMS));
}
private function focusWindow(e:ShortcutEvent):void{
focusManager.setFocus(titleBarOverlay);
}
Expand Down Expand Up @@ -538,7 +542,9 @@
</mx:columns>
</mx:DataGrid>

<mx:Button id="closeRoomsBtn" label="{ResourceUtil.getInstance().getString('bbb.users.breakout.closeAllRooms')}" visible="false" includeInLayout="false"/>
<mx:Button id="closeRoomsBtn" label="{ResourceUtil.getInstance().getString('bbb.users.breakout.closeAllRooms')}"
click="endAllBreakoutRoomsHandler(event)"
visible="false" includeInLayout="false"/>

</mx:VBox>

Expand Down

0 comments on commit 8b1f0d4

Please sign in to comment.