- get it to start
This commit is contained in:
parent
5e173b931b
commit
ecff26dbb1
@ -1,8 +1,6 @@
|
||||
package org.bigbluebutton.conference.service.participants.messaging.redis;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bigbluebutton.conference.User;
|
||||
import org.bigbluebutton.conference.meeting.messaging.OutMessage;
|
||||
import org.bigbluebutton.conference.meeting.messaging.OutMessageListener;
|
||||
import org.bigbluebutton.conference.service.messaging.MessagingConstants;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -41,7 +41,6 @@ public class PresentationHandler extends ApplicationAdapter implements IApplicat
|
||||
|
||||
private RecorderApplication recorderApplication;
|
||||
private PresentationApplication presentationApplication;
|
||||
private ConversionUpdatesMessageListener conversionUpdatesMessageListener;
|
||||
|
||||
@Override
|
||||
public boolean appConnect(IConnection conn, Object[] params) {
|
||||
@ -68,14 +67,12 @@ public class PresentationHandler extends ApplicationAdapter implements IApplicat
|
||||
@Override
|
||||
public boolean appStart(IScope scope) {
|
||||
log.debug("***** " + APP + " [ " + " appStart [ " + scope.getName() + "] *********");
|
||||
conversionUpdatesMessageListener.start();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appStop(IScope scope) {
|
||||
log.debug("***** " + APP + " [ " + " appStop [ " + scope.getName() + "] *********");
|
||||
conversionUpdatesMessageListener.stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -156,9 +153,4 @@ public class PresentationHandler extends ApplicationAdapter implements IApplicat
|
||||
recorderApplication = a;
|
||||
}
|
||||
|
||||
public void setConversionUpdatesMessageListener(ConversionUpdatesMessageListener service) {
|
||||
log.debug("Setting conversionUpdatesMessageListener");
|
||||
conversionUpdatesMessageListener = service;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,9 +37,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
<property name="recorderApplication">
|
||||
<ref bean="recorderApplication"/>
|
||||
</property>
|
||||
<property name="conversionUpdatesMessageListener">
|
||||
<ref local="conversionUpdatesMessageListener" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<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>
|
||||
</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" />
|
||||
</bean>
|
||||
|
||||
|
@ -28,8 +28,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
">
|
||||
|
||||
<bean id="roomsManager" class="org.bigbluebutton.conference.MeetingsManager">
|
||||
<property name="messagingService"> <ref bean="messagingService"/></property>
|
||||
<property name="conversionUpdatesMessageListener" ref="conversionUpdatesMessageListener"></property>
|
||||
<property name="outMessageGateway"> <ref bean="outMessageGateway"/></property>
|
||||
</bean>
|
||||
|
||||
<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">
|
||||
<property name="roomsManager"> <ref local="roomsManager"/></property>
|
||||
<property name="connInvokerService"> <ref bean="connInvokerService"/></property>
|
||||
</bean>
|
||||
|
||||
<bean id="participants.service" class="org.bigbluebutton.conference.service.participants.ParticipantsService">
|
||||
|
@ -28,20 +28,18 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
">
|
||||
|
||||
<bean id="whiteboardApplication" class="org.bigbluebutton.conference.service.whiteboard.WhiteboardApplication">
|
||||
<property name="recorderApplication"> <ref local="recorderApplication"/></property>
|
||||
<property name="clientSender"> <ref bean="connInvokerService"/></property>
|
||||
<property name="whiteboardRecordingService"> <ref local="whiteboardRecordingService"/></property>
|
||||
<property name="clientMessageSender"> <ref local="whiteboardClientSender"/></property>
|
||||
</bean>
|
||||
|
||||
<bean id="whiteboardClientSender" class="org.bigbluebutton.conference.service.whiteboard.ClientMessageSender">
|
||||
<property name="vonnectionInvokerService"> <ref local="connInvokerService"/></property>
|
||||
<bean id="whiteboardClientSender" class="org.bigbluebutton.conference.service.whiteboard.red5.ClientMessageSender">
|
||||
<property name="connectionInvokerService"> <ref bean="connInvokerService"/></property>
|
||||
</bean>
|
||||
|
||||
<bean id="whiteboard.service" class="org.bigbluebutton.conference.service.whiteboard.WhiteboardService">
|
||||
<property name="whiteboardApplication"> <ref local="whiteboardApplication"/></property>
|
||||
</bean>
|
||||
|
||||
<bean id="whiteboardRoomManager" class="org.bigbluebutton.conference.service.whiteboard.WhiteboardRoomManager"/>
|
||||
|
||||
<bean id="whiteboardRecordingService" class="org.bigbluebutton.conference.service.whiteboard.WhiteboardRecordingService">
|
||||
<property name="recorderApplication"> <ref bean="recorderApplication"/></property>
|
||||
</bean>
|
||||
|
@ -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">
|
||||
<property name="redisPool"> <ref bean="redisPool"/></property>
|
||||
<property name="redisMessageHandler"> <ref local="redisMessageHandler"/> </property>
|
||||
<property name="messageHandler"> <ref local="redisMessageHandler"/> </property>
|
||||
</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">
|
||||
<property name="redisMessageHandler"> <ref local="redisMessageHandler"/> </property>
|
||||
<bean id="redisMessageDistributor" class="org.bigbluebutton.conference.service.messaging.redis.MessageDistributor">
|
||||
<property name="messageHandler"> <ref local="redisMessageHandler"/> </property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
@ -61,8 +61,25 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
<property name="connInvokerService"> <ref bean="connInvokerService"/></property>
|
||||
</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-recorder.xml"/>
|
||||
<import resource="bbb-app-chat.xml" />
|
||||
|
Loading…
Reference in New Issue
Block a user