diff --git a/bbb-common-message/src/main/java/org/bigbluebutton/messages/CreateMeetingRequestPayload.java b/bbb-common-message/src/main/java/org/bigbluebutton/messages/CreateMeetingRequestPayload.java index 78f51d2861..55a6944c39 100755 --- a/bbb-common-message/src/main/java/org/bigbluebutton/messages/CreateMeetingRequestPayload.java +++ b/bbb-common-message/src/main/java/org/bigbluebutton/messages/CreateMeetingRequestPayload.java @@ -2,7 +2,7 @@ package org.bigbluebutton.messages; import java.util.Map; -class CreateMeetingRequestPayload { +public class CreateMeetingRequestPayload { public final String id; public final String externalId; public final String parentId; diff --git a/bbb-common-web/build.sbt b/bbb-common-web/build.sbt index 84069a8796..1d860690c1 100755 --- a/bbb-common-web/build.sbt +++ b/bbb-common-web/build.sbt @@ -4,7 +4,7 @@ organization := "org.bigbluebutton" version := "0.0.1-SNAPSHOT" -scalaVersion := "2.11.7" +scalaVersion := "2.12.2" scalacOptions ++= Seq( "-unchecked", @@ -25,12 +25,14 @@ testOptions in Test += Tests.Argument(TestFrameworks.Specs2, "html", "console", testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-h", "target/scalatest-reports") -val scalaV = "2.11.7" +val scalaV = "2.12.2" libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaV libraryDependencies += "org.scala-lang" % "scala-library" % scalaV libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaV +libraryDependencies += "org.bigbluebutton" % "bbb-common-message_2.12" % "0.0.19-SNAPSHOT" + libraryDependencies += "redis.clients" % "jedis" % "2.7.2" libraryDependencies += "com.google.code.gson" % "gson" % "2.5" @@ -48,7 +50,7 @@ libraryDependencies += "org.openoffice" % "juh" % "3.2.1" libraryDependencies += "org.openoffice" % "jurt" % "3.2.1" libraryDependencies += "org.apache.poi" % "poi-ooxml" % "3.15" -libraryDependencies += "org.bigbluebutton" % "bbb-common-message" % "0.0.19-SNAPSHOT" + libraryDependencies += "org.slf4j" % "slf4j-api" % "1.7.5" // https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient diff --git a/bbb-common-web/project/plugins.sbt b/bbb-common-web/project/plugins.sbt index 30bb577b38..6ce94e5f09 100755 --- a/bbb-common-web/project/plugins.sbt +++ b/bbb-common-web/project/plugins.sbt @@ -4,6 +4,6 @@ addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.2.0") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") -addSbtPlugin("com.artima.supersafe" % "sbtplugin" % "1.1.0") +addSbtPlugin("com.artima.supersafe" % "sbtplugin" % "1.1.2") diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java index 348a5c9ac3..617f073487 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/MeetingService.java @@ -60,6 +60,7 @@ import org.bigbluebutton.api.messaging.messages.UserRoleChanged; import org.bigbluebutton.api.messaging.messages.UserSharedWebcam; import org.bigbluebutton.api.messaging.messages.UserStatusChanged; import org.bigbluebutton.api.messaging.messages.UserUnsharedWebcam; +import org.bigbluebutton.api.pub.IPublisherService; import org.bigbluebutton.presentation.PresentationUrlDownloadService; import org.bigbluebutton.api.messaging.messages.StunTurnInfoRequested; import org.bigbluebutton.web.services.RegisteredUserCleanupTimerTask; @@ -90,6 +91,7 @@ public class MeetingService implements MessageListener { private RecordingService recordingService; private MessagingService messagingService; + private IPublisherService publisherService; private RegisteredUserCleanupTimerTask registeredUserCleaner; private StunTurnService stunTurnService; @@ -190,7 +192,7 @@ public class MeetingService implements MessageListener { } private void destroyMeeting(String meetingID) { - messagingService.destroyMeeting(meetingID); + publisherService.destroyMeeting(meetingID); } public Collection getMeetings() { @@ -262,7 +264,7 @@ public class MeetingService implements MessageListener { log.info("Create meeting: data={}", logStr); - messagingService.createMeeting(m.getInternalId(), m.getExternalId(), + publisherService.createMeeting(m.getInternalId(), m.getExternalId(), m.getParentMeetingId(), m.getName(), m.isRecord(), m.getTelVoice(), m.getDuration(), m.getAutoStartRecording(), m.getAllowStartStopRecording(), m.getWebcamsOnlyForModerator(), @@ -280,7 +282,7 @@ public class MeetingService implements MessageListener { } private void processRegisterUser(RegisterUser message) { - messagingService.registerUser(message.meetingID, + publisherService.registerUser(message.meetingID, message.internalUserId, message.fullname, message.role, message.externUserID, message.authToken, message.avatarURL, message.guest, message.authed); } @@ -459,12 +461,6 @@ public class MeetingService implements MessageListener { messagingService.send(channel, message); } - public void createdPolls(String meetingId, String title, String question, - String questionType, ArrayList answers) { - messagingService.sendPolls(meetingId, title, question, questionType, - answers); - } - public void endMeeting(String meetingId) { handle(new EndMeeting(meetingId)); } @@ -516,7 +512,7 @@ public class MeetingService implements MessageListener { } private void processEndMeeting(EndMeeting message) { - messagingService.endMeeting(message.meetingId); + publisherService.endMeeting(message.meetingId); } private void processRemoveEndedMeeting(MeetingEnded message) { @@ -754,7 +750,7 @@ public class MeetingService implements MessageListener { log.info("a org.bigbluebutton.web.services.turn: " + t.url + "username/pass=" + t.username + '/' + t.password); } - messagingService.sendStunTurnInfo(message.meetingId, + publisherService.sendStunTurnInfo(message.meetingId, message.internalUserId, stuns, turns); } @@ -919,6 +915,10 @@ public class MeetingService implements MessageListener { messagingService = mess; } + public void setPublisherService(IPublisherService mess) { + publisherService = mess; + } + public void setRegisteredUserCleanupTimerTask( RegisteredUserCleanupTimerTask c) { registeredUserCleaner = c; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java index d33e3907f5..40cb65e97e 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/domain/Meeting.java @@ -63,7 +63,7 @@ public class Meeting { private final Boolean isBreakout; private final List breakoutRooms = new ArrayList(); - public Meeting(Builder builder) { + public Meeting(Meeting.Builder builder) { name = builder.name; extMeetingId = builder.externalId; intMeetingId = builder.internalId; diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/MessagingService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/MessagingService.java index 8c83133c94..26088d1c88 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/MessagingService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/MessagingService.java @@ -19,32 +19,14 @@ package org.bigbluebutton.api.messaging; -import org.bigbluebutton.web.services.turn.StunServer; -import org.bigbluebutton.web.services.turn.TurnEntry; -import java.util.List; import java.util.Map; -import java.util.Set; public interface MessagingService { void recordMeetingInfo(String meetingId, Map info); void recordBreakoutInfo(String meetingId, Map breakoutInfo); void addBreakoutRoom(String parentId, String breakoutId); - void destroyMeeting(String meetingID); - void createMeeting(String meetingID, String externalMeetingID, - String parentMeetingID, String meetingName, Boolean recorded, - String voiceBridge, Integer duration, Boolean autoStartRecording, - Boolean allowStartStopRecording, Boolean webcamsOnlyForModerator, - String moderatorPass, String viewerPass, Long createTime, - String createDate, Boolean isBreakout, Integer sequence, - Map metadata, String guestPolicy); - void endMeeting(String meetingId); void send(String channel, String message); - void sendPolls(String meetingId, String title, String question, String questionType, List answers); - void registerUser(String meetingID, String internalUserId, String fullname, String role, String externUserID, - String authToken, String avatarURL, Boolean guest, Boolean authed); - void sendKeepAlive(String system, Long timestamp); - void sendStunTurnInfo(String meetingId, String internalUserId, Set stuns, Set turns); void publishRecording(String recordId, String meetingId, String externalMeetingId, String format, boolean publish); void deleteRecording(String recordId, String meetingId, String externalMeetingId, String format); } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/RedisMessagingService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/RedisMessagingService.java index fb53ceb8ad..2c676713d1 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/RedisMessagingService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/RedisMessagingService.java @@ -37,7 +37,8 @@ import org.bigbluebutton.common.messages.Constants; import org.bigbluebutton.common.messages.MessagingConstants; import org.bigbluebutton.common.messages.SendStunTurnInfoReplyMessage; import org.bigbluebutton.messages.CreateMeetingRequest; -import org.bigbluebutton.messages.CreateMeetingRequest.CreateMeetingRequestPayload; +import org.bigbluebutton.messages.CreateMeetingRequestPayload; +import org.bigbluebutton.messages.RegisterUserMessagePayload; import org.bigbluebutton.web.services.turn.StunServer; import org.bigbluebutton.web.services.turn.TurnEntry; import org.slf4j.Logger; @@ -73,7 +74,7 @@ public class RedisMessagingService implements MessagingService { public void registerUser(String meetingID, String internalUserId, String fullname, String role, String externUserID, String authToken, String avatarURL, Boolean guest, Boolean authed) { - RegisterUserMessage.Payload payload = new RegisterUserMessage.Payload(meetingID, internalUserId, fullname, role, externUserID, + RegisterUserMessagePayload payload = new RegisterUserMessagePayload(meetingID, internalUserId, fullname, role, externUserID, authToken, avatarURL, guest, authed); RegisterUserMessage msg = new RegisterUserMessage(payload); diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/pub/IPublisherService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/pub/IPublisherService.java new file mode 100755 index 0000000000..6e567c0d65 --- /dev/null +++ b/bbb-common-web/src/main/java/org/bigbluebutton/api/pub/IPublisherService.java @@ -0,0 +1,26 @@ +package org.bigbluebutton.api.pub; + + +import org.bigbluebutton.web.services.turn.StunServer; +import org.bigbluebutton.web.services.turn.TurnEntry; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +public interface IPublisherService { + void destroyMeeting(String meetingID); + void createMeeting(String meetingID, String externalMeetingID, + String parentMeetingID, String meetingName, Boolean recorded, + String voiceBridge, Integer duration, Boolean autoStartRecording, + Boolean allowStartStopRecording, Boolean webcamsOnlyForModerator, + String moderatorPass, String viewerPass, Long createTime, + String createDate, Boolean isBreakout, Integer sequence, + Map metadata, String guestPolicy); + void endMeeting(String meetingId); + void send(String channel, String message); + void registerUser(String meetingID, String internalUserId, String fullname, String role, String externUserID, + String authToken, String avatarURL, Boolean guest, Boolean authed); + void sendKeepAlive(String system, Long timestamp); + void sendStunTurnInfo(String meetingId, String internalUserId, Set stuns, Set turns); +} diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/ConversionUpdateMessage.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/ConversionUpdateMessage.java index a354515c40..1b4f531db9 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/ConversionUpdateMessage.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/ConversionUpdateMessage.java @@ -26,7 +26,7 @@ import java.util.Map; public class ConversionUpdateMessage { private Map message = new HashMap(); - private ConversionUpdateMessage(MessageBuilder builder) { + private ConversionUpdateMessage(ConversionUpdateMessage.MessageBuilder builder) { message = builder.message; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/PageAnalyser.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/PageAnalyser.java index d673427409..58bfc66a82 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/PageAnalyser.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/PageAnalyser.java @@ -25,7 +25,7 @@ public interface PageAnalyser { /** * * @param output - * a {@link File} to analyse + * a File to analyse * @return true if the file has been parsed without any error */ public boolean analyse(File output); diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/CountingPageException.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/CountingPageException.java index 9435db9fba..9b10c6cb17 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/CountingPageException.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/imp/CountingPageException.java @@ -28,7 +28,7 @@ public class CountingPageException extends Exception { public enum ExceptionType {PAGE_COUNT_EXCEPTION, PAGE_EXCEEDED_EXCEPTION}; - public CountingPageException(ExceptionType type, int pageCount, int maxNumberOfPages) { + public CountingPageException(CountingPageException.ExceptionType type, int pageCount, int maxNumberOfPages) { super("Exception while trying to determine number of pages."); this.pageCount = pageCount; this.maxNumberOfPages = maxNumberOfPages; @@ -39,7 +39,7 @@ public class CountingPageException extends Exception { return maxNumberOfPages; } - public ExceptionType getExceptionType() { + public CountingPageException.ExceptionType getExceptionType() { return exceptionType; } diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/web/services/KeepAliveService.java b/bbb-common-web/src/main/java/org/bigbluebutton/web/services/KeepAliveService.java index e1f5fd199f..7e0528ee4b 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/web/services/KeepAliveService.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/web/services/KeepAliveService.java @@ -30,13 +30,14 @@ import org.bigbluebutton.api.messaging.MessageListener; import org.bigbluebutton.api.messaging.MessagingService; import org.bigbluebutton.api.messaging.messages.IMessage; import org.bigbluebutton.api.messaging.messages.KeepAliveReply; +import org.bigbluebutton.api.pub.IPublisherService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class KeepAliveService implements MessageListener { private static Logger log = LoggerFactory.getLogger(KeepAliveService.class); private final String KEEP_ALIVE_REQUEST = "KEEP_ALIVE_REQUEST"; - private MessagingService service; + private IPublisherService service; private long runEvery = 10000; private int maxLives = 5; private KeepAliveTask task = new KeepAliveTask(); @@ -69,7 +70,7 @@ public class KeepAliveService implements MessageListener { runEvery = v * 1000; } - public void setMessagingService(MessagingService service){ + public void setPublisherService(IPublisherService service){ this.service = service; } diff --git a/bbb-common-web/src/main/scala/org/bigbluebutton/api/pub/RedisPublisherService.scala b/bbb-common-web/src/main/scala/org/bigbluebutton/api/pub/RedisPublisherService.scala new file mode 100755 index 0000000000..e4b9ae85b3 --- /dev/null +++ b/bbb-common-web/src/main/scala/org/bigbluebutton/api/pub/RedisPublisherService.scala @@ -0,0 +1,41 @@ +package org.bigbluebutton.api.pub + +import java.util +import org.bigbluebutton.web.services.turn.{StunServer, TurnEntry} + + +class RedisPublisherService extends IPublisherService { + def destroyMeeting (meetingId: String):Unit = { + + } + + def createMeeting(meetingId: String, extMeetingId: String, parentMeetingId: String, meetingName: String, + recorded: java.lang.Boolean, voiceBridge: String, duration: java.lang.Integer, autoStartRecording: java.lang.Boolean, + allowStartStopRecording: java.lang.Boolean, webcamsOnlyForModerator: java.lang.Boolean, moderatorPass: String, + viewerPass: String, createTime: java.lang.Long, createDate: String, isBreakout: java.lang.Boolean, sequence: java.lang.Integer, + metadata: util.Map[String, String], guestPolicy: String): Unit = { + + } + + def endMeeting(meetingId: String): Unit = { + + } + + def send(channel: String, message: String): Unit = { + + } + + def registerUser(meetingID: String, internalUserId: String, fullname: String, role: String, externUserID: String, + authToken: String, avatarURL: String, guest: java.lang.Boolean, authed: java.lang.Boolean): Unit = { + + } + + def sendKeepAlive(system: String, timestamp: java.lang.Long): Unit = { + + } + + def sendStunTurnInfo(meetingId: String, internalUserId: String, stuns: util.Set[StunServer], + turns: util.Set[TurnEntry]): Unit = { + + } +}