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
f6306203
Commit
f6306203
authored
Aug 10, 2017
by
Greg Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework commit to make diff clearer
parent
9acf53b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
+23
-23
JDBCAdminProvider.java
...va/org/jivesoftware/openfire/admin/JDBCAdminProvider.java
+23
-23
No files found.
src/java/org/jivesoftware/openfire/admin/JDBCAdminProvider.java
View file @
f6306203
...
...
@@ -116,19 +116,30 @@ public class JDBCAdminProvider implements AdminProvider {
List
<
JID
>
jids
=
new
ArrayList
<>();
synchronized
(
getAdminsSQL
)
{
try
{
con
=
getConnection
();
pstmt
=
con
.
prepareStatement
(
getAdminsSQL
);
rs
=
pstmt
.
executeQuery
();
while
(
rs
.
next
())
{
String
name
=
rs
.
getString
(
1
);
jids
.
add
(
new
JID
(
name
+
"@"
+
xmppDomain
));
try
{
con
=
getConnection
();
pstmt
=
con
.
prepareStatement
(
getAdminsSQL
);
rs
=
pstmt
.
executeQuery
();
while
(
rs
.
next
())
{
String
name
=
rs
.
getString
(
1
);
jids
.
add
(
new
JID
(
name
+
"@"
+
xmppDomain
));
}
return
jids
;
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
finally
{
DbConnectionManager
.
closeConnection
(
rs
,
pstmt
,
con
);
}
}
}
private
void
changeAdmins
(
final
Connection
con
,
final
String
sql
,
final
List
<
JID
>
admins
)
throws
SQLException
{
if
(!
admins
.
isEmpty
())
{
try
(
final
PreparedStatement
pstmt
=
con
.
prepareStatement
(
sql
))
{
for
(
final
JID
jid
:
admins
)
{
pstmt
.
setString
(
1
,
jid
.
getNode
());
pstmt
.
execute
();
}
return
jids
;
}
catch
(
SQLException
e
)
{
throw
new
RuntimeException
(
e
);
}
finally
{
DbConnectionManager
.
closeConnection
(
rs
,
pstmt
,
con
);
}
}
}
...
...
@@ -156,17 +167,6 @@ public class JDBCAdminProvider implements AdminProvider {
}
}
private
void
changeAdmins
(
final
Connection
con
,
final
String
sql
,
final
List
<
JID
>
admins
)
throws
SQLException
{
if
(!
admins
.
isEmpty
())
{
try
(
final
PreparedStatement
pstmt
=
con
.
prepareStatement
(
sql
))
{
for
(
final
JID
jid
:
admins
)
{
pstmt
.
setString
(
1
,
jid
.
getNode
());
pstmt
.
execute
();
}
}
}
}
@Override
public
boolean
isReadOnly
()
{
return
insertAdminsSQL
.
isEmpty
()
||
deleteAdminsSQL
.
isEmpty
();
...
...
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