- fix compile issues

This commit is contained in:
Richard Alam 2013-06-11 20:31:29 +00:00
parent 635c23ddba
commit 5e173b931b
11 changed files with 53 additions and 84 deletions

View File

@ -26,8 +26,6 @@ import org.bigbluebutton.conference.service.participants.messaging.messages.Assi
import org.bigbluebutton.conference.service.participants.messaging.messages.UserJoinedMessage;
import org.bigbluebutton.conference.service.participants.messaging.messages.UserLeftMessage;
import org.bigbluebutton.conference.service.participants.messaging.messages.UserStatusChangeMessage;
import org.bigbluebutton.conference.service.participants.messaging.redis.UsersMessagePublisher;
import org.bigbluebutton.conference.service.participants.red5.UsersClientMessageSender;
import org.red5.logging.Red5LoggerFactory;
import java.util.concurrent.ConcurrentHashMap;
import java.util.ArrayList;

View File

@ -20,7 +20,6 @@ package org.bigbluebutton.conference.service.presentation;
import org.slf4j.Logger;
import org.bigbluebutton.conference.meeting.messaging.red5.BroadcastClientMessage;
import org.bigbluebutton.conference.meeting.messaging.red5.ClientMessage;
import org.bigbluebutton.conference.meeting.messaging.red5.ConnectionInvokerService;
import org.red5.logging.Red5LoggerFactory;
import org.red5.server.api.Red5; import java.util.ArrayList;

View File

@ -21,11 +21,11 @@ public class PresentationMessageListener implements MessageHandler {
public static final String GENERATED_THUMBNAIL_KEY = "GENERATED_THUMBNAIL";
public static final String CONVERSION_COMPLETED_KEY = "CONVERSION_COMPLETED";
private ConversionUpdatesMessageListener listener;
private ConversionUpdatesProcessor conversionUpdatesProcessor;
public void setPresentationListener(ConversionUpdatesMessageListener listener) {
this.listener = listener;
public void setConversionUpdatesProcessor(ConversionUpdatesProcessor p) {
conversionUpdatesProcessor = p;
}
@ -41,14 +41,13 @@ public class PresentationMessageListener implements MessageHandler {
String conference = (String) map.get("conference");
String messageKey = (String) map.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);
Map<String, Object> msg = new HashMap<String, Object>();
msg.put("conference", conference);
msg.put("room", room);
msg.put("code", code);
msg.put("presentationName", presentationName);
msg.put("messageKey", messageKey);
log.debug("Message: " + messageKey + "[ " + presentationName + "]");
if(messageKey.equalsIgnoreCase(OFFICE_DOC_CONVERSION_SUCCESS_KEY)||
messageKey.equalsIgnoreCase(OFFICE_DOC_CONVERSION_FAILED_KEY)||
@ -58,30 +57,24 @@ public class PresentationMessageListener implements MessageHandler {
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(msg);
} else if(messageKey.equalsIgnoreCase(PAGE_COUNT_EXCEEDED_KEY)){
Integer numberOfPages = new Integer((String) map.get("numberOfPages"));
Integer maxNumberPages = new Integer((String) map.get("maxNumberPages"));
msg.put("numberOfPages", numberOfPages);
msg.put("maxNumberPages", maxNumberPages);
conversionUpdatesProcessor.process(msg);
} else if(messageKey.equalsIgnoreCase(GENERATED_SLIDE_KEY)){
Integer numberOfPages = new Integer((String) map.get("numberOfPages"));
Integer pagesCompleted = new Integer((String) map.get("pagesCompleted"));
msg.put("numberOfPages", numberOfPages);
msg.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.");
conversionUpdatesProcessor.process(msg);
} else if(messageKey.equalsIgnoreCase(CONVERSION_COMPLETED_KEY)){
String slidesInfo = (String) map.get("slidesInfo");
msg.put("slidesInfo", StringEscapeUtils.unescapeXml(slidesInfo));
conversionUpdatesProcessor.process(msg);
}
}
}

View File

@ -1,16 +0,0 @@
package org.bigbluebutton.core.messages;
public class AbstractMessage implements Message {
private final String messageID;
public AbstractMessage(String messageID) {
this.messageID = messageID;
}
@Override
public String getMeetingID() {
return messageID;
}
}

View File

@ -1,8 +0,0 @@
package org.bigbluebutton.core.messages;
public class CreateMeeting extends AbstractMessage {
public CreateMeeting(String meetingID) {
super(meetingID);
}
}

View File

@ -1,6 +0,0 @@
package org.bigbluebutton.core.messages;
public interface Message {
public String getMeetingID();
}

View File

@ -19,10 +19,10 @@ class BigBlueButtonActor(outGW: BigBlueButtonOutGateway) extends Actor {
}
}
private def handleCreateMeeting(message: CreateMeeting):Unit = {
meetings.get(message.id) match {
private def handleCreateMeeting(msg: CreateMeeting):Unit = {
meetings.get(msg.id) match {
case None => {
var m = new Meeting()
var m = new Meeting(msg.id, msg.recorded, outGW)
}
}
}

View File

@ -13,7 +13,7 @@ class Meeting(id: String, recorded: Boolean, outGW: BigBlueButtonOutGateway) ext
import org.bigbluebutton.core.apps.poll.messages._
val users = new HashMap[String, User]
val polls = new PollApp()
val polls = new PollApp(outGW)
def act() = {
loop {
@ -22,7 +22,7 @@ class Meeting(id: String, recorded: Boolean, outGW: BigBlueButtonOutGateway) ext
handleUserJoin(userJoin)
}
case createPoll: CreatePoll => {
polls.createPoll(createPoll)
polls.handleMessage(createPoll)
}
}
}

View File

@ -2,15 +2,22 @@ package org.bigbluebutton.core.apps.poll
import scala.collection.mutable.HashMap
import org.bigbluebutton.core.User
import org.bigbluebutton.core.BigBlueButtonOutGateway
class PollApp {
class PollApp(outGW: BigBlueButtonOutGateway) {
import org.bigbluebutton.core.messages._
import org.bigbluebutton.core.apps.poll.messages._
private val polls = new HashMap[String, Poll]()
private val polls = new HashMap[String, Poll]()
def createPoll(msg: CreatePoll) {
var poll = new Poll(msg.poll.id, msg.poll.title)
polls += poll.id -> poll
}
def handleMessage(msg: InMessage):Unit = {
msg match {
case create: CreatePoll => createPoll(create)
}
}
private def createPoll(msg: CreatePoll) {
var poll = new Poll(msg.poll.id, msg.poll.title)
polls += poll.id -> poll
}
}

View File

@ -1,12 +1,12 @@
package org.bigbluebutton.core.apps.poll.messages
import org.bigbluebutton.core.messages.Message
import org.bigbluebutton.core.messages.InMessage
import org.bigbluebutton.core.apps.poll.QuestionType._
// Poll Messages
case class CreatePoll(poll: PollVO) extends Message
case class StopPoll(id: String) extends Message
case class StartPoll(id: String) extends Message
case class CreatePoll(poll: PollVO) extends InMessage
case class StopPoll(id: String) extends InMessage
case class StartPoll(id: String) extends InMessage
case class AddQuestion(pollID: String, question: QuestionVO)
case class DeleteQuestion(pollID: String, questionID: Int)
case class AddResponse(pollID: String, questionID: Int, responseVO: ResponseVO)

View File

@ -2,14 +2,16 @@ package org.bigbluebutton.core.messages
abstract class InMessage
case class CreateMeeting(id: String) extends InMessage
case class CreateMeeting(id: String, recorded: Boolean) extends InMessage
case class DestroyMeeting(id: String) extends InMessage
case class StartMeeting(id: String) extends InMessage
case class EndMeeting(id: String) extends InMessage
case class UserJoin(id: String, name: String) extends InMessage
case class UserLeft(id: String) extends InMessage
abstract class OutMessage
case class MeetingStarted() extends OutMessage
case class MeetingEnded() extends OutMessage
// Value Objects
case class MeetingVO(id: String, recorded: Boolean)