Commit c1024520 authored by Dele Olajide's avatar Dele Olajide

Jitsi Videobridge 1.3.2

Added support for clustering
parent 705864ad
...@@ -43,6 +43,12 @@ ...@@ -43,6 +43,12 @@
Jitsi Video Bridge Plugin Changelog Jitsi Video Bridge Plugin Changelog
</h1> </h1>
<p><b>1.3.2</b> -- Oct 30th, 2014</p>
<ul>
<li>Added support for clustering</li>
</ul>
<p><b>1.3.1</b> -- May 10th, 2014</p> <p><b>1.3.1</b> -- May 10th, 2014</p>
<ul> <ul>
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
<class>org.jitsi.videobridge.openfire.PluginImpl</class> <class>org.jitsi.videobridge.openfire.PluginImpl</class>
<description>Integrates Jitsi Video Bridge into Openfire.</description> <description>Integrates Jitsi Video Bridge into Openfire.</description>
<licenseType>LGPL</licenseType> <licenseType>LGPL</licenseType>
<minServerVersion>3.9.2</minServerVersion> <minServerVersion>3.10.0</minServerVersion>
<name>Jitsi Video Bridge</name> <name>Jitsi Video Bridge</name>
<version>1.3.1</version> <version>1.3.2</version>
<adminconsole> <adminconsole>
<tab id="tab-server"> <tab id="tab-server">
......
...@@ -45,7 +45,7 @@ public class Config extends HttpServlet ...@@ -45,7 +45,7 @@ public class Config extends HttpServlet
ServletOutputStream out = response.getOutputStream(); ServletOutputStream out = response.getOutputStream();
String iceServers = JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.iceservers", ""); String iceServers = JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.iceservers", "");
String resolution = JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.resolution", "720"); String resolution = JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.resolution", "360");
String audioBandwidth = JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.audio.bandwidth", "64"); String audioBandwidth = JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.audio.bandwidth", "64");
String videoBandwidth = JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.video.bandwidth", "512"); String videoBandwidth = JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.video.bandwidth", "512");
String useNicks = JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.usenicks", "false"); String useNicks = JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.usenicks", "false");
......
...@@ -24,6 +24,8 @@ import org.jivesoftware.openfire.container.*; ...@@ -24,6 +24,8 @@ import org.jivesoftware.openfire.container.*;
import org.jivesoftware.openfire.muc.*; import org.jivesoftware.openfire.muc.*;
import org.jivesoftware.util.*; import org.jivesoftware.util.*;
import org.jivesoftware.openfire.http.HttpBindManager; import org.jivesoftware.openfire.http.HttpBindManager;
import org.jivesoftware.openfire.cluster.ClusterEventListener;
import org.jivesoftware.openfire.cluster.ClusterManager;
import org.jivesoftware.openfire.XMPPServer; import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.handler.IQHandler; import org.jivesoftware.openfire.handler.IQHandler;
import org.jivesoftware.openfire.IQHandlerInfo; import org.jivesoftware.openfire.IQHandlerInfo;
...@@ -83,7 +85,7 @@ import org.ifsoft.rtp.*; ...@@ -83,7 +85,7 @@ import org.ifsoft.rtp.*;
* @author Lyubomir Marinov * @author Lyubomir Marinov
* @author Damian Minkov * @author Damian Minkov
*/ */
public class PluginImpl implements Plugin, PropertyEventListener public class PluginImpl implements Plugin, PropertyEventListener, ClusterEventListener
{ {
private static ConcurrentHashMap<String, FocusAgent> sessions; private static ConcurrentHashMap<String, FocusAgent> sessions;
/** /**
...@@ -216,9 +218,50 @@ public class PluginImpl implements Plugin, PropertyEventListener ...@@ -216,9 +218,50 @@ public class PluginImpl implements Plugin, PropertyEventListener
*/ */
private ExecutorService executorService; private ExecutorService executorService;
private File pluginDirectory;
/**
* Initializes this <tt>Plugin</tt>.
*
* @param manager the <tt>PluginManager</tt> which loads and manages this
* <tt>Plugin</tt>
* @param pluginDirectory the directory into which this <tt>Plugin</tt> is
* located
* @see Plugin#initializePlugin(PluginManager, File)
*/
public void initializePlugin(PluginManager manager, File pluginDirectory)
{
this.pluginDirectory = pluginDirectory;
boolean nodejs = XMPPServer.getInstance().getPluginManager().getPlugin("nodejs") != null;
if (nodejs)
{
Log.info("Jitsi Videobridge - Found NodeJs Plugin. Starting Etherpad");
JiveGlobals.setProperty("js.jitsivideobridge.etherpad.path", pluginDirectory.getAbsolutePath() + File.separator + "apps" + File.separator + "ofmeet");
JiveGlobals.setProperty("js.jitsivideobridge.etherpad", "node_modules/ep_etherpad-lite/node/server.js");
}
startComponent();
ClusterManager.addListener(this);
}
public void destroyPlugin() public void destroyPlugin()
{ {
Log.info("Jitsi Videobridge - destroyPlugin");
stopComponent();
ClusterManager.removeListener(this);
;
}
public void stopComponent()
{
Log.info("Jitsi Videobridge - stopComponent");
PropertyEventDispatcher.removeListener(this); PropertyEventDispatcher.removeListener(this);
executorService.shutdown(); executorService.shutdown();
...@@ -241,17 +284,10 @@ public class PluginImpl implements Plugin, PropertyEventListener ...@@ -241,17 +284,10 @@ public class PluginImpl implements Plugin, PropertyEventListener
destroyIQHandlers(); destroyIQHandlers();
} }
/** public void startComponent()
* Initializes this <tt>Plugin</tt>.
*
* @param manager the <tt>PluginManager</tt> which loads and manages this
* <tt>Plugin</tt>
* @param pluginDirectory the directory into which this <tt>Plugin</tt> is
* located
* @see Plugin#initializePlugin(PluginManager, File)
*/
public void initializePlugin(final PluginManager manager, final File pluginDirectory)
{ {
Log.info("Jitsi Videobridge - startComponent");
PropertyEventDispatcher.addListener(this); PropertyEventDispatcher.addListener(this);
System.setProperty("net.java.sip.communicator.SC_HOME_DIR_LOCATION", pluginDirectory.getPath()); System.setProperty("net.java.sip.communicator.SC_HOME_DIR_LOCATION", pluginDirectory.getPath());
...@@ -352,22 +388,46 @@ public class PluginImpl implements Plugin, PropertyEventListener ...@@ -352,22 +388,46 @@ public class PluginImpl implements Plugin, PropertyEventListener
{ {
ce.printStackTrace(System.err); ce.printStackTrace(System.err);
} }
}
});
}
boolean nodejs = XMPPServer.getInstance().getPluginManager().getPlugin("nodejs") != null; @Override
public void joinedCluster()
{
Log.info("Jitsi Videobridge - joinedCluster");
stopComponent();
}
if (nodejs) @Override
public void joinedCluster(byte[] arg0)
{ {
Log.info("Found NodeJs Plugin. Starting Etherpad");
JiveGlobals.setProperty("js.jitsivideobridge.etherpad.path", pluginDirectory.getAbsolutePath() + File.separator + "apps" + File.separator + "ofmeet");
JiveGlobals.setProperty("js.jitsivideobridge.etherpad", "node_modules/ep_etherpad-lite/node/server.js");
} }
@Override
public void leftCluster()
{
Log.info("Jitsi Videobridge - leftCluster");
startComponent();
} }
});
@Override
public void leftCluster(byte[] arg0)
{
} }
/** @Override
public void markedAsSeniorClusterMember()
{
Log.info("Jitsi Videobridge - markedAsSeniorClusterMember");
startComponent();
}
/**
*/ */
private static final SecurityHandler basicAuth(String username, String password, String realm) { private static final SecurityHandler basicAuth(String username, String password, String realm) {
......
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
<fmt:message key="config.page.configuration.ofmeet.resolution"/> <fmt:message key="config.page.configuration.ofmeet.resolution"/>
</td> </td>
<td><input type="text" size="10" maxlength="100" name="resolution" <td><input type="text" size="10" maxlength="100" name="resolution"
value="<%= JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.resolution", "720") %>"> value="<%= JiveGlobals.getProperty("org.jitsi.videobridge.ofmeet.resolution", "360") %>">
</td> </td>
</tr> </tr>
<tr> <tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment