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