Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
d34719d8
Commit
d34719d8
authored
Nov 14, 2014
by
Dave Cridland
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #113 from tevans/OF-850
OF-850: Improve default initialization state
parents
2f2f5ba5
c9ef9d1b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
41 deletions
+31
-41
DbConnectionManager.java
src/java/org/jivesoftware/database/DbConnectionManager.java
+4
-0
JiveGlobals.java
src/java/org/jivesoftware/util/JiveGlobals.java
+23
-41
XMLProperties.java
src/java/org/jivesoftware/util/XMLProperties.java
+4
-0
No files found.
src/java/org/jivesoftware/database/DbConnectionManager.java
View file @
d34719d8
...
...
@@ -29,6 +29,7 @@ import java.sql.PreparedStatement;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.util.MissingResourceException
;
import
org.jivesoftware.util.ClassUtils
;
import
org.jivesoftware.util.JiveGlobals
;
...
...
@@ -619,6 +620,9 @@ public class DbConnectionManager {
// Check to see if the database schema needs to be upgraded.
schemaManager
.
checkOpenfireSchema
(
con
);
}
catch
(
MissingResourceException
mre
)
{
Log
.
error
(
mre
.
getMessage
());
}
catch
(
Exception
e
)
{
Log
.
error
(
e
.
getMessage
(),
e
);
}
...
...
src/java/org/jivesoftware/util/JiveGlobals.java
View file @
d34719d8
...
...
@@ -28,7 +28,6 @@ import java.sql.SQLException;
import
java.text.DateFormat
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -316,12 +315,6 @@ public class JiveGlobals {
if
(
openfireProperties
==
null
)
{
loadOpenfireProperties
();
}
// home not loaded?
if
(
openfireProperties
==
null
)
{
return
null
;
}
return
openfireProperties
.
getProperty
(
name
);
}
...
...
@@ -349,11 +342,6 @@ public class JiveGlobals {
loadOpenfireProperties
();
}
// home not loaded?
if
(
openfireProperties
==
null
)
{
return
defaultValue
;
}
String
value
=
openfireProperties
.
getProperty
(
name
);
if
(
value
==
null
)
{
value
=
defaultValue
;
...
...
@@ -445,11 +433,7 @@ public class JiveGlobals {
if
(
openfireProperties
==
null
)
{
loadOpenfireProperties
();
}
// jiveHome not loaded?
if
(
openfireProperties
!=
null
)
{
openfireProperties
.
setProperty
(
name
,
value
);
}
openfireProperties
.
setProperty
(
name
,
value
);
}
/**
...
...
@@ -472,10 +456,7 @@ public class JiveGlobals {
if
(
openfireProperties
==
null
)
{
loadOpenfireProperties
();
}
if
(
openfireProperties
!=
null
)
{
openfireProperties
.
setProperties
(
propertyMap
);
}
openfireProperties
.
setProperties
(
propertyMap
);
}
/**
...
...
@@ -505,11 +486,6 @@ public class JiveGlobals {
loadOpenfireProperties
();
}
// jiveHome not loaded?
if
(
openfireProperties
==
null
)
{
return
Collections
.
EMPTY_LIST
;
}
String
[]
propNames
=
openfireProperties
.
getChildrenProperties
(
parent
);
List
<
String
>
values
=
new
ArrayList
<
String
>();
for
(
String
propName
:
propNames
)
{
...
...
@@ -518,7 +494,6 @@ public class JiveGlobals {
values
.
add
(
value
);
}
}
return
values
;
}
...
...
@@ -531,12 +506,6 @@ public class JiveGlobals {
if
(
openfireProperties
==
null
)
{
loadOpenfireProperties
();
}
// jiveHome not loaded?
if
(
openfireProperties
==
null
)
{
return
Collections
.
emptyList
();
}
return
openfireProperties
.
getAllPropertyNames
();
}
...
...
@@ -797,6 +766,9 @@ public class JiveGlobals {
if
(
isSetupMode
())
{
return
;
}
if
(
openfireProperties
==
null
)
{
loadOpenfireProperties
();
}
openfireProperties
.
migrateProperty
(
name
);
}
...
...
@@ -969,10 +941,18 @@ public class JiveGlobals {
openfireProperties
=
new
XMLProperties
(
home
+
File
.
separator
+
getConfigName
());
}
catch
(
IOException
ioe
)
{
Log
.
error
(
ioe
.
getMessage
()
,
ioe
);
Log
.
error
(
ioe
.
getMessage
());
failedLoading
=
true
;
}
}
// create a default/empty XML properties set (helpful for unit testing)
if
(
openfireProperties
==
null
)
{
try
{
openfireProperties
=
new
XMLProperties
();
}
catch
(
IOException
e
)
{
Log
.
error
(
"Failed to setup default openfire properties"
,
e
);
}
}
}
}
...
...
@@ -989,12 +969,6 @@ public class JiveGlobals {
msg
.
append
(
"Critical Error! The home directory has not been configured, \n"
);
msg
.
append
(
"which will prevent the application from working correctly.\n\n"
);
System
.
err
.
println
(
msg
.
toString
());
try
{
securityProperties
=
new
XMLProperties
();
}
catch
(
IOException
ioe
)
{
Log
.
error
(
"Failed to setup default secuirty properties"
,
ioe
);
}
}
// Create a manager with the full path to the security XML file.
else
{
...
...
@@ -1014,10 +988,18 @@ public class JiveGlobals {
},
1000
);
}
catch
(
IOException
ioe
)
{
Log
.
error
(
ioe
.
getMessage
()
,
ioe
);
Log
.
error
(
ioe
.
getMessage
());
failedLoading
=
true
;
}
}
// create a default/empty XML properties set (helpful for unit testing)
if
(
securityProperties
==
null
)
{
try
{
securityProperties
=
new
XMLProperties
();
}
catch
(
IOException
e
)
{
Log
.
error
(
"Failed to setup default security properties"
,
e
);
}
}
}
}
...
...
src/java/org/jivesoftware/util/XMLProperties.java
View file @
d34719d8
...
...
@@ -741,6 +741,10 @@ public class XMLProperties {
* used during the writing process for maximum safety.
*/
private
synchronized
void
saveProperties
()
{
if
(
file
==
null
)
{
Log
.
error
(
"Unable to save XML properties; no file specified"
);
return
;
}
boolean
error
=
false
;
// Write data out to a temporary file first.
File
tempFile
=
null
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment