-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XX-11117 move openfire configuration to mongo
- Loading branch information
Cristi Ciuc Starasciuc
committed
Jun 5, 2014
1 parent
9957e42
commit 30d203e
Showing
77 changed files
with
7,580 additions
and
1,132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
include $(top_srcdir)/config/utility.am | ||
include $(top_srcdir)/config/java.am | ||
include $(top_srcdir)/common.am | ||
|
||
EXTRA_DIST = \ | ||
$(cfg_SRC) \ | ||
$(test_SRC) | ||
|
||
noinst_DATA = \ | ||
javac-cfg | ||
|
||
cfg_JAR = sipx-ofmongo-lib.jar | ||
jar_DATA = $(cfg_JAR) | ||
jardir = @SIPX_JAVADIR@/sipXopenfire/lib | ||
|
||
cfg_DEPS = \ | ||
$(call JavaDep,@SIPX_JAVADIR@/sipXcommons,$(plugin_PKGS)) \ | ||
@OPENFIRE_HOME@/lib/openfire.jar \ | ||
${vcardsynchserver_JAVAROOT}/sipx-openfire-vcard-synchserver.jar | ||
|
||
cfg_SRC = \ | ||
$(shell cd $(srcdir); find src -name '*.java') | ||
|
||
$(cfg_JAR) : javac-cfg | ||
jar -cf $@ \ | ||
$(call JarInclude,$(mongolib_JAVAROOT),.) | ||
|
||
test_JAVAROOT = classes.test | ||
test_PKGS = \ | ||
$(openfire_PKGS) \ | ||
junit \ | ||
easymock \ | ||
commons-io \ | ||
sipxcommons | ||
|
||
test_DEPS = \ | ||
$(call JavaDep,@SIPX_JAVADIR@/sipXcommons @SIPX_JAVADIR@/sipXconfig,$(test_PKGS)) | ||
|
||
test_SRC = $(shell cd $(srcdir); find test -name '*.java') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
include $(top_srcdir)/config/utility.am | ||
include $(top_srcdir)/config/java.am | ||
include $(top_srcdir)/common.am | ||
|
||
EXTRA_DIST = \ | ||
$(cfg_SRC) | ||
|
||
noinst_DATA = \ | ||
javac-cfg | ||
|
||
cfg_JAR = sipx-ofmongo-lib.jar | ||
jar_DATA = $(cfg_JAR) | ||
jardir = @SIPX_JAVADIR@/sipXopenfire/lib | ||
|
||
cfg_DEPS = \ | ||
$(call JavaDep,@SIPX_JAVADIR@/sipXcommons,$(plugin_PKGS)) \ | ||
@OPENFIRE_HOME@/lib/openfire.jar \ | ||
@SIPX_JAVADIR@/sipXopenfire/lib/sipx-openfire-vcard-synchserver.jar | ||
|
||
cfg_SRC = \ | ||
$(shell cd $(srcdir); find . -name '*.java') | ||
|
||
$(cfg_JAR) : javac-cfg | ||
jar -cf $@ \ | ||
$(call JarInclude,$(mongolib_JAVAROOT),.) |
122 changes: 122 additions & 0 deletions
122
sipXopenfire/mongo-lib/src/org/sipfoundry/openfire/connection/MongoConnMgrWrapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
package org.sipfoundry.openfire.connection; | ||
|
||
import java.sql.Connection; | ||
import java.sql.DatabaseMetaData; | ||
import java.sql.SQLException; | ||
|
||
import org.jivesoftware.database.ConnectionProvider; | ||
import org.jivesoftware.openfire.container.Plugin; | ||
import org.jivesoftware.openfire.provider.ConnectionManagerWrapper; | ||
|
||
/** | ||
* Wraps access to mongodb-enabled storage | ||
* | ||
* @see ConnectionManagerWrapper | ||
* @author Alex Mateescu | ||
* | ||
*/ | ||
public class MongoConnMgrWrapper implements ConnectionManagerWrapper { | ||
|
||
private static boolean profilingEnabled; | ||
private static ConnectionProvider provider; | ||
private static final Object PROVIDER_LOCK = new Object(); | ||
|
||
/** | ||
* {@inheritDoc} <br/> | ||
* Newer versions of openuc provide an up-to-date schema. Nothing to do here. | ||
*/ | ||
@Override | ||
public boolean checkPluginSchema(Plugin plugin) { | ||
return true; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} <br/> | ||
*/ | ||
@Override | ||
public DatabaseMetaData getMetaData() throws SQLException { | ||
return new MongoMetaData(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public String getTestQuery(String driver) { | ||
return ""; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public int getTransactionIsolation() { | ||
return Connection.TRANSACTION_NONE; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public boolean isEmbeddedDB() { | ||
return false; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public boolean isProfilingEnabled() { | ||
return profilingEnabled; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public boolean isSetupMode() { | ||
return provider == null; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void setConnectionProvider(ConnectionProvider provider) { | ||
synchronized (new byte[0]) { | ||
MongoConnMgrWrapper.provider = provider; | ||
} | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public ConnectionProvider getConnectionProvider() { | ||
return provider; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void setProfilingEnabled(boolean enabled) { | ||
synchronized (new byte[0]) { | ||
profilingEnabled = enabled; | ||
} | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void shutdown() { | ||
synchronized (PROVIDER_LOCK) { | ||
if (provider != null) { | ||
provider.destroy(); | ||
provider = null; | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.