- get it to start

This commit is contained in:
Richard Alam 2013-06-11 21:55:38 +00:00
parent 5e173b931b
commit ecff26dbb1
8 changed files with 28 additions and 139 deletions

View File

@ -1,8 +1,6 @@
package org.bigbluebutton.conference.service.participants.messaging.redis; package org.bigbluebutton.conference.service.participants.messaging.redis;
import java.util.HashMap; import java.util.HashMap;
import org.bigbluebutton.conference.User;
import org.bigbluebutton.conference.meeting.messaging.OutMessage; import org.bigbluebutton.conference.meeting.messaging.OutMessage;
import org.bigbluebutton.conference.meeting.messaging.OutMessageListener; import org.bigbluebutton.conference.meeting.messaging.OutMessageListener;
import org.bigbluebutton.conference.service.messaging.MessagingConstants; import org.bigbluebutton.conference.service.messaging.MessagingConstants;

View File

@ -1,111 +0,0 @@
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2012 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.conference.service.presentation;
import org.slf4j.Logger;
import org.apache.commons.lang.StringEscapeUtils;
import org.red5.logging.Red5LoggerFactory;
import java.util.HashMap;
import java.util.Map;
public class ConversionUpdatesMessageListener {
private static Logger log = Red5LoggerFactory.getLogger(ConversionUpdatesMessageListener.class, "bigbluebutton");
private ConversionUpdatesProcessor conversionUpdatesProcessor;
public static final String OFFICE_DOC_CONVERSION_SUCCESS_KEY = "OFFICE_DOC_CONVERSION_SUCCESS";
public static final String OFFICE_DOC_CONVERSION_FAILED_KEY = "OFFICE_DOC_CONVERSION_FAILED";
public static final String SUPPORTED_DOCUMENT_KEY = "SUPPORTED_DOCUMENT";
public static final String UNSUPPORTED_DOCUMENT_KEY = "UNSUPPORTED_DOCUMENT";
public static final String PAGE_COUNT_FAILED_KEY = "PAGE_COUNT_FAILED";
public static final String PAGE_COUNT_EXCEEDED_KEY = "PAGE_COUNT_EXCEEDED";
public static final String GENERATED_SLIDE_KEY = "GENERATED_SLIDE";
public static final String GENERATING_THUMBNAIL_KEY = "GENERATING_THUMBNAIL";
public static final String GENERATED_THUMBNAIL_KEY = "GENERATED_THUMBNAIL";
public static final String CONVERSION_COMPLETED_KEY = "CONVERSION_COMPLETED";
public void start() {
log.debug("Starting conversion updates receiver.");
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public void handleReceivedMessage(Map mapMessage) {
try{
String code = (String) mapMessage.get("returnCode");
String room = (String) mapMessage.get("room");
String presentationName = (String) mapMessage.get("presentationName");
String conference = (String) mapMessage.get("conference");
String messageKey = (String) mapMessage.get("messageKey");
Map message = new HashMap();
message.put("conference", conference);
message.put("room", room);
message.put("code", code);
message.put("presentationName", presentationName);
message.put("messageKey", messageKey);
log.debug("Message: " + messageKey + "[ " + presentationName + "]");
if(messageKey.equalsIgnoreCase(OFFICE_DOC_CONVERSION_SUCCESS_KEY)||
messageKey.equalsIgnoreCase(OFFICE_DOC_CONVERSION_FAILED_KEY)||
messageKey.equalsIgnoreCase(SUPPORTED_DOCUMENT_KEY)||
messageKey.equalsIgnoreCase(UNSUPPORTED_DOCUMENT_KEY)||
messageKey.equalsIgnoreCase(GENERATING_THUMBNAIL_KEY)||
messageKey.equalsIgnoreCase(GENERATED_THUMBNAIL_KEY)||
messageKey.equalsIgnoreCase(PAGE_COUNT_FAILED_KEY)){
conversionUpdatesProcessor.process(message);
}
else if(messageKey.equalsIgnoreCase(PAGE_COUNT_EXCEEDED_KEY)){
Integer numberOfPages = new Integer((String) mapMessage.get("numberOfPages"));
Integer maxNumberPages = new Integer((String) mapMessage.get("maxNumberPages"));
message.put("numberOfPages", numberOfPages);
message.put("maxNumberPages", maxNumberPages);
conversionUpdatesProcessor.process(message);
}
else if(messageKey.equalsIgnoreCase(GENERATED_SLIDE_KEY)){
Integer numberOfPages = new Integer((String)mapMessage.get("numberOfPages"));
Integer pagesCompleted = new Integer((String)mapMessage.get("pagesCompleted"));
message.put("numberOfPages", numberOfPages);
message.put("pagesCompleted", pagesCompleted);
conversionUpdatesProcessor.process(message);
}
else if(messageKey.equalsIgnoreCase(CONVERSION_COMPLETED_KEY)){
String slidesInfo = (String) mapMessage.get("slidesInfo");
message.put("slidesInfo", StringEscapeUtils.unescapeXml(slidesInfo));
conversionUpdatesProcessor.process(message);
}
else{
log.error("Cannot handle recieved message.");
}
}catch(Exception ex){
log.warn(ex.getMessage());
}
}
public void stop() {
log.debug("Stopping conversion updates receiver.");
}
public void setConversionUpdatesProcessor(ConversionUpdatesProcessor p) {
log.debug("Setting ConversionUpdatesProcessor");
conversionUpdatesProcessor = p;
}
}

View File

@ -41,7 +41,6 @@ public class PresentationHandler extends ApplicationAdapter implements IApplicat
private RecorderApplication recorderApplication; private RecorderApplication recorderApplication;
private PresentationApplication presentationApplication; private PresentationApplication presentationApplication;
private ConversionUpdatesMessageListener conversionUpdatesMessageListener;
@Override @Override
public boolean appConnect(IConnection conn, Object[] params) { public boolean appConnect(IConnection conn, Object[] params) {
@ -68,14 +67,12 @@ public class PresentationHandler extends ApplicationAdapter implements IApplicat
@Override @Override
public boolean appStart(IScope scope) { public boolean appStart(IScope scope) {
log.debug("***** " + APP + " [ " + " appStart [ " + scope.getName() + "] *********"); log.debug("***** " + APP + " [ " + " appStart [ " + scope.getName() + "] *********");
conversionUpdatesMessageListener.start();
return true; return true;
} }
@Override @Override
public void appStop(IScope scope) { public void appStop(IScope scope) {
log.debug("***** " + APP + " [ " + " appStop [ " + scope.getName() + "] *********"); log.debug("***** " + APP + " [ " + " appStop [ " + scope.getName() + "] *********");
conversionUpdatesMessageListener.stop();
} }
@Override @Override
@ -156,9 +153,4 @@ public class PresentationHandler extends ApplicationAdapter implements IApplicat
recorderApplication = a; recorderApplication = a;
} }
public void setConversionUpdatesMessageListener(ConversionUpdatesMessageListener service) {
log.debug("Setting conversionUpdatesMessageListener");
conversionUpdatesMessageListener = service;
}
} }

View File

@ -37,9 +37,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<property name="recorderApplication"> <property name="recorderApplication">
<ref bean="recorderApplication"/> <ref bean="recorderApplication"/>
</property> </property>
<property name="conversionUpdatesMessageListener">
<ref local="conversionUpdatesMessageListener" />
</property>
</bean> </bean>
<bean id="presentationApplication" class="org.bigbluebutton.conference.service.presentation.PresentationApplication"> <bean id="presentationApplication" class="org.bigbluebutton.conference.service.presentation.PresentationApplication">
@ -56,7 +53,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<property name="presentationApplication"> <ref local="presentationApplication"/></property> <property name="presentationApplication"> <ref local="presentationApplication"/></property>
</bean> </bean>
<bean id="conversionUpdatesMessageListener" class="org.bigbluebutton.conference.service.presentation.ConversionUpdatesMessageListener"> <bean id="presentationMessageListener" class="org.bigbluebutton.conference.service.presentation.PresentationMessageListener">
<property name="conversionUpdatesProcessor" ref="conversionUpdatesProcessor" /> <property name="conversionUpdatesProcessor" ref="conversionUpdatesProcessor" />
</bean> </bean>

View File

@ -28,8 +28,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
"> ">
<bean id="roomsManager" class="org.bigbluebutton.conference.MeetingsManager"> <bean id="roomsManager" class="org.bigbluebutton.conference.MeetingsManager">
<property name="messagingService"> <ref bean="messagingService"/></property> <property name="outMessageGateway"> <ref bean="outMessageGateway"/></property>
<property name="conversionUpdatesMessageListener" ref="conversionUpdatesMessageListener"></property>
</bean> </bean>
<bean id="bigbluebutton.service" class="org.bigbluebutton.conference.BigBlueButtonService"> <bean id="bigbluebutton.service" class="org.bigbluebutton.conference.BigBlueButtonService">
@ -43,7 +42,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<bean id="participantsApplication" class="org.bigbluebutton.conference.service.participants.ParticipantsApplication"> <bean id="participantsApplication" class="org.bigbluebutton.conference.service.participants.ParticipantsApplication">
<property name="roomsManager"> <ref local="roomsManager"/></property> <property name="roomsManager"> <ref local="roomsManager"/></property>
<property name="connInvokerService"> <ref bean="connInvokerService"/></property>
</bean> </bean>
<bean id="participants.service" class="org.bigbluebutton.conference.service.participants.ParticipantsService"> <bean id="participants.service" class="org.bigbluebutton.conference.service.participants.ParticipantsService">

View File

@ -28,20 +28,18 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
"> ">
<bean id="whiteboardApplication" class="org.bigbluebutton.conference.service.whiteboard.WhiteboardApplication"> <bean id="whiteboardApplication" class="org.bigbluebutton.conference.service.whiteboard.WhiteboardApplication">
<property name="recorderApplication"> <ref local="recorderApplication"/></property> <property name="whiteboardRecordingService"> <ref local="whiteboardRecordingService"/></property>
<property name="clientSender"> <ref bean="connInvokerService"/></property> <property name="clientMessageSender"> <ref local="whiteboardClientSender"/></property>
</bean> </bean>
<bean id="whiteboardClientSender" class="org.bigbluebutton.conference.service.whiteboard.ClientMessageSender"> <bean id="whiteboardClientSender" class="org.bigbluebutton.conference.service.whiteboard.red5.ClientMessageSender">
<property name="vonnectionInvokerService"> <ref local="connInvokerService"/></property> <property name="connectionInvokerService"> <ref bean="connInvokerService"/></property>
</bean> </bean>
<bean id="whiteboard.service" class="org.bigbluebutton.conference.service.whiteboard.WhiteboardService"> <bean id="whiteboard.service" class="org.bigbluebutton.conference.service.whiteboard.WhiteboardService">
<property name="whiteboardApplication"> <ref local="whiteboardApplication"/></property> <property name="whiteboardApplication"> <ref local="whiteboardApplication"/></property>
</bean> </bean>
<bean id="whiteboardRoomManager" class="org.bigbluebutton.conference.service.whiteboard.WhiteboardRoomManager"/>
<bean id="whiteboardRecordingService" class="org.bigbluebutton.conference.service.whiteboard.WhiteboardRecordingService"> <bean id="whiteboardRecordingService" class="org.bigbluebutton.conference.service.whiteboard.WhiteboardRecordingService">
<property name="recorderApplication"> <ref bean="recorderApplication"/></property> <property name="recorderApplication"> <ref bean="recorderApplication"/></property>
</bean> </bean>

View File

@ -34,13 +34,13 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<bean id="redisMessageReceiver" class="org.bigbluebutton.conference.service.messaging.redis.MessageReceiver"> <bean id="redisMessageReceiver" class="org.bigbluebutton.conference.service.messaging.redis.MessageReceiver">
<property name="redisPool"> <ref bean="redisPool"/></property> <property name="redisPool"> <ref bean="redisPool"/></property>
<property name="redisMessageHandler"> <ref local="redisMessageHandler"/> </property> <property name="messageHandler"> <ref local="redisMessageHandler"/> </property>
</bean> </bean>
<bean id="redisMessageHandler" class="org.bigbluebutton.conference.service.messaging.ReceivedMessageHandler"/> <bean id="redisMessageHandler" class="org.bigbluebutton.conference.service.messaging.redis.ReceivedMessageHandler"/>
<bean id="redisMessageDistributor" class="org.bigbluebutton.conference.service.messaging.MessageDistributor"> <bean id="redisMessageDistributor" class="org.bigbluebutton.conference.service.messaging.redis.MessageDistributor">
<property name="redisMessageHandler"> <ref local="redisMessageHandler"/> </property> <property name="messageHandler"> <ref local="redisMessageHandler"/> </property>
</bean> </bean>
</beans> </beans>

View File

@ -61,7 +61,24 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<property name="connInvokerService"> <ref bean="connInvokerService"/></property> <property name="connInvokerService"> <ref bean="connInvokerService"/></property>
</bean> </bean>
<bean id="connInvokerService" class="org.bigbluebutton.conference.ConnectionInvokerService" init-method="start" destroy-method="stop"/> <bean id="connInvokerService" class="org.bigbluebutton.conference.meeting.messaging.red5.ConnectionInvokerService" init-method="start" destroy-method="stop"/>
<bean id="outMessageGateway" class="org.bigbluebutton.conference.meeting.messaging.OutMessageGateway">
<property name="outMessageListeners">
<set>
<ref bean="meetingMessagePublisher" />
<ref bean="usersMessagePublisher" />
</set>
</property>
</bean>
<bean id="meetingMessagePublisher" class="org.bigbluebutton.conference.meeting.messaging.redis.MeetingMessagePublisher">
<property name="messageService"> <ref bean="redisMessageSender"/></property>
</bean>
<bean id="usersMessagePublisher" class="org.bigbluebutton.conference.service.participants.messaging.redis.UsersMessagePublisher">
<property name="messageService"> <ref bean="redisMessageSender"/></property>
</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"/>