Skip to content

Commit

Permalink
- split bbb-apps into bbb-apps-common
Browse files Browse the repository at this point in the history
  • Loading branch information
ritzalam committed May 12, 2017
1 parent 9a628da commit d88da41
Show file tree
Hide file tree
Showing 74 changed files with 191 additions and 51 deletions.
118 changes: 118 additions & 0 deletions bbb-apps-common/build.sbt
@@ -0,0 +1,118 @@
name := "bbb-apps-common"

organization := "org.bigbluebutton"

version := "0.0.1-SNAPSHOT"

scalaVersion := "2.12.2"

scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-Xlint",
"-Ywarn-dead-code",
"-language:_",
"-target:jvm-1.8",
"-encoding", "UTF-8"
)

// We want to have our jar files in lib_managed dir.
// This way we'll have the right path when we import
// into eclipse.
retrieveManaged := true

testOptions in Test += Tests.Argument(TestFrameworks.Specs2, "html", "console", "junitxml")

testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-h", "target/scalatest-reports")

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"

// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
libraryDependencies += "org.apache.commons" % "commons-lang3" % "3.5"
libraryDependencies += "commons-io" % "commons-io" % "2.4"

libraryDependencies += "org.apache.commons" % "commons-pool2" % "2.3"
libraryDependencies += "commons-io" % "commons-io" % "2.4"

libraryDependencies += "org.slf4j" % "slf4j-api" % "1.7.5"

libraryDependencies += "org.pegdown" % "pegdown" % "1.4.0" % "test"
libraryDependencies += "junit" % "junit" % "4.12" % "test"
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
// https://mvnrepository.com/artifact/org.mockito/mockito-core
libraryDependencies += "org.mockito" % "mockito-core" % "2.7.12" % "test"
libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.1" % "test"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test"

seq(Revolver.settings: _*)

//-----------
// Packaging
//
// Reference:
// http://xerial.org/blog/2014/03/24/sbt/
// http://www.scala-sbt.org/sbt-pgp/usage.html
// http://www.scala-sbt.org/0.13/docs/Using-Sonatype.html
// http://central.sonatype.org/pages/requirements.html
// http://central.sonatype.org/pages/releasing-the-deployment.html
//-----------

// Build pure Java lib (i.e. without scala)
// Do not append Scala versions to the generated artifacts
crossPaths := false

// This forbids including Scala related libraries into the dependency
autoScalaLibrary := false

/***************************
* When developing, change the version above to x.x.x-SNAPSHOT then use the file resolver to
* publish to the local maven repo using "sbt publish"
*/
// Uncomment this to publish to local maven repo while commenting out the nexus repo
publishTo := Some(Resolver.file("file", new File(Path.userHome.absolutePath+"/.m2/repository")))


// Comment this out when publishing to local maven repo using SNAPSHOT version.
// To push to sonatype "sbt publishSigned"
//publishTo := {
// val nexus = "https://oss.sonatype.org/"
// if (isSnapshot.value)
// Some("snapshots" at nexus + "content/repositories/snapshots")
// else
// Some("releases" at nexus + "service/local/staging/deploy/maven2")
//}

// Enables publishing to maven repo
publishMavenStyle := true

publishArtifact in Test := false

pomIncludeRepository := { _ => false }

pomExtra := (
<scm>
<url>git@github.com:bigbluebutton/bigbluebutton.git</url>
<connection>scm:git:git@github.com:bigbluebutton/bigbluebutton.git</connection>
</scm>
<developers>
<developer>
<id>ritzalam</id>
<name>Richard Alam</name>
<url>http://www.bigbluebutton.org</url>
</developer>
</developers>)

licenses := Seq("LGPL-3.0" -> url("http://opensource.org/licenses/LGPL-3.0"))

homepage := Some(url("http://www.bigbluebutton.org"))


Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
1 change: 1 addition & 0 deletions bbb-apps-common/project/build.properties
@@ -0,0 +1 @@
sbt.version=0.13.8
9 changes: 9 additions & 0 deletions bbb-apps-common/project/plugins.sbt
@@ -0,0 +1,9 @@
addSbtPlugin("io.spray" % "sbt-revolver" % "0.7.2")

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.2.0")

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")

//addSbtPlugin("com.artima.supersafe" % "sbtplugin" % "1.1.2")


Expand Up @@ -8,17 +8,17 @@
import org.bigbluebutton.common.messages.SendCaptionHistoryReplyMessage; import org.bigbluebutton.common.messages.SendCaptionHistoryReplyMessage;
import org.bigbluebutton.common.messages.UpdateCaptionOwnerMessage; import org.bigbluebutton.common.messages.UpdateCaptionOwnerMessage;
import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage; import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage;
import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; import org.bigbluebutton.red5.client.messaging.IConnectionInvokerService;
import org.bigbluebutton.red5.client.messaging.DirectClientMessage; import org.bigbluebutton.red5.client.messaging.DirectClientMessage;


import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;


public class CaptionClientMessageSender { public class CaptionClientMessageSender {
private ConnectionInvokerService service; private IConnectionInvokerService service;


public CaptionClientMessageSender(ConnectionInvokerService service) { public CaptionClientMessageSender(IConnectionInvokerService service) {
this.service = service; this.service = service;
} }


Expand Down
Expand Up @@ -8,17 +8,17 @@
import org.bigbluebutton.common.messages.SendPrivateChatMessage; import org.bigbluebutton.common.messages.SendPrivateChatMessage;
import org.bigbluebutton.common.messages.SendPublicChatMessage; import org.bigbluebutton.common.messages.SendPublicChatMessage;
import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage; import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage;
import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; import org.bigbluebutton.red5.client.messaging.IConnectionInvokerService;
import org.bigbluebutton.red5.client.messaging.DirectClientMessage; import org.bigbluebutton.red5.client.messaging.DirectClientMessage;
import org.bigbluebutton.red5.service.ChatKeyUtil; import org.bigbluebutton.red5.client.ChatKeyUtil;


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


public class ChatClientMessageSender { public class ChatClientMessageSender {
private ConnectionInvokerService service; private IConnectionInvokerService service;


public ChatClientMessageSender(ConnectionInvokerService service) { public ChatClientMessageSender(IConnectionInvokerService service) {
this.service = service; this.service = service;
} }


Expand Down
@@ -0,0 +1,13 @@
package org.bigbluebutton.red5.client;

public class ChatKeyUtil {
public static final String CHAT_TYPE = "chatType";
public static final String FROM_USERID = "fromUserID";
public static final String FROM_USERNAME = "fromUsername";
public static final String FROM_COLOR = "fromColor";
public static final String FROM_TIME = "fromTime";
public static final String FROM_TZ_OFFSET = "fromTimezoneOffset";
public static final String TO_USERID = "toUserID";
public static final String TO_USERNAME = "toUsername";
public static final String MESSAGE = "message";
}
Expand Up @@ -6,16 +6,16 @@
import org.bigbluebutton.common.messages.DeskShareNotifyASingleViewerEventMessage; import org.bigbluebutton.common.messages.DeskShareNotifyASingleViewerEventMessage;
import org.bigbluebutton.common.messages.DeskShareNotifyViewersRTMPEventMessage; import org.bigbluebutton.common.messages.DeskShareNotifyViewersRTMPEventMessage;
import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage; import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage;
import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; import org.bigbluebutton.red5.client.messaging.IConnectionInvokerService;
import org.bigbluebutton.red5.client.messaging.DirectClientMessage; import org.bigbluebutton.red5.client.messaging.DirectClientMessage;


import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;


public class DeskShareMessageSender { public class DeskShareMessageSender {
private ConnectionInvokerService service; private IConnectionInvokerService service;


public DeskShareMessageSender(ConnectionInvokerService service) { public DeskShareMessageSender(IConnectionInvokerService service) {
this.service = service; this.service = service;
} }


Expand Down
Expand Up @@ -16,7 +16,7 @@
import org.bigbluebutton.common.messages.NewPermissionsSettingMessage; import org.bigbluebutton.common.messages.NewPermissionsSettingMessage;
import org.bigbluebutton.common.messages.UserLockedMessage; import org.bigbluebutton.common.messages.UserLockedMessage;
import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage; import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage;
import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; import org.bigbluebutton.red5.client.messaging.IConnectionInvokerService;
import org.bigbluebutton.red5.client.messaging.DirectClientMessage; import org.bigbluebutton.red5.client.messaging.DirectClientMessage;
import org.bigbluebutton.red5.client.messaging.DisconnectAllClientsMessage; import org.bigbluebutton.red5.client.messaging.DisconnectAllClientsMessage;
import org.bigbluebutton.red5.client.messaging.DisconnectClientMessage; import org.bigbluebutton.red5.client.messaging.DisconnectClientMessage;
Expand All @@ -27,9 +27,9 @@




public class MeetingClientMessageSender { public class MeetingClientMessageSender {
private ConnectionInvokerService service; private IConnectionInvokerService service;


public MeetingClientMessageSender(ConnectionInvokerService service) { public MeetingClientMessageSender(IConnectionInvokerService service) {
this.service = service; this.service = service;
} }


Expand Down
Expand Up @@ -5,16 +5,16 @@
import java.util.Map; import java.util.Map;
import org.bigbluebutton.common.messages.*; import org.bigbluebutton.common.messages.*;
import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage; import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage;
import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; import org.bigbluebutton.red5.client.messaging.IConnectionInvokerService;
import org.bigbluebutton.red5.client.messaging.DirectClientMessage; import org.bigbluebutton.red5.client.messaging.DirectClientMessage;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;


public class PollingClientMessageSender { public class PollingClientMessageSender {
private ConnectionInvokerService service; private IConnectionInvokerService service;


public PollingClientMessageSender(ConnectionInvokerService service) { public PollingClientMessageSender(IConnectionInvokerService service) {
this.service = service; this.service = service;
} }


Expand Down
Expand Up @@ -16,17 +16,17 @@
import org.bigbluebutton.common.messages.PresentationRemovedMessage; import org.bigbluebutton.common.messages.PresentationRemovedMessage;
import org.bigbluebutton.common.messages.PresentationSharedMessage; import org.bigbluebutton.common.messages.PresentationSharedMessage;
import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage; import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage;
import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; import org.bigbluebutton.red5.client.messaging.IConnectionInvokerService;
import org.bigbluebutton.red5.client.messaging.DirectClientMessage; import org.bigbluebutton.red5.client.messaging.DirectClientMessage;


import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;


public class PresentationClientMessageSender { public class PresentationClientMessageSender {
private ConnectionInvokerService service; private IConnectionInvokerService service;


public PresentationClientMessageSender(ConnectionInvokerService service) { public PresentationClientMessageSender(IConnectionInvokerService service) {
this.service = service; this.service = service;
} }


Expand Down
Expand Up @@ -9,17 +9,17 @@
import org.bigbluebutton.common.messages.DestroyAdditionalNotesReplyMessage; import org.bigbluebutton.common.messages.DestroyAdditionalNotesReplyMessage;
import org.bigbluebutton.common.messages.SharedNotesSyncNoteReplyMessage; import org.bigbluebutton.common.messages.SharedNotesSyncNoteReplyMessage;
import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage; import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage;
import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; import org.bigbluebutton.red5.client.messaging.IConnectionInvokerService;
import org.bigbluebutton.red5.client.messaging.DirectClientMessage; import org.bigbluebutton.red5.client.messaging.DirectClientMessage;


import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;


public class SharedNotesClientMessageSender { public class SharedNotesClientMessageSender {
private ConnectionInvokerService service; private IConnectionInvokerService service;


public SharedNotesClientMessageSender(ConnectionInvokerService service) { public SharedNotesClientMessageSender(IConnectionInvokerService service) {
this.service = service; this.service = service;
} }


Expand Down
Expand Up @@ -39,21 +39,19 @@
import org.bigbluebutton.messages.TimeRemainingUpdate; import org.bigbluebutton.messages.TimeRemainingUpdate;
import org.bigbluebutton.messages.UpdateBreakoutUsers; import org.bigbluebutton.messages.UpdateBreakoutUsers;
import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage; import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage;
import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; import org.bigbluebutton.red5.client.messaging.IConnectionInvokerService;
import org.bigbluebutton.red5.client.messaging.DirectClientMessage; import org.bigbluebutton.red5.client.messaging.DirectClientMessage;
import org.red5.logging.Red5LoggerFactory;
import org.slf4j.Logger; import org.slf4j.Logger;


import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;


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


private ConnectionInvokerService service; private IConnectionInvokerService service;


public UserClientMessageSender(ConnectionInvokerService service) { public UserClientMessageSender(IConnectionInvokerService service) {
this.service = service; this.service = service;
} }


Expand Down Expand Up @@ -319,8 +317,7 @@ private void processValidateAuthTokenReply(ValidateAuthTokenReplyMessage msg) {
Map<String, Object> message = new HashMap<String, Object>(); Map<String, Object> message = new HashMap<String, Object>();
Gson gson = new Gson(); Gson gson = new Gson();
message.put("msg", gson.toJson(args)); message.put("msg", gson.toJson(args));


log.info("validateAuthTokenReply - " + gson.toJson(args));
DirectClientMessage m = new DirectClientMessage(msg.meetingId, msg.userId, "validateAuthTokenReply", message); DirectClientMessage m = new DirectClientMessage(msg.meetingId, msg.userId, "validateAuthTokenReply", message);
service.sendMessage(m); service.sendMessage(m);
} }
Expand All @@ -333,8 +330,7 @@ private void processValidateAuthTokenTimeoutMessage(ValidateAuthTokenTimeoutMess
Map<String, Object> message = new HashMap<String, Object>(); Map<String, Object> message = new HashMap<String, Object>();
Gson gson = new Gson(); Gson gson = new Gson();
message.put("msg", gson.toJson(args)); message.put("msg", gson.toJson(args));


log.info("validateAuthTokenTimedOut - " + gson.toJson(args));
DirectClientMessage m = new DirectClientMessage(msg.meetingId, msg.userId, "validateAuthTokenTimedOut", message); DirectClientMessage m = new DirectClientMessage(msg.meetingId, msg.userId, "validateAuthTokenTimedOut", message);
service.sendMessage(m); service.sendMessage(m);
} }
Expand All @@ -360,7 +356,6 @@ private void processUserJoinedMessage(UserJoinedMessage msg) {
message.put("msg", gson.toJson(args)); message.put("msg", gson.toJson(args));


String userId = msg.user.get("userId").toString(); String userId = msg.user.get("userId").toString();
log.info("joinMeetingReply - " + gson.toJson(args));


DirectClientMessage jmr = new DirectClientMessage(msg.meetingId, userId, "joinMeetingReply", message); DirectClientMessage jmr = new DirectClientMessage(msg.meetingId, userId, "joinMeetingReply", message);
service.sendMessage(jmr); service.sendMessage(jmr);
Expand Down
Expand Up @@ -10,17 +10,17 @@
import org.bigbluebutton.common.messages.UndoWhiteboardReplyMessage; import org.bigbluebutton.common.messages.UndoWhiteboardReplyMessage;
import org.bigbluebutton.common.messages.ModifiedWhiteboardAccessMessage; import org.bigbluebutton.common.messages.ModifiedWhiteboardAccessMessage;
import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage; import org.bigbluebutton.red5.client.messaging.BroadcastClientMessage;
import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; import org.bigbluebutton.red5.client.messaging.IConnectionInvokerService;
import org.bigbluebutton.red5.client.messaging.DirectClientMessage; import org.bigbluebutton.red5.client.messaging.DirectClientMessage;


import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;


public class WhiteboardClientMessageSender { public class WhiteboardClientMessageSender {
private ConnectionInvokerService service; private IConnectionInvokerService service;


public WhiteboardClientMessageSender(ConnectionInvokerService service) { public WhiteboardClientMessageSender(IConnectionInvokerService service) {
this.service = service; this.service = service;
} }


Expand Down
@@ -0,0 +1,6 @@
package org.bigbluebutton.red5.client.messaging;


public interface IConnectionInvokerService {
void sendMessage(final ClientMessage message);
}
Expand Up @@ -11,7 +11,7 @@
import org.bigbluebutton.common.messages.MessagingConstants; import org.bigbluebutton.common.messages.MessagingConstants;
import org.bigbluebutton.common.messages.PubSubPingMessage; import org.bigbluebutton.common.messages.PubSubPingMessage;
import org.bigbluebutton.common.messages.payload.PubSubPingMessagePayload; import org.bigbluebutton.common.messages.payload.PubSubPingMessagePayload;
import org.bigbluebutton.red5.client.messaging.ConnectionInvokerService; import org.bigbluebutton.red5.client.messaging.IConnectionInvokerService;
import org.bigbluebutton.red5.client.messaging.DisconnectAllMessage; import org.bigbluebutton.red5.client.messaging.DisconnectAllMessage;
import org.bigbluebutton.red5.pubsub.redis.MessageSender; import org.bigbluebutton.red5.pubsub.redis.MessageSender;
import org.slf4j.Logger; import org.slf4j.Logger;
Expand All @@ -31,7 +31,7 @@ public class BbbAppsIsAliveMonitorService {
private volatile boolean processMessages = false; private volatile boolean processMessages = false;
private KeepAliveTask task = new KeepAliveTask(); private KeepAliveTask task = new KeepAliveTask();


private ConnectionInvokerService service; private IConnectionInvokerService service;
private Long lastKeepAliveMessage = 0L; private Long lastKeepAliveMessage = 0L;


private MessageSender sender; private MessageSender sender;
Expand All @@ -42,7 +42,7 @@ public void setMessageSender(MessageSender sender) {
this.sender = sender; this.sender = sender;
} }


public void setConnectionInvokerService(ConnectionInvokerService s) { public void setConnectionInvokerService(IConnectionInvokerService s) {
this.service = s; this.service = s;
} }


Expand Down

0 comments on commit d88da41

Please sign in to comment.