Skip to content

Commit

Permalink
- fix merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ritzalam committed Jun 2, 2015
1 parent 151d790 commit 1d177e6
Show file tree
Hide file tree
Showing 39 changed files with 118 additions and 4,272 deletions.
Expand Up @@ -103,4 +103,4 @@ public void getSlideInfo(String meetingID, String requesterID) {
String replyTo = meetingID + "/" + requesterID; String replyTo = meetingID + "/" + requesterID;
red5BBBInGW.getSlideInfo(meetingID, requesterID, replyTo); red5BBBInGW.getSlideInfo(meetingID, requesterID, replyTo);
} }
} }
Expand Up @@ -26,45 +26,34 @@
import org.red5.server.api.scope.IScope; import org.red5.server.api.scope.IScope;
import org.bigbluebutton.red5.BigBlueButtonSession; import org.bigbluebutton.red5.BigBlueButtonSession;
import org.bigbluebutton.red5.Constants; import org.bigbluebutton.red5.Constants;
import org.bigbluebutton.red5.api.IBigBlueButtonInGW;


public class PresentationService { public class PresentationService {
private static Logger log = Red5LoggerFactory.getLogger( PresentationService.class, "bigbluebutton" ); private static Logger log = Red5LoggerFactory.getLogger( PresentationService.class, "bigbluebutton" );


private IBigBlueButtonInGW bbbInGW; private PresentationApplication presentationApplication;

public void setBigBlueButtonInGW(IBigBlueButtonInGW inGW) {
bbbInGW = inGW;
}


public void removePresentation(Map<String, Object> msg) { public void removePresentation(Map<String, Object> msg) {
String presentationID = (String) msg.get("presentationID"); String presentationID = (String) msg.get("presentationID");


IScope scope = Red5.getConnectionLocal().getScope(); IScope scope = Red5.getConnectionLocal().getScope();
bbbInGW.removePresentation(scope.getName(), presentationID); presentationApplication.removePresentation(scope.getName(), presentationID);
} }


public void getSlideInfo() { public void getSlideInfo() {
IScope scope = Red5.getConnectionLocal().getScope(); IScope scope = Red5.getConnectionLocal().getScope();
String meetingID = scope.getName(); log.debug("Getting slide info for meeting [{}]", scope.getName());
String requesterID = getBbbSession().getInternalUserID(); presentationApplication.getSlideInfo(scope.getName(), getBbbSession().getInternalUserID());
// Just hardcode as we don't really need it for flash client. (ralam may 7, 2014)
String replyTo = meetingID + "/" + requesterID;
bbbInGW.getSlideInfo(meetingID, requesterID, replyTo);
} }


public void clear() { public void clear() {
IScope scope = Red5.getConnectionLocal().getScope(); IScope scope = Red5.getConnectionLocal().getScope();
bbbInGW.clear(scope.getName()); presentationApplication.clear(scope.getName());
} }


public void getPresentationInfo() { public void getPresentationInfo() {
IScope scope = Red5.getConnectionLocal().getScope(); IScope scope = Red5.getConnectionLocal().getScope();
String meetingID = scope.getName(); log.debug("Getting presentation info for meeting [{}]", scope.getName());
String requesterID = getBbbSession().getInternalUserID(); presentationApplication.getPresentationInfo(scope.getName(), getBbbSession().getInternalUserID());
// Just hardcode as we don't really need it for flash client. (ralam may 7, 2014)
String replyTo = meetingID + "/" + requesterID;
bbbInGW.getPresentationInfo(meetingID, requesterID, replyTo);
} }


public void gotoSlide(Map<String, Object> msg) { public void gotoSlide(Map<String, Object> msg) {
Expand All @@ -73,15 +62,15 @@ public void gotoSlide(Map<String, Object> msg) {
IScope scope = Red5.getConnectionLocal().getScope(); IScope scope = Red5.getConnectionLocal().getScope();
log.debug("Got GotoSlide for meeting [{}] page=[{}]", scope.getName(), pageId); log.debug("Got GotoSlide for meeting [{}] page=[{}]", scope.getName(), pageId);


bbbInGW.gotoSlide(scope.getName(), pageId); presentationApplication.gotoSlide(scope.getName(), pageId);
} }


public void sharePresentation(Map<String, Object> msg) { public void sharePresentation(Map<String, Object> msg) {
String presentationID = (String) msg.get("presentationID"); String presentationID = (String) msg.get("presentationID");
Boolean share = (Boolean) msg.get("share"); Boolean share = (Boolean) msg.get("share");


IScope scope = Red5.getConnectionLocal().getScope(); IScope scope = Red5.getConnectionLocal().getScope();
bbbInGW.sharePresentation(scope.getName(), presentationID, share); presentationApplication.sharePresentation(scope.getName(), presentationID, share);
} }


public void sendCursorUpdate(Map<String, Object> msg) { public void sendCursorUpdate(Map<String, Object> msg) {
Expand All @@ -104,7 +93,7 @@ public void sendCursorUpdate(Map<String, Object> msg) {
yPercent = (Double) msg.get("yPercent"); yPercent = (Double) msg.get("yPercent");
} }


bbbInGW.sendCursorUpdate(scope.getName(), xPercent, yPercent); presentationApplication.sendCursorUpdate(scope.getName(), xPercent, yPercent);
} }


public void resizeAndMoveSlide(Map<String, Object> msg) { public void resizeAndMoveSlide(Map<String, Object> msg) {
Expand Down Expand Up @@ -143,10 +132,14 @@ public void resizeAndMoveSlide(Map<String, Object> msg) {
} }


IScope scope = Red5.getConnectionLocal().getScope(); IScope scope = Red5.getConnectionLocal().getScope();
bbbInGW.resizeAndMoveSlide(scope.getName(), xOffset, yOffset, widthRatio, heightRatio); presentationApplication.resizeAndMoveSlide(scope.getName(), xOffset, yOffset, widthRatio, heightRatio);
}

public void setPresentationApplication(PresentationApplication a) {
presentationApplication = a;
} }


private BigBlueButtonSession getBbbSession() { private BigBlueButtonSession getBbbSession() {
return (BigBlueButtonSession) Red5.getConnectionLocal().getAttribute(Constants.SESSION); return (BigBlueButtonSession) Red5.getConnectionLocal().getAttribute(Constants.SESSION);
} }
} }
Expand Up @@ -118,4 +118,4 @@ public void setIsWhiteboardEnabled(String meetingID, String requesterID) {
red5BBBInGW.isWhiteboardEnabled(meetingID, requesterID, replyTo); red5BBBInGW.isWhiteboardEnabled(meetingID, requesterID, replyTo);
} }


} }
Expand Up @@ -19,27 +19,27 @@
package org.bigbluebutton.red5.service; package org.bigbluebutton.red5.service;


import java.util.Map; import java.util.Map;

import org.bigbluebutton.red5.BigBlueButtonSession; import org.bigbluebutton.red5.BigBlueButtonSession;
import org.bigbluebutton.red5.Constants; import org.bigbluebutton.red5.Constants;
import org.bigbluebutton.red5.api.IBigBlueButtonInGW;
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;


public class WhiteboardService { public class WhiteboardService {
private static Logger log = Red5LoggerFactory.getLogger(WhiteboardService.class, "bigbluebutton"); private static Logger log = Red5LoggerFactory.getLogger(WhiteboardService.class, "bigbluebutton");

private WhiteboardApplication application;
private final static String TYPE = "type";
private final static String STATUS = "status";
private final static String COR_ID = "id";
private final static String WB_ID = "whiteboardId";


private IBigBlueButtonInGW bbbInGW; private final static String TYPE = "type";

private final static String STATUS = "status";
public void setBigBlueButtonInGW(IBigBlueButtonInGW inGW) { private final static String COR_ID = "id";
bbbInGW = inGW; private final static String WB_ID = "whiteboardId";

public void setWhiteboardApplication(WhiteboardApplication a){
log.debug("Setting whiteboard application instance");
this.application = a;
} }

private boolean validMessage(Map<String, Object> shp) { private boolean validMessage(Map<String, Object> shp) {
if (shp.containsKey(COR_ID) && shp.containsKey(TYPE) && if (shp.containsKey(COR_ID) && shp.containsKey(TYPE) &&
shp.containsKey(STATUS) && shp.containsKey(WB_ID)) return true; shp.containsKey(STATUS) && shp.containsKey(WB_ID)) return true;
Expand All @@ -64,7 +64,7 @@ public void sendAnnotation(Map<String, Object> annotation) {
String requesterID = getBbbSession().getInternalUserID(); String requesterID = getBbbSession().getInternalUserID();


if (validMessage(annotation)) { if (validMessage(annotation)) {
bbbInGW.sendWhiteboardAnnotation(meetingID, requesterID, annotation); application.sendWhiteboardAnnotation(meetingID, requesterID, annotation);
} }
} }


Expand All @@ -86,11 +86,9 @@ public void requestAnnotationHistory(Map<String, Object> message) {


String meetingID = getMeetingId(); String meetingID = getMeetingId();
String requesterID = getBbbSession().getInternalUserID(); String requesterID = getBbbSession().getInternalUserID();
String whiteboardId = (String) message.get(WB_ID); String wbId = (String) message.get(WB_ID);
if (whiteboardId != null) { if (wbId != null) {
// Just hardcode as we don't really need it for flash client. (ralam may 7, 2014) application.requestAnnotationHistory(meetingID, requesterID, wbId);
String replyTo = meetingID + "/" + requesterID;
bbbInGW.requestWhiteboardAnnotationHistory(meetingID, requesterID, whiteboardId, replyTo);
} }
} }


Expand All @@ -101,7 +99,7 @@ public void clear(Map<String, Object> message) {
String requesterID = getBbbSession().getInternalUserID(); String requesterID = getBbbSession().getInternalUserID();
String wbId = (String) message.get(WB_ID); String wbId = (String) message.get(WB_ID);
if (wbId != null) { if (wbId != null) {
bbbInGW.clearWhiteboard(meetingID, requesterID, wbId); application.clearWhiteboard(meetingID, requesterID, wbId);
} }
} }


Expand All @@ -112,7 +110,7 @@ public void undo(Map<String, Object> message) {
String requesterID = getBbbSession().getInternalUserID(); String requesterID = getBbbSession().getInternalUserID();
String wbId = (String) message.get(WB_ID); String wbId = (String) message.get(WB_ID);
if (wbId != null) { if (wbId != null) {
bbbInGW.undoWhiteboard(meetingID, requesterID, wbId); application.undoWhiteboard(meetingID, requesterID, wbId);
} }
} }


Expand All @@ -127,16 +125,14 @@ public void enableWhiteboard(Map<String, Object> message) {
String meetingID = getMeetingId(); String meetingID = getMeetingId();
String requesterID = getBbbSession().getInternalUserID(); String requesterID = getBbbSession().getInternalUserID();
Boolean enable = (Boolean)message.get("enabled"); Boolean enable = (Boolean)message.get("enabled");
bbbInGW.enableWhiteboard(meetingID, requesterID, enable);
application.setWhiteboardEnable(meetingID, requesterID, enable);
} }


public void isWhiteboardEnabled() { public void isWhiteboardEnabled() {
String meetingID = getMeetingId(); String meetingID = getMeetingId();
String requesterID = getBbbSession().getInternalUserID(); String requesterID = getBbbSession().getInternalUserID();
// Just hardcode as we don't really need it for flash client. (ralam may 7, 2014) application.setIsWhiteboardEnabled(meetingID, requesterID);
String replyTo = meetingID + "/" + requesterID;
bbbInGW.isWhiteboardEnabled(meetingID, requesterID, replyTo);

} }


private BigBlueButtonSession getBbbSession() { private BigBlueButtonSession getBbbSession() {
Expand All @@ -147,4 +143,4 @@ private String getMeetingId(){
return Red5.getConnectionLocal().getScope().getName(); return Red5.getConnectionLocal().getScope().getName();
} }


} }
101 changes: 50 additions & 51 deletions bigbluebutton-apps/src/main/webapp/WEB-INF/red5-web.xml
Expand Up @@ -19,45 +19,45 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
--> -->
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:lang="http://www.springframework.org/schema/lang" xmlns:lang="http://www.springframework.org/schema/lang"
xsi:schemaLocation=" xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang
http://www.springframework.org/schema/lang/spring-lang-2.0.xsd"> http://www.springframework.org/schema/lang/spring-lang-2.0.xsd">


<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations"> <property name="locations">
<list> <list>
<value>/WEB-INF/red5-web.properties</value> <value>/WEB-INF/red5-web.properties</value>
<value>/WEB-INF/bigbluebutton.properties</value> <value>/WEB-INF/bigbluebutton.properties</value>
</list> </list>
</property> </property>
</bean> </bean>


<bean id="web.context" class="org.red5.server.Context" autowire="byType" /> <bean id="web.context" class="org.red5.server.Context" autowire="byType" />


<bean id="web.scope" class="org.red5.server.scope.WebScope" <bean id="web.scope" class="org.red5.server.scope.WebScope"
init-method="register"> init-method="register">
<property name="server" ref="red5.server" /> <property name="server" ref="red5.server" />
<property name="parent" ref="global.scope" /> <property name="parent" ref="global.scope" />
<property name="context" ref="web.context" /> <property name="context" ref="web.context" />
<property name="handler" ref="web.handler" /> <property name="handler" ref="web.handler" />
<property name="contextPath" value="${webapp.contextPath}" /> <property name="contextPath" value="${webapp.contextPath}" />
<property name="virtualHosts" value="${webapp.virtualHosts}" /> <property name="virtualHosts" value="${webapp.virtualHosts}" />
</bean> </bean>


<bean id="web.handler" class="org.bigbluebutton.red5.BigBlueButtonApplication"> <bean id="web.handler" class="org.bigbluebutton.red5.BigBlueButtonApplication">
<property name="applicationListeners"> <property name="applicationListeners">
<set> <ref bean="whiteboardApplication" /> </set> <set> <ref bean="whiteboardApplication" /> </set>
</property> </property>
<property name="connInvokerService"><ref bean="connInvokerService"/></property> <property name="connInvokerService"><ref bean="connInvokerService"/></property>
<property name="red5InGW"> <ref bean="red5BbbInGW"/> </property> <property name="red5InGW"> <ref bean="red5BbbInGW"/> </property>
</bean> </bean>

<bean id="connInvokerService" class="org.bigbluebutton.red5.client.messaging.ConnectionInvokerService" <bean id="connInvokerService" class="org.bigbluebutton.red5.client.messaging.ConnectionInvokerService"
init-method="start" destroy-method="stop"/> init-method="start" destroy-method="stop"/>


<bean id="layout.service" class="org.bigbluebutton.red5.service.LayoutService"> <bean id="layout.service" class="org.bigbluebutton.red5.service.LayoutService">
<property name="bigBlueButtonInGW"> <ref bean="red5BbbInGW"/></property> <property name="bigBlueButtonInGW"> <ref bean="red5BbbInGW"/></property>
Expand Down Expand Up @@ -95,15 +95,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<property name="red5InGW" ref="red5BbbInGW"/> <property name="red5InGW" ref="red5BbbInGW"/>
</bean> </bean>


<bean id="red5BbbInGW" class="org.bigbluebutton.core.api.Red5BBBInGw"> <bean id="red5BbbInGW" class="org.bigbluebutton.core.api.Red5BBBInGw">
<property name="messageSender" ref="red5RedisSender"/> <property name="messageSender" ref="red5RedisSender"/>
</bean> </bean>


<bean id="redisPubSubMessageHandler" class="org.bigbluebutton.red5.pubsub.redis.RedisPubSubMessageHandler"> <bean id="redisPubSubMessageHandler" class="org.bigbluebutton.red5.pubsub.redis.RedisPubSubMessageHandler">
<property name="connectionInvokerService"> <ref bean="connInvokerService"/></property> <property name="connectionInvokerService"> <ref bean="connInvokerService"/></property>
</bean> </bean>


<import resource="bbb-redis-pool.xml"/> <import resource="bbb-redis-pool.xml"/>
<import resource="bbb-red5-redis-pubsub.xml"/> <import resource="bbb-red5-redis-pubsub.xml"/>

</beans>
</beans>
@@ -1,9 +1,9 @@
package org.bigbluebutton.core.apps.whiteboard package org.bigbluebutton.core.apps.whiteboard


import org.bigbluebutton.core.api._ import org.bigbluebutton.core.api._
import org.bigbluebutton.conference.service.whiteboard.WhiteboardKeyUtil
import org.bigbluebutton.core.MeetingActor import org.bigbluebutton.core.MeetingActor
import org.bigbluebutton.core.apps.whiteboard.vo._ import org.bigbluebutton.core.apps.whiteboard.vo._
import org.bigbluebutton.core.service.whiteboard.WhiteboardKeyUtil


case class Whiteboard(id: String, shapes: Seq[AnnotationVO]) case class Whiteboard(id: String, shapes: Seq[AnnotationVO])


Expand Down
@@ -1,7 +1,6 @@
package org.bigbluebutton.core.pubsub.senders package org.bigbluebutton.core.pubsub.senders


import scala.collection.mutable.HashMap import scala.collection.mutable.HashMap
import org.bigbluebutton.conference.service.chat.ChatKeyUtil
import org.bigbluebutton.core.api._ import org.bigbluebutton.core.api._
import com.google.gson.Gson import com.google.gson.Gson
import scala.collection.mutable.HashMap import scala.collection.mutable.HashMap
Expand All @@ -10,6 +9,7 @@ import scala.collection.JavaConversions._
import java.util.ArrayList import java.util.ArrayList
import org.bigbluebutton.common.messages.MessagingConstants import org.bigbluebutton.common.messages.MessagingConstants
import org.bigbluebutton.core.messaging.Util import org.bigbluebutton.core.messaging.Util
import org.bigbluebutton.core.service.chat.ChatKeyUtil


object ChatMessageToJsonConverter { object ChatMessageToJsonConverter {


Expand Down
Expand Up @@ -2,11 +2,9 @@ package org.bigbluebutton.core.pubsub.senders


import org.bigbluebutton.core.api._ import org.bigbluebutton.core.api._
import scala.collection.JavaConversions._ import scala.collection.JavaConversions._
import org.bigbluebutton.conference.service.whiteboard.WhiteboardKeyUtil
import scala.collection.immutable.StringOps import scala.collection.immutable.StringOps
import org.bigbluebutton.core.MessageSender import org.bigbluebutton.core.MessageSender
import org.bigbluebutton.common.messages.MessagingConstants import org.bigbluebutton.common.messages.MessagingConstants

import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;


Expand Down
@@ -1,9 +1,9 @@
package org.bigbluebutton.core.recorders package org.bigbluebutton.core.recorders


import org.bigbluebutton.conference.service.recorder.RecorderApplication
import org.bigbluebutton.core.api._ import org.bigbluebutton.core.api._
import org.bigbluebutton.conference.service.recorder.chat.PublicChatRecordEvent
import scala.collection.JavaConversions._ import scala.collection.JavaConversions._
import org.bigbluebutton.core.service.recorder.RecorderApplication
import org.bigbluebutton.core.service.recorder.chat.PublicChatRecordEvent


class ChatEventRedisRecorder(recorder: RecorderApplication) extends OutMessageListener2 { class ChatEventRedisRecorder(recorder: RecorderApplication) extends OutMessageListener2 {


Expand Down

0 comments on commit 1d177e6

Please sign in to comment.