From 21cb59487c985a347f5d6a10ccaab07247d30f45 Mon Sep 17 00:00:00 2001
From: Ghazi Triki <ghazi.triki@riadvice.tn>
Date: Tue, 6 Nov 2018 18:54:27 +0100
Subject: [PATCH] Move RedisStorageService from bigbluebutton-web to
 bbb-common-message and replace jedis with lettuce-core.

---
 bbb-apps-common/build.sbt                     |   3 -
 bbb-common-message/build.sbt                  |   5 +-
 bbb-common-message/project/Dependencies.scala |   3 +
 .../common2/redis/RedisStorageService.java    | 114 ++++++++++++++++++
 bbb-common-web/project/Dependencies.scala     |   1 -
 .../org/bigbluebutton/api/MeetingService.java |   2 +-
 .../api/messaging/RedisStorageService.java    |  91 --------------
 .../web/services/RedisStorageService.java     |  92 --------------
 bigbluebutton-web/build.gradle                |  48 +++-----
 .../conf/spring/bbb-redis-messaging.xml       |  32 -----
 .../grails-app/conf/spring/bbb-redis-pool.xml |  18 ++-
 .../grails-app/conf/spring/resources.xml      |  23 +---
 bigbluebutton-web/pres-checker/build.gradle   |  41 +++----
 .../api/messaging/NullMessagingService.java   |  94 ++++++---------
 14 files changed, 216 insertions(+), 351 deletions(-)
 create mode 100644 bbb-common-message/src/main/java/org/bigbluebutton/common2/redis/RedisStorageService.java
 delete mode 100755 bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/RedisStorageService.java
 delete mode 100755 bbb-common-web/src/main/java/org/bigbluebutton/web/services/RedisStorageService.java
 delete mode 100755 bigbluebutton-web/grails-app/conf/spring/bbb-redis-messaging.xml

diff --git a/bbb-apps-common/build.sbt b/bbb-apps-common/build.sbt
index 693e0e360c..479d4e6ad4 100755
--- a/bbb-apps-common/build.sbt
+++ b/bbb-apps-common/build.sbt
@@ -1,4 +1,3 @@
-
 name := "bbb-apps-common"
 
 organization := "org.bigbluebutton"
@@ -133,5 +132,3 @@ pomExtra := (
 licenses := Seq("LGPL-3.0" -> url("http://opensource.org/licenses/LGPL-3.0"))
 
 homepage := Some(url("http://www.bigbluebutton.org"))
-  
-
diff --git a/bbb-common-message/build.sbt b/bbb-common-message/build.sbt
index f4fb27160b..f18aee17ff 100755
--- a/bbb-common-message/build.sbt
+++ b/bbb-common-message/build.sbt
@@ -1,7 +1,5 @@
 import org.bigbluebutton.build._
 
-organization := "org.bigbluebutton"
-
 version := "0.0.20-SNAPSHOT"
 
 scalaVersion := "2.12.7"
@@ -35,8 +33,7 @@ testOptions in Test += Tests.Argument(TestFrameworks.Specs2, "html", "console",
 testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-h", "target/scalatest-reports")
 
 Seq(Revolver.settings: _*)
-
-lazy val commonsWeb = (project in file(".")).settings(name := "bbb-common-message", libraryDependencies ++= Dependencies.runtime).settings(compileSettings)
+lazy val commonMessage = (project in file(".")).settings(name := "bbb-common-message", libraryDependencies ++= Dependencies.runtime).settings(compileSettings)
 
 //-----------
 // Packaging
diff --git a/bbb-common-message/project/Dependencies.scala b/bbb-common-message/project/Dependencies.scala
index bab62fb787..a9f76fbc5c 100644
--- a/bbb-common-message/project/Dependencies.scala
+++ b/bbb-common-message/project/Dependencies.scala
@@ -16,6 +16,7 @@ object Dependencies {
     // Libraries
     val gson = "2.8.5"
     val jackson = "2.9.7"
+    val sl4j = "1.7.25"
     val lettuce = "5.1.2.RELEASE"
 
     // Test
@@ -28,6 +29,7 @@ object Dependencies {
 
     val googleGson = "com.google.code.gson" % "gson" % Versions.gson
     val jacksonModule = "com.fasterxml.jackson.module" %% "jackson-module-scala" % Versions.jackson
+    val sl4jApi = "org.slf4j" % "slf4j-api" % Versions.sl4j
     val lettuceCore = "io.lettuce" % "lettuce-core" % Versions.lettuce
   }
 
@@ -51,5 +53,6 @@ object Dependencies {
     Compile.scalaCompiler,
     Compile.googleGson,
     Compile.jacksonModule,
+    Compile.sl4jApi,
     Compile.lettuceCore) ++ testing
 }
diff --git a/bbb-common-message/src/main/java/org/bigbluebutton/common2/redis/RedisStorageService.java b/bbb-common-message/src/main/java/org/bigbluebutton/common2/redis/RedisStorageService.java
new file mode 100644
index 0000000000..d4669ede5a
--- /dev/null
+++ b/bbb-common-message/src/main/java/org/bigbluebutton/common2/redis/RedisStorageService.java
@@ -0,0 +1,114 @@
+package org.bigbluebutton.common2.redis;
+
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import io.lettuce.core.ClientOptions;
+import io.lettuce.core.RedisClient;
+import io.lettuce.core.RedisURI;
+import io.lettuce.core.api.StatefulRedisConnection;
+import io.lettuce.core.api.sync.RedisCommands;
+
+public class RedisStorageService {
+
+    private static Logger log = LoggerFactory.getLogger(RedisStorageService.class);
+
+    private RedisClient redisClient;
+    private StatefulRedisConnection<String, String> connection;
+
+    private String host;
+    private String password;
+    private int port;
+    private String clientName;
+
+    public void start() {
+        log.info("Starting RedisStorageService");
+        RedisURI redisUri = RedisURI.Builder.redis(this.host, this.port)
+                .withClientName(this.clientName).build();
+        // @todo Add password if provided
+        // if (!this.password.isEmpty()) {
+        // redisUri.setPassword(this.password);
+        // }
+
+        redisClient = RedisClient.create(redisUri);
+        redisClient.setOptions(ClientOptions.builder().autoReconnect(true).build());
+
+        connection = redisClient.connect();
+    }
+
+    public void stop() {
+        connection.close();
+        redisClient.shutdown();
+        log.info("RedisStorageService Stopped");
+    }
+
+    public void recordMeetingInfo(String meetingId, Map<String, String> info) {
+        RedisCommands<String, String> commands = connection.sync();
+        try {
+            if (log.isDebugEnabled()) {
+                for (Map.Entry<String, String> entry : info.entrySet()) {
+                    log.debug("Storing metadata {} = {}", entry.getKey(), entry.getValue());
+                }
+            }
+
+            log.debug("Saving metadata in {}", meetingId);
+            commands.hmset("meeting:info:" + meetingId, info);
+        } catch (Exception e) {
+            log.warn("Cannot record the info meeting: {}", meetingId, e);
+        } finally {
+            connection.close();
+        }
+    }
+
+    public void recordBreakoutInfo(String meetingId, Map<String, String> breakoutInfo) {
+        RedisCommands<String, String> commands = connection.sync();
+        try {
+            log.debug("Saving breakout metadata in {}", meetingId);
+            commands.hmset("meeting:breakout:" + meetingId, breakoutInfo);
+        } catch (Exception e) {
+            log.warn("Cannot record the info meeting: {}", meetingId, e);
+        } finally {
+            connection.close();
+        }
+    }
+
+    public void addBreakoutRoom(String parentId, String breakoutId) {
+        RedisCommands<String, String> commands = connection.sync();
+        try {
+            log.debug("Saving breakout room for meeting {}", parentId);
+            commands.sadd("meeting:breakout:rooms:" + parentId, breakoutId);
+        } catch (Exception e) {
+            log.warn("Cannot record the info meeting:" + parentId, e);
+        } finally {
+            connection.close();
+        }
+    }
+
+    public void removeMeeting(String meetingId) {
+        RedisCommands<String, String> commands = connection.sync();
+        try {
+            commands.del("meeting-" + meetingId);
+            commands.srem("meetings", meetingId);
+        } finally {
+            connection.close();
+        }
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public void setClientName(String clientName) {
+        this.clientName = clientName;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public void setPort(int port) {
+        this.port = port;
+    }
+}
diff --git a/bbb-common-web/project/Dependencies.scala b/bbb-common-web/project/Dependencies.scala
index 4dfd075a9d..a42aa9a5cd 100644
--- a/bbb-common-web/project/Dependencies.scala
+++ b/bbb-common-web/project/Dependencies.scala
@@ -75,7 +75,6 @@ object Dependencies {
     val redisScala = "com.github.etaty" % "rediscala_2.12" % Versions.redisScala
     val jedis = "redis.clients" % "jedis" % Versions.jedis
 
-
     val bbbCommons = "org.bigbluebutton" % "bbb-common-message_2.12" % Versions.bbbCommons
   }
 
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 60aaf8ec38..4edf727275 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
@@ -48,7 +48,6 @@ import org.bigbluebutton.api.domain.RegisteredUser;
 import org.bigbluebutton.api.domain.User;
 import org.bigbluebutton.api.domain.UserSession;
 import org.bigbluebutton.api.messaging.MessageListener;
-import org.bigbluebutton.api.messaging.RedisStorageService;
 import org.bigbluebutton.api.messaging.converters.messages.DestroyMeetingMessage;
 import org.bigbluebutton.api.messaging.converters.messages.EndMeetingMessage;
 import org.bigbluebutton.api.messaging.messages.CreateBreakoutRoom;
@@ -77,6 +76,7 @@ import org.bigbluebutton.api.messaging.messages.UserStatusChanged;
 import org.bigbluebutton.api.messaging.messages.UserUnsharedWebcam;
 import org.bigbluebutton.api2.IBbbWebApiGWApp;
 import org.bigbluebutton.api2.domain.UploadedTrack;
+import org.bigbluebutton.common2.redis.RedisStorageService;
 import org.bigbluebutton.presentation.PresentationUrlDownloadService;
 import org.bigbluebutton.web.services.RegisteredUserCleanupTimerTask;
 import org.bigbluebutton.web.services.callback.CallbackUrlService;
diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/RedisStorageService.java b/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/RedisStorageService.java
deleted file mode 100755
index 180c95e5ce..0000000000
--- a/bbb-common-web/src/main/java/org/bigbluebutton/api/messaging/RedisStorageService.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package org.bigbluebutton.api.messaging;
-
-import java.util.Map;
-
-import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import redis.clients.jedis.Jedis;
-import redis.clients.jedis.JedisPool;
-import redis.clients.jedis.Protocol;
-
-public class RedisStorageService {
-  private static Logger log = LoggerFactory.getLogger(RedisStorageService.class);
-
-  private JedisPool redisPool;
-  private String host;
-  private int port;
-
-  public void stop() {
-
-  }
-
-  public void start() {
-    // Set the name of this client to be able to distinguish when doing
-    // CLIENT LIST on redis-cli
-    redisPool = new JedisPool(new GenericObjectPoolConfig<Object>(), host, port, Protocol.DEFAULT_TIMEOUT, null,
-      Protocol.DEFAULT_DATABASE, "BbbRed5AppsPub");
-  }
-
-  public void recordMeetingInfo(String meetingId, Map<String, String> info) {
-    Jedis jedis = redisPool.getResource();
-    try {
-      if (log.isDebugEnabled()) {
-        for (Map.Entry<String,String> entry : info.entrySet()) {
-          log.debug("Storing metadata {} = {}", entry.getKey(), entry.getValue());
-        }
-      }
-
-      log.debug("Saving metadata in {}", meetingId);
-      jedis.hmset("meeting:info:" + meetingId, info);
-    } catch (Exception e) {
-      log.warn("Cannot record the info meeting: {}", meetingId, e);
-    } finally {
-      jedis.close();
-    }
-  }
-
-  public void recordBreakoutInfo(String meetingId, Map<String, String> breakoutInfo) {
-    Jedis jedis = redisPool.getResource();
-    try {
-      log.debug("Saving breakout metadata in {}", meetingId);
-      jedis.hmset("meeting:breakout:" + meetingId, breakoutInfo);
-    } catch (Exception e) {
-      log.warn("Cannot record the info meeting: {}", meetingId, e);
-    } finally {
-      jedis.close();
-    }
-  }
-
-  public void addBreakoutRoom(String parentId, String breakoutId) {
-    Jedis jedis = redisPool.getResource();
-    try {
-
-      log.debug("Saving breakout room for meeting {}", parentId);
-      jedis.sadd("meeting:breakout:rooms:" + parentId, breakoutId);
-    } catch (Exception e) {
-      log.warn("Cannot record the info meeting:" + parentId, e);
-    } finally {
-      jedis.close();
-    }
-  }
-
-  public void removeMeeting(String meetingId) {
-    Jedis jedis = redisPool.getResource();
-    try {
-      jedis.del("meeting-" + meetingId);
-      jedis.srem("meetings", meetingId);
-    } finally {
-      jedis.close();
-    }
-  }
-
-  public void setHost(String host) {
-    this.host = host;
-  }
-
-  public void setPort(int port) {
-    this.port = port;
-  }
-}
diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/web/services/RedisStorageService.java b/bbb-common-web/src/main/java/org/bigbluebutton/web/services/RedisStorageService.java
deleted file mode 100755
index 3a45aedfd1..0000000000
--- a/bbb-common-web/src/main/java/org/bigbluebutton/web/services/RedisStorageService.java
+++ /dev/null
@@ -1,92 +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.web.services;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.bigbluebutton.api.domain.Poll;
-
-import redis.clients.jedis.Jedis;
-import redis.clients.jedis.JedisPool;
-
-public class RedisStorageService implements IStorageService{
-	JedisPool jedisPool;
-
-	private static final String SEPARATOR = ":";
-	private static final String ID_SEED = "nextID";
-
-	/* Meeting Patterns */
-	private static final String MEETING = "meeting";
-	private static final String POLL = "poll";
-	private static final String POLL_ANSWER = "answer";
-	private static final String POLL_RESULTS = "results";
-
-	/*
-meeting:<id>:poll:list [1,2,3] <-- list
-meeting:<id>:poll:<pollid> title, date <-- hash
-meeting:<id>:poll:<pollid>:answer:list [1,2,3] <-- list
-meeting:<id>:poll:<pollid>:answer:<answerid> answertext <-- key/value
-
-meeting:<id>:poll:<pollid>:answer:<answerid>:results [<userid>|1] <-- Set
-	*/
-
-	public String generatePollID(String meetingID){
-		Jedis jedis = (Jedis) jedisPool.getResource();
-		String pattern = getPollRedisPattern(meetingID);
-		String pollID = Long.toString(jedis.incr(pattern + SEPARATOR + ID_SEED));
-		jedisPool.returnResource(jedis);
-		return pollID;
-	}
-
-	public String generatePollAnswerID(String meetingID){
-		Jedis jedis = jedisPool.getResource();
-		String pattern = getPollRedisPattern(meetingID);
-		String pollID = Long.toString(jedis.incr(pattern + SEPARATOR + POLL_ANSWER + SEPARATOR + ID_SEED));
-		jedisPool.returnResource(jedis);
-		return pollID;
-	}
-
-	public void storePoll(Poll p){
-		Jedis jedis = jedisPool.getResource();
-		String pattern = getPollRedisPattern(p.getMeetingID());
-
-		HashMap<String,String> pollMap = p.toMap();
-		jedis.hmset(pattern + SEPARATOR + p.getPollID(), pollMap);
-		jedisPool.returnResource(jedis);
-	}
-
-	public void storePollAnswers(String meetingID, String pollID, Map<String,String> answers){
-		Jedis jedis = jedisPool.getResource();
-		String pattern = getPollRedisPattern(meetingID);
-
-		//HashMap<String,String> pollMap = p.toMap();
-		//jedis.hmset(pattern + SEPARATOR + p.getPollID + SEPARATOR + POLL_ANSWER + SEPARATOR + ID_SEED, pollMap);
-		//jedisPool.returnResource(jedis);	
-	}
-
-	private String getPollRedisPattern(String meetingID){
-		return MEETING + SEPARATOR + meetingID + SEPARATOR + POLL;
-	}
-
-	public void setJedisPool(JedisPool jedisPool){
-		this.jedisPool = jedisPool;
-	}
-}
\ No newline at end of file
diff --git a/bigbluebutton-web/build.gradle b/bigbluebutton-web/build.gradle
index e896556837..d514275a4c 100755
--- a/bigbluebutton-web/build.gradle
+++ b/bigbluebutton-web/build.gradle
@@ -2,9 +2,9 @@ apply plugin: 'java'
 apply plugin: 'eclipse'
 
 task resolveDeps(type: Copy) {
-    into('lib')
-    from configurations.default
-    from configurations.default.allArtifacts.file
+  into('lib')
+  from configurations.default
+  from configurations.default.allArtifacts.file
 }
 
 repositories {
@@ -13,40 +13,28 @@ repositories {
 }
 
 dependencies {
-	compile 'org.bigbluebutton:bbb-common-web:0.0.2-SNAPSHOT'
-
+  compile 'org.bigbluebutton:bbb-common-web:0.0.3-SNAPSHOT'
 
   // XML creation speedup
   compile 'org.freemarker:freemarker:2.3.28'
 
-	//junit
-	compile 'junit:junit:4.8.2'
+  //junit
+  compile 'junit:junit:4.12'
 
-	// Testing
-	testCompile 'org.testng:testng:5.8@jar'
-	testCompile 'org.easymock:easymock:2.4@jar'
+  // Testing
+  testCompile 'org.testng:testng:6.14.3@jar'
+  testCompile 'org.easymock:easymock:4.0.1@jar'
 }
 
 sourceSets {
-	main {
-			java {
-					srcDir 'src/java'
-			}
-			resources {
-					srcDir 'src/resources'
-			}
-	}
-	test {
-		java {
-				srcDir 'test/unit'
-		}
-		resources {
-				srcDir 'test/resources'
-		}
-}
-}
-
-test {
-	useTestNG()
+  main {
+    java { srcDir 'src/java' }
+    resources { srcDir 'src/resources' }
+  }
+  test {
+    java { srcDir 'test/unit' }
+    resources { srcDir 'test/resources' }
+  }
 }
 
+test { useTestNG() }
diff --git a/bigbluebutton-web/grails-app/conf/spring/bbb-redis-messaging.xml b/bigbluebutton-web/grails-app/conf/spring/bbb-redis-messaging.xml
deleted file mode 100755
index 3c8c2765b3..0000000000
--- a/bigbluebutton-web/grails-app/conf/spring/bbb-redis-messaging.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-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/>.
-
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-			http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
-			http://www.springframework.org/schema/util 
-			http://www.springframework.org/schema/util/spring-util-2.0.xsd
-			">
-
-
-
-</beans>
diff --git a/bigbluebutton-web/grails-app/conf/spring/bbb-redis-pool.xml b/bigbluebutton-web/grails-app/conf/spring/bbb-redis-pool.xml
index 7de4b5722c..c280096b92 100755
--- a/bigbluebutton-web/grails-app/conf/spring/bbb-redis-pool.xml
+++ b/bigbluebutton-web/grails-app/conf/spring/bbb-redis-pool.xml
@@ -26,7 +26,21 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 			http://www.springframework.org/schema/util 
 			http://www.springframework.org/schema/util/spring-util-2.0.xsd
 			">
-  	
 
-    
+	<bean id="redisMessageHandler"
+		class="org.bigbluebutton.api.messaging.ReceivedMessageHandler"
+		init-method="start" destroy-method="stop">
+	</bean>
+
+	<bean id="redisMessageDistributor" class="org.bigbluebutton.api.messaging.MessageDistributor">
+		<property name="messageHandler">
+			<ref local="redisMessageHandler" />
+		</property>
+		<property name="messageListeners">
+			<set>
+				<ref bean="meetingService" />
+				<ref bean="keepAliveService" />
+			</set>
+		</property>
+	</bean>
 </beans>
diff --git a/bigbluebutton-web/grails-app/conf/spring/resources.xml b/bigbluebutton-web/grails-app/conf/spring/resources.xml
index 098e37e48c..38f43c14eb 100755
--- a/bigbluebutton-web/grails-app/conf/spring/resources.xml
+++ b/bigbluebutton-web/grails-app/conf/spring/resources.xml
@@ -61,26 +61,12 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
         <constructor-arg index="3" value="${screenshareConfSuffix}"/>
     </bean>
 
-    <bean id="redisStorageService" class="org.bigbluebutton.api.messaging.RedisStorageService"
+    <bean id="redisStorageService" class="org.bigbluebutton.common2.redis.RedisStorageService"
           init-method="start" destroy-method="stop">
         <property name="host" value="${redisHost}"/>
         <property name="port" value="${redisPort}"/>
-    </bean>
-
-
-    <bean id="redisMessageHandler" class="org.bigbluebutton.api.messaging.ReceivedMessageHandler"
-          init-method="start" destroy-method="stop">
-    </bean>
-
-
-    <bean id="redisMessageDistributor" class="org.bigbluebutton.api.messaging.MessageDistributor">
-        <property name="messageHandler"> <ref local="redisMessageHandler"/> </property>
-        <property name="messageListeners">
-            <set>
-                <ref bean="meetingService" />
-                <ref bean="keepAliveService" />
-            </set>
-        </property>
+        <property name="password" value="${redisPassword:''}"/>
+        <property name="clientName" value="BbbRed5AppsPub"/>
     </bean>
 
     <bean id="recordingServiceHelper" class="org.bigbluebutton.api.util.RecordingMetadataReaderHelper">
@@ -155,8 +141,5 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
 
     <import resource="doc-conversion.xml"/>
     <import resource="bbb-redis-pool.xml"/>
-    <!--
-    <import resource="bbb-redis-messaging.xml"/>
-    -->
     <import resource="turn-stun-servers.xml"/>
 </beans>
diff --git a/bigbluebutton-web/pres-checker/build.gradle b/bigbluebutton-web/pres-checker/build.gradle
index c918e98807..dfb9bee22f 100755
--- a/bigbluebutton-web/pres-checker/build.gradle
+++ b/bigbluebutton-web/pres-checker/build.gradle
@@ -1,15 +1,15 @@
 apply plugin: 'java'
 
-sourceCompatibility=1.8
-targetCompatibility=1.8
+sourceCompatibility = 1.8
+targetCompatibility = 1.8
 
 version = '0.0.1'
-archivesBaseName = 'bbb-pres-check' 
+archivesBaseName = 'bbb-pres-check'
 
 task resolveDeps(type: Copy) {
-    into('lib')
-    from configurations.default
-    from configurations.default.allArtifacts.file
+  into('lib')
+  from configurations.default
+  from configurations.default.allArtifacts.file
 }
 
 repositories {
@@ -17,22 +17,21 @@ repositories {
   mavenLocal()
 }
 
-dependencies {	   
-   compile 'org.apache.poi:poi:3.17@jar'  
-   compile 'org.apache.poi:poi-ooxml:3.17@jar'
-   compile 'org.apache.poi:poi-ooxml-schemas:3.17@jar'
-   compile 'commons-io:commons-io:2.6@jar'
-   compile 'org.apache.commons:commons-lang3:3.7@jar'
-   compile 'org.apache.commons:commons-collections4:4.2@jar'
-   compile 'org.apache.xmlbeans:xmlbeans:3.0.0@jar'
+dependencies {
+  compile 'org.apache.poi:poi:4.0.0@jar'
+  compile 'org.apache.poi:poi-ooxml:4.0.0@jar'
+  compile 'org.apache.poi:poi-ooxml-schemas:4.0.0@jar'
+  compile 'commons-io:commons-io:2.6@jar'
+  compile 'org.apache.commons:commons-lang3:3.8.1@jar'
+  compile 'org.apache.commons:commons-collections4:4.2@jar'
+  compile 'org.apache.xmlbeans:xmlbeans:3.0.2@jar'
 }
 
 jar {
-   manifest.mainAttributes("Permissions": "all-permissions")
-   manifest.mainAttributes("Codebase": "*")
-   manifest.mainAttributes("Application-Name": "BigBlueButton Presentation Checker")
-   manifest.mainAttributes("Application-Library-Allowable-Codebase": "*")
-   manifest.mainAttributes("Caller-Allowable-Codebase": "*")
-   manifest.mainAttributes("Trusted-Only": "true")
+  manifest.mainAttributes("Permissions": "all-permissions")
+  manifest.mainAttributes("Codebase": "*")
+  manifest.mainAttributes("Application-Name": "BigBlueButton Presentation Checker")
+  manifest.mainAttributes("Application-Library-Allowable-Codebase": "*")
+  manifest.mainAttributes("Caller-Allowable-Codebase": "*")
+  manifest.mainAttributes("Trusted-Only": "true")
 }
-
diff --git a/bigbluebutton-web/test/unit/org/bigbluebutton/api/messaging/NullMessagingService.java b/bigbluebutton-web/test/unit/org/bigbluebutton/api/messaging/NullMessagingService.java
index 8c12f4d2d9..03ee0fdfa0 100644
--- a/bigbluebutton-web/test/unit/org/bigbluebutton/api/messaging/NullMessagingService.java
+++ b/bigbluebutton-web/test/unit/org/bigbluebutton/api/messaging/NullMessagingService.java
@@ -5,79 +5,65 @@ import java.util.Map;
 
 public class NullMessagingService implements MessagingService {
 
-	public void start() {
-		// TODO Auto-generated method stub
+    public void start() {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	public void stop() {
-		// TODO Auto-generated method stub
+    public void stop() {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	@Override
-	public void recordMeetingInfo(String meetingId, Map<String, String> info) {
-		// TODO Auto-generated method stub
+    @Override
+    public void recordMeetingInfo(String meetingId, Map<String, String> info) {
+        // TODO Auto-generated method stub
 
-	}
+    }
 
-	/*@Override
-	public void recordMeetingMetadata(String meetingId,
-			Map<String, String> metadata) {
-		// TODO Auto-generated method stub
+    /*
+     * @Override public void recordMeetingMetadata(String meetingId, Map<String,
+     * String> metadata) { // TODO Auto-generated method stub
+     * 
+     * }
+     */
 
-	}*/
+    public void addListener(MessageListener listener) {
+        // TODO Auto-generated method stub
 
-	@Override
-	public void endMeeting(String meetingId) {
-		// TODO Auto-generated method stub
+    }
 
-	}
+    public void removeListener(MessageListener listener) {
+        // TODO Auto-generated method stub
 
-	@Override
-	public void send(String channel, String message) {
-		// TODO Auto-generated method stub
+    }
 
-	}
+    public void destroyMeeting(String meetingID) {
+        // TODO Auto-generated method stub
 
-	public void addListener(MessageListener listener) {
-		// TODO Auto-generated method stub
+    }
 
-	}
+    public void createMeeting(String meetingID, String externalMeetingID, String meetingName, Boolean recorded,
+            String voiceBridge, Long duration) {
+        // TODO Auto-generated method stub
 
-	public void removeListener(MessageListener listener) {
-		// TODO Auto-generated method stub
+    }
 
-	}
+    public void sendPolls(String meetingId, String title, String question, String questionType, List<String> answers) {
+        // TODO Auto-generated method stub
 
-  public void destroyMeeting(String meetingID) {
-	  // TODO Auto-generated method stub
-	  
-  }
+    }
 
-  public void createMeeting(String meetingID, String externalMeetingID, String meetingName,
-      Boolean recorded, String voiceBridge, Long duration) {
-	  // TODO Auto-generated method stub
-	  
-  }
+    @Override
+    public void recordBreakoutInfo(String meetingId, Map<String, String> breakoutInfo) {
+        // TODO Auto-generated method stub
 
-  public void sendPolls(String meetingId, String title, String question,
-      String questionType, List<String> answers) {
-	  // TODO Auto-generated method stub
-	  
-  }
+    }
 
-	@Override
-  public void registerUser(String meetingID, String internalUserId,
-      String fullname, String role, String externUserID, String authToken, String avatarURL) {
-	  // TODO Auto-generated method stub
-	  
-  }
+    @Override
+    public void addBreakoutRoom(String parentId, String breakoutId) {
+        // TODO Auto-generated method stub
 
-	@Override
-  public void sendKeepAlive(String keepAliveId) {
-	  // TODO Auto-generated method stub
-	  
-  }
+    }
 
 }
-- 
GitLab