Commit dcffb573 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Jive properties are now broken into two types -- XML properties from a local...

Jive properties are now broken into two types -- XML properties from a local config file and normal properties that are stored in the database.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@73 b35dd754-fafc-0310-a699-88a17e54d16e
parent dc2a48fd
......@@ -69,7 +69,7 @@ public class DbConnectionManager {
if (connectionProvider == null) {
// Attempt to load the connection provider classname as
// a Jive property.
String className = JiveGlobals.getJiveProperty("connectionProvider.className");
String className = JiveGlobals.getXMLProperty("connectionProvider.className");
if (className != null) {
// Attempt to load the class.
try {
......@@ -268,7 +268,7 @@ public class DbConnectionManager {
}
}
// Remember what connection provider we want to use for restarts.
JiveGlobals.setJiveProperty("connectionProvider.className",
JiveGlobals.setProperty("connectionProvider.className",
provider.getClass().getName());
}
......
......@@ -13,8 +13,6 @@ package org.jivesoftware.database;
import org.jivesoftware.util.Log;
import org.jivesoftware.messenger.JiveGlobals;
import org.jivesoftware.database.ConnectionPool;
import org.jivesoftware.database.ConnectionProvider;
import java.io.IOException;
import java.sql.Connection;
......@@ -276,15 +274,15 @@ public class DefaultConnectionProvider implements ConnectionProvider {
* Load properties that already exist from Jive properties.
*/
private void loadProperties() {
driver = JiveGlobals.getJiveProperty("database.defaultProvider.driver");
serverURL = JiveGlobals.getJiveProperty("database.defaultProvider.serverURL");
username = JiveGlobals.getJiveProperty("database.defaultProvider.username");
password = JiveGlobals.getJiveProperty("database.defaultProvider.password");
String minCons = JiveGlobals.getJiveProperty("database.defaultProvider.minConnections");
String maxCons = JiveGlobals.getJiveProperty("database.defaultProvider.maxConnections");
String conTimeout = JiveGlobals.getJiveProperty("database.defaultProvider.connectionTimeout");
driver = JiveGlobals.getXMLProperty("database.defaultProvider.driver");
serverURL = JiveGlobals.getXMLProperty("database.defaultProvider.serverURL");
username = JiveGlobals.getXMLProperty("database.defaultProvider.username");
password = JiveGlobals.getXMLProperty("database.defaultProvider.password");
String minCons = JiveGlobals.getXMLProperty("database.defaultProvider.minConnections");
String maxCons = JiveGlobals.getXMLProperty("database.defaultProvider.maxConnections");
String conTimeout = JiveGlobals.getXMLProperty("database.defaultProvider.connectionTimeout");
// See if we should use Unicode under MySQL
mysqlUseUnicode = Boolean.valueOf(JiveGlobals.getJiveProperty("database.mysql.useUnicode")).booleanValue();
mysqlUseUnicode = Boolean.valueOf(JiveGlobals.getXMLProperty("database.mysql.useUnicode")).booleanValue();
try {
if (minCons != null) {
minConnections = Integer.parseInt(minCons);
......@@ -307,16 +305,16 @@ public class DefaultConnectionProvider implements ConnectionProvider {
*/
private void saveProperties() {
JiveGlobals.setJiveProperty("database.defaultProvider.driver", driver);
JiveGlobals.setJiveProperty("database.defaultProvider.serverURL", serverURL);
JiveGlobals.setJiveProperty("database.defaultProvider.username", username);
JiveGlobals.setJiveProperty("database.defaultProvider.password", password);
JiveGlobals.setXMLProperty("database.defaultProvider.driver", driver);
JiveGlobals.setXMLProperty("database.defaultProvider.serverURL", serverURL);
JiveGlobals.setXMLProperty("database.defaultProvider.username", username);
JiveGlobals.setXMLProperty("database.defaultProvider.password", password);
JiveGlobals.setJiveProperty("database.defaultProvider.minConnections",
JiveGlobals.setXMLProperty("database.defaultProvider.minConnections",
Integer.toString(minConnections));
JiveGlobals.setJiveProperty("database.defaultProvider.maxConnections",
JiveGlobals.setXMLProperty("database.defaultProvider.maxConnections",
Integer.toString(maxConnections));
JiveGlobals.setJiveProperty("database.defaultProvider.connectionTimeout",
JiveGlobals.setXMLProperty("database.defaultProvider.connectionTimeout",
Double.toString(connectionTimeout));
}
}
......@@ -64,7 +64,7 @@ public class JNDIDataSourceProvider implements ConnectionProvider {
* Initialize.
*/
public JNDIDataSourceProvider() {
dataSourceName = JiveGlobals.getJiveProperty("database.JNDIProvider.name");
dataSourceName = JiveGlobals.getXMLProperty("database.JNDIProvider.name");
}
public String getName() {
......@@ -103,7 +103,7 @@ public class JNDIDataSourceProvider implements ConnectionProvider {
Properties contextProperties = new Properties();
for (int i = 0; i < jndiPropertyKeys.length; i++) {
String k = jndiPropertyKeys[i];
String v = JiveGlobals.getJiveProperty(k);
String v = JiveGlobals.getXMLProperty(k);
if (v != null) {
contextProperties.setProperty(k, v);
}
......@@ -157,7 +157,7 @@ public class JNDIDataSourceProvider implements ConnectionProvider {
public void setProperty(String name, String value) {
if ("name".equals(name)) {
this.dataSourceName = value;
JiveGlobals.setJiveProperty("database.JNDIProvider.name", value);
JiveGlobals.setXMLProperty("database.JNDIProvider.name", value);
}
}
......
......@@ -68,10 +68,10 @@ public abstract class AuthFactory {
// Get the cookie password, stored as a Jive property. Obviously,
// protecting your jive_config.xml file is critical for making cookie
// encryption secure.
String keyString = JiveGlobals.getJiveProperty("cookieKey");
String keyString = JiveGlobals.getProperty("cookieKey");
if (keyString == null) {
keyString = StringUtils.randomString(15);
JiveGlobals.setJiveProperty("cookieKey", keyString);
JiveGlobals.setProperty("cookieKey", keyString);
}
try {
sha = MessageDigest.getInstance("SHA");
......
......@@ -70,7 +70,7 @@ public class AuthProviderFactory {
if (authProvider == null) {
//See if the classname has been set as a Jive property.
String classNameProp =
JiveGlobals.getJiveProperty("AuthProvider.className");
JiveGlobals.getProperty("AuthProvider.className");
if (classNameProp != null) {
authClassName = classNameProp;
}
......@@ -103,7 +103,7 @@ public class AuthProviderFactory {
if (groupProvider == null) {
//See if the classname has been set as a Jive property.
String classNameProp =
JiveGlobals.getJiveProperty("GroupProvider.className");
JiveGlobals.getProperty("GroupProvider.className");
if (classNameProp != null) {
groupClassName = classNameProp;
}
......
......@@ -73,7 +73,7 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo {
probeResponse.add(DocumentHelper.createElement("digest"));
}
probeResponse.add(DocumentHelper.createElement("resource"));
anonymousAllowed = "true".equals(JiveGlobals.getJiveProperty("xmpp.auth.anonymous"));
anonymousAllowed = "true".equals(JiveGlobals.getProperty("xmpp.auth.anonymous"));
}
public synchronized IQ handleIQ(IQ packet) throws
......@@ -239,7 +239,7 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo {
public void setAllowAnonymous(boolean isAnonymous) throws UnauthorizedException {
anonymousAllowed = isAnonymous;
JiveGlobals.setJiveProperty("xmpp.auth.anonymous", anonymousAllowed ? "true" : "false");
JiveGlobals.setProperty("xmpp.auth.anonymous", anonymousAllowed ? "true" : "false");
}
public UserManager userManager;
......
......@@ -148,7 +148,7 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid
}
// Check for the default case where no inband property is set and
// make the default true (allowing inband registration)
String inband = JiveGlobals.getJiveProperty("register.inband");
String inband = JiveGlobals.getProperty("register.inband");
if (inband == null || "".equals(inband)) {
setInbandRegEnabled(true);
}
......@@ -367,7 +367,7 @@ public class IQRegisterHandler extends IQHandler implements ServerFeaturesProvid
public void setInbandRegEnabled(boolean allowed) {
enabled = allowed;
JiveGlobals.setJiveProperty("register.inband", enabled ? "true" : "false");
JiveGlobals.setProperty("register.inband", enabled ? "true" : "false");
}
private IQHandler getDelegate(XMPPAddress recipientJID) {
......
......@@ -90,8 +90,8 @@ public class LdapManager {
* constructor is private.
*/
private LdapManager() {
this.host = JiveGlobals.getJiveProperty("ldap.host");
String portStr = JiveGlobals.getJiveProperty("ldap.port");
this.host = JiveGlobals.getProperty("ldap.host");
String portStr = JiveGlobals.getProperty("ldap.port");
if (portStr != null) {
try {
this.port = Integer.parseInt(portStr);
......@@ -99,23 +99,23 @@ public class LdapManager {
catch (NumberFormatException nfe) {
}
}
if (JiveGlobals.getJiveProperty("ldap.usernameField") != null) {
this.usernameField = JiveGlobals.getJiveProperty("ldap.usernameField");
if (JiveGlobals.getProperty("ldap.usernameField") != null) {
this.usernameField = JiveGlobals.getProperty("ldap.usernameField");
}
if (JiveGlobals.getJiveProperty("ldap.baseDN") != null) {
this.baseDN = JiveGlobals.getJiveProperty("ldap.baseDN");
if (JiveGlobals.getProperty("ldap.baseDN") != null) {
this.baseDN = JiveGlobals.getProperty("ldap.baseDN");
}
if (JiveGlobals.getJiveProperty("ldap.nameField") != null) {
this.nameField = JiveGlobals.getJiveProperty("ldap.nameField");
if (JiveGlobals.getProperty("ldap.nameField") != null) {
this.nameField = JiveGlobals.getProperty("ldap.nameField");
}
if (JiveGlobals.getJiveProperty("ldap.emailField") != null) {
this.emailField = JiveGlobals.getJiveProperty("ldap.emailField");
if (JiveGlobals.getProperty("ldap.emailField") != null) {
this.emailField = JiveGlobals.getProperty("ldap.emailField");
}
this.adminDN = JiveGlobals.getJiveProperty("ldap.adminDN");
this.adminPassword = JiveGlobals.getJiveProperty("ldap.adminPassword");
this.debugEnabled = "true".equals(JiveGlobals.getJiveProperty("ldap.debugEnabled"));
this.sslEnabled = "true".equals(JiveGlobals.getJiveProperty("ldap.sslEnabled"));
String modeStr = JiveGlobals.getJiveProperty("ldap.mode");
this.adminDN = JiveGlobals.getProperty("ldap.adminDN");
this.adminPassword = JiveGlobals.getProperty("ldap.adminPassword");
this.debugEnabled = "true".equals(JiveGlobals.getProperty("ldap.debugEnabled"));
this.sslEnabled = "true".equals(JiveGlobals.getProperty("ldap.sslEnabled"));
String modeStr = JiveGlobals.getProperty("ldap.mode");
if (modeStr != null) {
try {
this.mode = Integer.parseInt(modeStr);
......@@ -283,7 +283,7 @@ public class LdapManager {
*/
public void setHost(String host) {
this.host = host;
JiveGlobals.setJiveProperty("ldap.host", host);
JiveGlobals.setProperty("ldap.host", host);
}
/**
......@@ -304,7 +304,7 @@ public class LdapManager {
*/
public void setPort(int port) {
this.port = port;
JiveGlobals.setJiveProperty("ldap.port", "" + port);
JiveGlobals.setProperty("ldap.port", "" + port);
}
/**
......@@ -327,7 +327,7 @@ public class LdapManager {
*/
public void setDebugEnabled(boolean debugEnabled) {
this.debugEnabled = debugEnabled;
JiveGlobals.setJiveProperty("ldap.debuggingEnabled", "" + debugEnabled);
JiveGlobals.setProperty("ldap.debuggingEnabled", "" + debugEnabled);
}
/**
......@@ -368,10 +368,10 @@ public class LdapManager {
public void setUsernameField(String usernameField) {
this.usernameField = usernameField;
if (usernameField == null) {
JiveGlobals.deleteJiveProperty("ldap.usernameField");
JiveGlobals.deleteProperty("ldap.usernameField");
}
else {
JiveGlobals.setJiveProperty("ldap.usernameField", usernameField);
JiveGlobals.setProperty("ldap.usernameField", usernameField);
}
}
......@@ -394,10 +394,10 @@ public class LdapManager {
public void setNameField(String nameField) {
this.nameField = nameField;
if (nameField == null) {
JiveGlobals.deleteJiveProperty("ldap.nameField");
JiveGlobals.deleteProperty("ldap.nameField");
}
else {
JiveGlobals.setJiveProperty("ldap.nameField", nameField);
JiveGlobals.setProperty("ldap.nameField", nameField);
}
}
......@@ -422,10 +422,10 @@ public class LdapManager {
public void setEmailField(String emailField) {
this.emailField = emailField;
if (emailField == null) {
JiveGlobals.deleteJiveProperty("ldap.emailField");
JiveGlobals.deleteProperty("ldap.emailField");
}
else {
JiveGlobals.setJiveProperty("ldap.emailField", emailField);
JiveGlobals.setProperty("ldap.emailField", emailField);
}
}
......@@ -447,7 +447,7 @@ public class LdapManager {
*/
public void setBaseDN(String baseDN) {
this.baseDN = baseDN;
JiveGlobals.setJiveProperty("ldap.baseDN", baseDN);
JiveGlobals.setProperty("ldap.baseDN", baseDN);
}
/**
......@@ -468,7 +468,7 @@ public class LdapManager {
*/
public void setAdminDN(String adminDN) {
this.adminDN = adminDN;
JiveGlobals.setJiveProperty("ldap.adminDN", adminDN);
JiveGlobals.setProperty("ldap.adminDN", adminDN);
}
/**
......@@ -489,7 +489,7 @@ public class LdapManager {
*/
public void setAdminPassword(String adminPassword) {
this.adminPassword = adminPassword;
JiveGlobals.setJiveProperty("ldap.adminPassword", adminPassword);
JiveGlobals.setProperty("ldap.adminPassword", adminPassword);
}
/**
......@@ -514,6 +514,6 @@ public class LdapManager {
*/
public void setMode(int mode) {
this.mode = mode;
JiveGlobals.setJiveProperty("ldap.mode", "" + mode);
JiveGlobals.setProperty("ldap.mode", "" + mode);
}
}
\ No newline at end of file
......@@ -40,36 +40,36 @@ public class SSLConfig {
}
static {
String algorithm = JiveGlobals.getJiveProperty("xmpp.socket.ssl.algorithm");
String algorithm = JiveGlobals.getProperty("xmpp.socket.ssl.algorithm");
if ("".equals(algorithm) || algorithm == null) {
algorithm = "TLS";
}
String storeType = JiveGlobals.getJiveProperty("xmpp.socket.ssl.storeType");
String storeType = JiveGlobals.getProperty("xmpp.socket.ssl.storeType");
if ("".equals(storeType)) {
storeType = null;
}
keystore = JiveGlobals.getJiveProperty("xmpp.socket.ssl.keystore");
keystore = JiveGlobals.getProperty("xmpp.socket.ssl.keystore");
if ("".equals(keystore) || keystore == null) {
keystore = null;
}
else {
keystore = JiveGlobals.getJiveHome() + File.separator + keystore;
}
keypass = JiveGlobals.getJiveProperty("xmpp.socket.ssl.keypass");
keypass = JiveGlobals.getProperty("xmpp.socket.ssl.keypass");
if (keypass == null) {
keypass = "";
}
else {
keypass = keypass.trim();
}
truststore = JiveGlobals.getJiveProperty("xmpp.socket.ssl.truststore");
truststore = JiveGlobals.getProperty("xmpp.socket.ssl.truststore");
if ("".equals(truststore) || truststore == null) {
truststore = null;
}
else {
truststore = JiveGlobals.getJiveHome() + File.separator + truststore;
}
trustpass = JiveGlobals.getJiveProperty("xmpp.socket.ssl.trustpass");
trustpass = JiveGlobals.getProperty("xmpp.socket.ssl.trustpass");
if (trustpass == null) {
trustpass = "";
}
......
......@@ -69,12 +69,12 @@ public class SSLSocketAcceptThread extends Thread {
super("SSL accept");
this.connManager = connManager;
int port = SSLSocketAcceptThread.DEFAULT_PORT;
String portName = JiveGlobals.getJiveProperty("xmpp.socket.ssl.port");
String portName = JiveGlobals.getProperty("xmpp.socket.ssl.port");
if (portName != null) {
port = Integer.parseInt(portName);
}
String interfaceName = JiveGlobals.getJiveProperty("xmpp.socket.ssl.interface");
String interfaceName = JiveGlobals.getProperty("xmpp.socket.ssl.interface");
bindInterface = null;
if (interfaceName != null) {
try {
......
......@@ -59,11 +59,11 @@ public class SocketAcceptThread extends Thread {
super("SAT accept");
this.connManager = connManager;
port = SocketAcceptThread.DEFAULT_PORT;
String portName = JiveGlobals.getJiveProperty("xmpp.socket.plain.port");
String portName = JiveGlobals.getProperty("xmpp.socket.plain.port");
if (portName != null) {
port = Integer.parseInt(portName);
}
String interfaceName = JiveGlobals.getJiveProperty("xmpp.socket.plain.interface");
String interfaceName = JiveGlobals.getProperty("xmpp.socket.plain.interface");
bindInterface = null;
if (interfaceName != null) {
try {
......
......@@ -67,7 +67,7 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana
}
// Now start up the acceptor (and associated read selector)
if ("true".equals(JiveGlobals.getJiveProperty("xmpp.socket.plain.active"))) {
if ("true".equals(JiveGlobals.getProperty("xmpp.socket.plain.active"))) {
socketThread = new SocketAcceptThread(this);
ports.add(new ServerPortImpl(socketThread.getPort(),
serverName,
......@@ -81,11 +81,11 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana
params.add(Integer.toString(socketThread.getPort()));
Log.info(LocaleUtils.getLocalizedString("startup.plain", params));
}
if ("true".equals(JiveGlobals.getJiveProperty("xmpp.socket.ssl.active"))) {
if ("true".equals(JiveGlobals.getProperty("xmpp.socket.ssl.active"))) {
try {
sslSocketThread = new SSLSocketAcceptThread(this);
String algorithm =
JiveGlobals.getJiveProperty("xmpp.socket.ssl.algorithm");
JiveGlobals.getProperty("xmpp.socket.ssl.algorithm");
if ("".equals(algorithm) || algorithm == null) {
algorithm = "TLS";
}
......
......@@ -105,7 +105,7 @@ public class UserProviderFactory {
for (int i = 0; i < classNames.length; i++) {
String className = classNames[i];
//See if the classname has been set as a Jive property.
String classNameProp = JiveGlobals.getJiveProperty(propNames[i]);
String classNameProp = JiveGlobals.getProperty(propNames[i]);
if (classNameProp != null) {
className = classNameProp;
}
......
......@@ -63,7 +63,7 @@ public class Log {
*/
public static void initLog() {
try {
logDirectory = JiveGlobals.getLocalProperty("log.directory");
logDirectory = JiveGlobals.getXMLProperty("log.directory");
if (logDirectory == null) {
if (JiveGlobals.getJiveHome() != null) {
File jiveHome = new File(JiveGlobals.getJiveHome());
......@@ -88,21 +88,21 @@ public class Log {
logNameWarn = logDirectory + "jive.warn.log";
logNameError = logDirectory + "jive.error.log";
debugPattern = JiveGlobals.getLocalProperty("log.debug.format");
infoPattern = JiveGlobals.getLocalProperty("log.info.format");
warnPattern = JiveGlobals.getLocalProperty("log.warn.format");
errorPattern = JiveGlobals.getLocalProperty("log.error.format");
debugPattern = JiveGlobals.getXMLProperty("log.debug.format");
infoPattern = JiveGlobals.getXMLProperty("log.info.format");
warnPattern = JiveGlobals.getXMLProperty("log.warn.format");
errorPattern = JiveGlobals.getXMLProperty("log.error.format");
try { maxDebugSize = Long.parseLong(JiveGlobals.getLocalProperty("log.debug.size")); }
try { maxDebugSize = Long.parseLong(JiveGlobals.getXMLProperty("log.debug.size")); }
catch (NumberFormatException e) { /* ignore */ }
try { maxInfoSize = Long.parseLong(JiveGlobals.getLocalProperty("log.info.size")); }
try { maxInfoSize = Long.parseLong(JiveGlobals.getXMLProperty("log.info.size")); }
catch (NumberFormatException e) { /* ignore */ }
try { maxWarnSize = Long.parseLong(JiveGlobals.getLocalProperty("log.warn.size")); }
try { maxWarnSize = Long.parseLong(JiveGlobals.getXMLProperty("log.warn.size")); }
catch (NumberFormatException e) { /* ignore */ }
try { maxErrorSize = Long.parseLong(JiveGlobals.getLocalProperty("log.error.size")); }
try { maxErrorSize = Long.parseLong(JiveGlobals.getXMLProperty("log.error.size")); }
catch (NumberFormatException e) { /* ignore */ }
debugEnabled = "true".equals(JiveGlobals.getLocalProperty("log.debug.enabled"));
debugEnabled = "true".equals(JiveGlobals.getXMLProperty("log.debug.enabled"));
}
catch (Exception e) {
// we'll get an exception if jiveHome isn't setup yet - we ignore that since
......@@ -186,7 +186,7 @@ public class Log {
}
public static void setDebugEnabled(boolean enabled) {
JiveGlobals.setLocalProperty("log.debug.enabled", Boolean.toString(enabled));
JiveGlobals.setXMLProperty("log.debug.enabled", Boolean.toString(enabled));
debugEnabled = enabled;
}
......
......@@ -14,7 +14,7 @@
isErrorPage="true"
%>
<% boolean debug = "true".equals(JiveGlobals.getJiveProperty("skin.default.debug"));
<% boolean debug = "true".equals(JiveGlobals.getProperty("skin.default.debug"));
if (debug) {
exception.printStackTrace();
}
......
......@@ -27,7 +27,7 @@
<%! // List of allowed usernames:
static Map allowedUsernames = null;
static String allowedUsernameProp = JiveGlobals.getJiveProperty("admin.login.allowedUsernames");
static String allowedUsernameProp = JiveGlobals.getProperty("admin.login.allowedUsernames");
static {
if (allowedUsernameProp != null) {
StringTokenizer tokenizer = new StringTokenizer(allowedUsernameProp, ",");
......
......@@ -343,12 +343,12 @@ String log = ParamUtils.getParameter(request, "log");
// Enable/disable debugging
if (request.getParameter("wasDebugEnabled") != null && wasDebugEnabled != debugEnabled) {
JiveGlobals.setJiveProperty("log.debug.enabled",String.valueOf(debugEnabled));
JiveGlobals.setProperty("log.debug.enabled",String.valueOf(debugEnabled));
response.sendRedirect("logviewer.jsp?log=debug&debugAlert=true");
return;
}
debugEnabled = "true".equals(JiveGlobals.getJiveProperty("log.debug.enabled"));
debugEnabled = "true".equals(JiveGlobals.getProperty("log.debug.enabled"));
// Set defaults
if (log == null) {
......
......@@ -24,7 +24,7 @@
<%! // Global vars, methods, etc
void setSetupFinished(HttpSession session) {
JiveGlobals.setJiveProperty("setup","true");
JiveGlobals.setXMLProperty("setup","true");
// update the sidebar status
session.setAttribute("jive.setup.sidebar.4","done");
}
......
......@@ -48,11 +48,11 @@
// if no errors, continue
if (errors.size() == 0) {
// Set the JNDI connection class property in the jive props file
JiveGlobals.setJiveProperty("connectionProvider.className",
JiveGlobals.setProperty("connectionProvider.className",
"org.jivesoftware.database.JNDIDataSourceProvider");
// Save the name (must do this *first* before initializing
// the JNDIDataSourceProvider
JiveGlobals.setJiveProperty("database.JNDIProvider.name",lookupName);
JiveGlobals.setProperty("database.JNDIProvider.name",lookupName);
// Use the Jive default connection provider
JNDIDataSourceProvider conProvider = new JNDIDataSourceProvider();
conProvider.setProperty("name", lookupName);
......
......@@ -43,7 +43,7 @@
}
else if (EMBEDDED.equals(mode)) {
// Set the classname of the provider in the config file:
JiveGlobals.setJiveProperty("connectionProvider.className",
JiveGlobals.setProperty("connectionProvider.className",
"org.jivesoftware.database.EmbeddedConnectionProvider");
ConnectionProvider conProvider = new EmbeddedConnectionProvider();
DbConnectionManager.setConnectionProvider(conProvider);
......
......@@ -74,7 +74,7 @@
// set properties, test connection, etc
// Force the standard jive connection provider to be used by deleting the current setting:
JiveGlobals.setJiveProperty("connectionProvider.className",
JiveGlobals.setProperty("connectionProvider.className",
"org.jivesoftware.database.DefaultConnectionProvider");
DefaultConnectionProvider conProvider = new DefaultConnectionProvider();
try {
......@@ -86,16 +86,16 @@
conProvider.setUsername(username);
conProvider.setPassword(password);
JiveGlobals.setJiveProperty("database.defaultProvider.driver", driver);
JiveGlobals.setJiveProperty("database.defaultProvider.serverURL", serverURL);
JiveGlobals.setJiveProperty("database.defaultProvider.username", username);
JiveGlobals.setJiveProperty("database.defaultProvider.password", password);
JiveGlobals.setProperty("database.defaultProvider.driver", driver);
JiveGlobals.setProperty("database.defaultProvider.serverURL", serverURL);
JiveGlobals.setProperty("database.defaultProvider.username", username);
JiveGlobals.setProperty("database.defaultProvider.password", password);
JiveGlobals.setJiveProperty("database.defaultProvider.minConnections",
JiveGlobals.setProperty("database.defaultProvider.minConnections",
Integer.toString(minConnections));
JiveGlobals.setJiveProperty("database.defaultProvider.maxConnections",
JiveGlobals.setProperty("database.defaultProvider.maxConnections",
Integer.toString(maxConnections));
JiveGlobals.setJiveProperty("database.defaultProvider.connectionTimeout",
JiveGlobals.setProperty("database.defaultProvider.connectionTimeout",
Double.toString(connectionTimeout));
}
catch (Exception e) {
......@@ -118,27 +118,27 @@
if (!doContinue) {
// reset values of jdbc driver from props file
driver = JiveGlobals.getJiveProperty("database.defaultProvider.driver");
serverURL = JiveGlobals.getJiveProperty("database.defaultProvider.serverURL");
username = JiveGlobals.getJiveProperty("database.defaultProvider.username");
password = JiveGlobals.getJiveProperty("database.defaultProvider.password");
driver = JiveGlobals.getProperty("database.defaultProvider.driver");
serverURL = JiveGlobals.getProperty("database.defaultProvider.serverURL");
username = JiveGlobals.getProperty("database.defaultProvider.username");
password = JiveGlobals.getProperty("database.defaultProvider.password");
try {
minConnections = Integer.parseInt(
JiveGlobals.getJiveProperty("database.defaultProvider.minConnections"));
JiveGlobals.getProperty("database.defaultProvider.minConnections"));
}
catch (Exception e) {
minConnections = 5;
}
try {
maxConnections = Integer.parseInt(
JiveGlobals.getJiveProperty("database.defaultProvider.maxConnections"));
JiveGlobals.getProperty("database.defaultProvider.maxConnections"));
}
catch (Exception e) {
maxConnections = 15;
}
try {
connectionTimeout = Double.parseDouble(
JiveGlobals.getJiveProperty("database.defaultProvider.connectionTimeout"));
JiveGlobals.getProperty("database.defaultProvider.connectionTimeout"));
}
catch (Exception e) {
connectionTimeout = 1.0;
......
......@@ -51,13 +51,13 @@
}
// Continue if there were no errors
if (errors.size() == 0) {
JiveGlobals.setJiveProperty("xmpp.domain",domain);
JiveGlobals.setJiveProperty("xmpp.chat.domain",chatDomain);
JiveGlobals.setJiveProperty("xmpp.socket.plain.port",Integer.toString(port));
JiveGlobals.setJiveProperty("embedded-web.port",Integer.toString(embeddedPort));
JiveGlobals.setJiveProperty("xmpp.socket.ssl.active",""+sslEnabled);
JiveGlobals.setJiveProperty("xmpp.socket.ssl.port",Integer.toString(sslPort));
JiveGlobals.setJiveProperty("xmpp.auth.anonymous", "true" );
JiveGlobals.setProperty("xmpp.domain",domain);
JiveGlobals.setProperty("xmpp.chat.domain",chatDomain);
JiveGlobals.setProperty("xmpp.socket.plain.port",Integer.toString(port));
JiveGlobals.setProperty("embedded-web.port",Integer.toString(embeddedPort));
JiveGlobals.setProperty("xmpp.socket.ssl.active",""+sslEnabled);
JiveGlobals.setProperty("xmpp.socket.ssl.port",Integer.toString(sslPort));
JiveGlobals.setProperty("xmpp.auth.anonymous", "true" );
// JiveGlobals.setProperty("xmpp.socket.ssl.storeType",storeType);
// JiveGlobals.setProperty("xmpp.socket.ssl.keystore",keystore);
// JiveGlobals.setProperty("xmpp.socket.ssl.keypass",keypass);
......@@ -76,23 +76,23 @@
// Load the current values:
if (!doContinue) {
domain = JiveGlobals.getJiveProperty("xmpp.domain");
chatDomain = JiveGlobals.getJiveProperty("xmpp.chat.domain");
domain = JiveGlobals.getProperty("xmpp.domain");
chatDomain = JiveGlobals.getProperty("xmpp.chat.domain");
// storeType = JiveGlobals.getProperty("xmpp.socket.ssl.storeType");
// keystore = JiveGlobals.getProperty("xmpp.socket.ssl.keystore");
// keypass = JiveGlobals.getProperty("xmpp.socket.ssl.keypass");
// truststore = JiveGlobals.getProperty("xmpp.socket.ssl.truststore");
// trustpass = JiveGlobals.getProperty("xmpp.socket.ssl.trustpass");
try {
port = Integer.parseInt(JiveGlobals.getJiveProperty("xmpp.socket.plain.port"));
port = Integer.parseInt(JiveGlobals.getProperty("xmpp.socket.plain.port"));
} catch (Exception ignored) {}
try {
embeddedPort = Integer.parseInt(JiveGlobals.getJiveProperty("embedded-web.port"));
embeddedPort = Integer.parseInt(JiveGlobals.getProperty("embedded-web.port"));
} catch (Exception ignored) {}
try {
sslPort = Integer.parseInt(JiveGlobals.getJiveProperty("xmpp.socket.ssl.port"));
sslPort = Integer.parseInt(JiveGlobals.getProperty("xmpp.socket.ssl.port"));
} catch (Exception ignored) {}
sslEnabled = "true".equals(JiveGlobals.getJiveProperty("xmpp.socket.ssl.active"));
sslEnabled = "true".equals(JiveGlobals.getProperty("xmpp.socket.ssl.active"));
// If the domain and chat domain are still blank, guess at their values:
if (domain == null) {
......
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