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
8161cd40
Commit
8161cd40
authored
Dec 21, 2016
by
Dave Cridland
Committed by
GitHub
Dec 21, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #715 from surevine/mam-muc
OF-1246 MAM for MUC
parents
1da2506b
3b4d1681
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
356 additions
and
41 deletions
+356
-41
openfire_db2.sql
src/database/openfire_db2.sql
+3
-1
openfire_hsqldb.sql
src/database/openfire_hsqldb.sql
+3
-1
openfire_mysql.sql
src/database/openfire_mysql.sql
+4
-2
openfire_oracle.sql
src/database/openfire_oracle.sql
+4
-1
openfire_postgresql.sql
src/database/openfire_postgresql.sql
+4
-1
openfire_sqlserver.sql
src/database/openfire_sqlserver.sql
+3
-1
openfire_sybase.sql
src/database/openfire_sybase.sql
+4
-1
openfire_db2.sql
src/database/upgrade/25/openfire_db2.sql
+3
-0
openfire_hsqldb.sql
src/database/upgrade/25/openfire_hsqldb.sql
+3
-0
openfire_mysql.sql
src/database/upgrade/25/openfire_mysql.sql
+3
-0
openfire_oracle.sql
src/database/upgrade/25/openfire_oracle.sql
+3
-0
openfire_postgresql.sql
src/database/upgrade/25/openfire_postgresql.sql
+3
-0
openfire_sqlserver.sql
src/database/upgrade/25/openfire_sqlserver.sql
+3
-0
openfire_sybase.sql
src/database/upgrade/25/openfire_sybase.sql
+3
-0
SchemaManager.java
src/java/org/jivesoftware/database/SchemaManager.java
+1
-1
MUCPersistenceManager.java
.../jivesoftware/openfire/muc/spi/MUCPersistenceManager.java
+2
-2
changelog.html
src/plugins/monitoring/changelog.html
+6
-0
plugin.xml
src/plugins/monitoring/plugin.xml
+3
-3
JdbcPersistenceManager.java
.../openfire/plugin/archive/impl/JdbcPersistenceManager.java
+5
-5
MucMamPersistenceManager.java
...penfire/plugin/archive/impl/MucMamPersistenceManager.java
+204
-0
AbstractIQHandler.java
...reucon/openfire/plugin/archive/xep/AbstractIQHandler.java
+3
-2
AbstractXepSupport.java
...eucon/openfire/plugin/archive/xep/AbstractXepSupport.java
+18
-2
IQListHandler.java
...reucon/openfire/plugin/archive/xep0136/IQListHandler.java
+1
-1
IQRetrieveHandler.java
...on/openfire/plugin/archive/xep0136/IQRetrieveHandler.java
+1
-1
Xep0136Support.java
...eucon/openfire/plugin/archive/xep0136/Xep0136Support.java
+1
-1
IQQueryHandler.java
...eucon/openfire/plugin/archive/xep0313/IQQueryHandler.java
+37
-3
Xep0313Support.java
...eucon/openfire/plugin/archive/xep0313/Xep0313Support.java
+1
-1
Xep0313Support1.java
...ucon/openfire/plugin/archive/xep0313/Xep0313Support1.java
+1
-1
ConversationManager.java
...rg/jivesoftware/openfire/archive/ConversationManager.java
+12
-9
MonitoringPlugin.java
...va/org/jivesoftware/openfire/plugin/MonitoringPlugin.java
+14
-1
No files found.
src/database/openfire_db2.sql
View file @
8161cd40
...
@@ -261,6 +261,7 @@ CREATE TABLE ofMucMember (
...
@@ -261,6 +261,7 @@ CREATE TABLE ofMucMember (
CREATE
TABLE
ofMucConversationLog
(
CREATE
TABLE
ofMucConversationLog
(
roomID
INTEGER
NOT
NULL
,
roomID
INTEGER
NOT
NULL
,
messageID
INTEGER
NOT
NULL
,
sender
VARCHAR
(
2000
)
NOT
NULL
,
sender
VARCHAR
(
2000
)
NOT
NULL
,
nickname
VARCHAR
(
255
),
nickname
VARCHAR
(
255
),
logTime
CHAR
(
15
)
NOT
NULL
,
logTime
CHAR
(
15
)
NOT
NULL
,
...
@@ -269,6 +270,7 @@ CREATE TABLE ofMucConversationLog (
...
@@ -269,6 +270,7 @@ CREATE TABLE ofMucConversationLog (
stanza
CLOB
stanza
CLOB
);
);
CREATE
INDEX
ofMucConvLog_time_idx
ON
ofMucConversationLog
(
logTime
);
CREATE
INDEX
ofMucConvLog_time_idx
ON
ofMucConversationLog
(
logTime
);
CREATE
INDEX
ofMucConvLog_msg_id
ON
ofMucConversationLog
(
messageID
);
-- PubSub Tables
-- PubSub Tables
...
@@ -392,7 +394,7 @@ INSERT INTO ofID (idType, id) VALUES (19, 1);
...
@@ -392,7 +394,7 @@ INSERT INTO ofID (idType, id) VALUES (19, 1);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
23
,
1
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
23
,
1
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
26
,
2
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
26
,
2
);
INSERT
INTO
ofVersion
(
name
,
version
)
VALUES
(
'openfire'
,
2
4
);
INSERT
INTO
ofVersion
(
name
,
version
)
VALUES
(
'openfire'
,
2
5
);
-- Entry for admin user
-- Entry for admin user
INSERT
INTO
ofUser
(
username
,
plainPassword
,
name
,
email
,
creationDate
,
modificationDate
)
INSERT
INTO
ofUser
(
username
,
plainPassword
,
name
,
email
,
creationDate
,
modificationDate
)
...
...
src/database/openfire_hsqldb.sql
View file @
8161cd40
...
@@ -253,6 +253,7 @@ CREATE TABLE ofMucMember (
...
@@ -253,6 +253,7 @@ CREATE TABLE ofMucMember (
CREATE
TABLE
ofMucConversationLog
(
CREATE
TABLE
ofMucConversationLog
(
roomID
BIGINT
NOT
NULL
,
roomID
BIGINT
NOT
NULL
,
messageID
BIGINT
NOT
NULL
,
sender
VARCHAR
(
1024
)
NOT
NULL
,
sender
VARCHAR
(
1024
)
NOT
NULL
,
nickname
VARCHAR
(
255
)
NULL
,
nickname
VARCHAR
(
255
)
NULL
,
logTime
CHAR
(
15
)
NOT
NULL
,
logTime
CHAR
(
15
)
NOT
NULL
,
...
@@ -261,6 +262,7 @@ CREATE TABLE ofMucConversationLog (
...
@@ -261,6 +262,7 @@ CREATE TABLE ofMucConversationLog (
stanza
LONGVARCHAR
NULL
stanza
LONGVARCHAR
NULL
);
);
CREATE
INDEX
ofMucConversationLog_time_idx
ON
ofMucConversationLog
(
logTime
);
CREATE
INDEX
ofMucConversationLog_time_idx
ON
ofMucConversationLog
(
logTime
);
CREATE
INDEX
ofMucConversationLog_msg_id
ON
ofMucConversationLog
(
messageID
);
//
PubSub
Tables
//
PubSub
Tables
...
@@ -378,7 +380,7 @@ INSERT INTO ofID (idType, id) VALUES (19, 1);
...
@@ -378,7 +380,7 @@ INSERT INTO ofID (idType, id) VALUES (19, 1);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
23
,
1
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
23
,
1
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
26
,
2
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
26
,
2
);
INSERT
INTO
ofVersion
(
name
,
version
)
VALUES
(
'openfire'
,
2
4
);
INSERT
INTO
ofVersion
(
name
,
version
)
VALUES
(
'openfire'
,
2
5
);
//
Entry
for
admin
user
//
Entry
for
admin
user
INSERT
INTO
ofUser
(
username
,
plainPassword
,
name
,
email
,
creationDate
,
modificationDate
)
INSERT
INTO
ofUser
(
username
,
plainPassword
,
name
,
email
,
creationDate
,
modificationDate
)
...
...
src/database/openfire_mysql.sql
View file @
8161cd40
...
@@ -242,13 +242,15 @@ CREATE TABLE ofMucMember (
...
@@ -242,13 +242,15 @@ CREATE TABLE ofMucMember (
CREATE
TABLE
ofMucConversationLog
(
CREATE
TABLE
ofMucConversationLog
(
roomID
BIGINT
NOT
NULL
,
roomID
BIGINT
NOT
NULL
,
messageID
BIGINT
NOT
NULL
,
sender
TEXT
NOT
NULL
,
sender
TEXT
NOT
NULL
,
nickname
VARCHAR
(
255
)
NULL
,
nickname
VARCHAR
(
255
)
NULL
,
logTime
CHAR
(
15
)
NOT
NULL
,
logTime
CHAR
(
15
)
NOT
NULL
,
subject
VARCHAR
(
255
)
NULL
,
subject
VARCHAR
(
255
)
NULL
,
body
TEXT
NULL
,
body
TEXT
NULL
,
stanza
TEXT
NULL
,
stanza
TEXT
NULL
,
INDEX
ofMucConversationLog_time_idx
(
logTime
)
INDEX
ofMucConversationLog_time_idx
(
logTime
),
INDEX
ofMucConversationLog_msg_id
(
messageID
);
);
);
#
PubSub
Tables
#
PubSub
Tables
...
@@ -367,7 +369,7 @@ INSERT INTO ofID (idType, id) VALUES (19, 1);
...
@@ -367,7 +369,7 @@ INSERT INTO ofID (idType, id) VALUES (19, 1);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
23
,
1
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
23
,
1
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
26
,
2
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
26
,
2
);
INSERT
INTO
ofVersion
(
name
,
version
)
VALUES
(
'openfire'
,
2
4
);
INSERT
INTO
ofVersion
(
name
,
version
)
VALUES
(
'openfire'
,
2
5
);
#
Entry
for
admin
user
#
Entry
for
admin
user
INSERT
INTO
ofUser
(
username
,
plainPassword
,
name
,
email
,
creationDate
,
modificationDate
)
INSERT
INTO
ofUser
(
username
,
plainPassword
,
name
,
email
,
creationDate
,
modificationDate
)
...
...
src/database/openfire_oracle.sql
View file @
8161cd40
...
@@ -250,6 +250,7 @@ CREATE TABLE ofMucMember (
...
@@ -250,6 +250,7 @@ CREATE TABLE ofMucMember (
CREATE
TABLE
ofMucConversationLog
(
CREATE
TABLE
ofMucConversationLog
(
roomID
INT
NOT
NULL
,
roomID
INT
NOT
NULL
,
messageID
INT
NOT
NULL
,
sender
VARCHAR2
(
1024
)
NOT
NULL
,
sender
VARCHAR2
(
1024
)
NOT
NULL
,
nickname
VARCHAR2
(
255
)
NULL
,
nickname
VARCHAR2
(
255
)
NULL
,
logTime
CHAR
(
15
)
NOT
NULL
,
logTime
CHAR
(
15
)
NOT
NULL
,
...
@@ -258,6 +259,8 @@ CREATE TABLE ofMucConversationLog (
...
@@ -258,6 +259,8 @@ CREATE TABLE ofMucConversationLog (
stanza
VARCHAR2
(
4000
)
NULL
stanza
VARCHAR2
(
4000
)
NULL
);
);
CREATE
INDEX
ofMucConversationLog_time_idx
ON
ofMucConversationLog
(
logTime
);
CREATE
INDEX
ofMucConversationLog_time_idx
ON
ofMucConversationLog
(
logTime
);
CREATE
INDEX
ofMucConversationLog_msg_id
ON
ofMucConversationLog
(
messageID
);
-- PubSub Tables
-- PubSub Tables
...
@@ -375,7 +378,7 @@ INSERT INTO ofID (idType, id) VALUES (19, 1);
...
@@ -375,7 +378,7 @@ INSERT INTO ofID (idType, id) VALUES (19, 1);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
23
,
1
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
23
,
1
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
26
,
2
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
26
,
2
);
INSERT
INTO
ofVersion
(
name
,
version
)
VALUES
(
'openfire'
,
2
4
);
INSERT
INTO
ofVersion
(
name
,
version
)
VALUES
(
'openfire'
,
2
5
);
-- Entry for admin user
-- Entry for admin user
INSERT
INTO
ofUser
(
username
,
plainPassword
,
name
,
email
,
creationDate
,
modificationDate
)
INSERT
INTO
ofUser
(
username
,
plainPassword
,
name
,
email
,
creationDate
,
modificationDate
)
...
...
src/database/openfire_postgresql.sql
View file @
8161cd40
...
@@ -258,6 +258,7 @@ CREATE TABLE ofMucMember (
...
@@ -258,6 +258,7 @@ CREATE TABLE ofMucMember (
CREATE
TABLE
ofMucConversationLog
(
CREATE
TABLE
ofMucConversationLog
(
roomID
INTEGER
NOT
NULL
,
roomID
INTEGER
NOT
NULL
,
messageID
INTEGER
NOT
NULL
,
sender
VARCHAR
(
1024
)
NOT
NULL
,
sender
VARCHAR
(
1024
)
NOT
NULL
,
nickname
VARCHAR
(
255
)
NULL
,
nickname
VARCHAR
(
255
)
NULL
,
logTime
CHAR
(
15
)
NOT
NULL
,
logTime
CHAR
(
15
)
NOT
NULL
,
...
@@ -266,6 +267,8 @@ CREATE TABLE ofMucConversationLog (
...
@@ -266,6 +267,8 @@ CREATE TABLE ofMucConversationLog (
stanza
TEXT
NULL
stanza
TEXT
NULL
);
);
CREATE
INDEX
ofMucConversationLog_time_idx
ON
ofMucConversationLog
(
logTime
);
CREATE
INDEX
ofMucConversationLog_time_idx
ON
ofMucConversationLog
(
logTime
);
CREATE
INDEX
ofMucConversationLog_msg_id
ON
ofMucConversationLog
(
messageID
);
-- PubSub Tables
-- PubSub Tables
...
@@ -383,7 +386,7 @@ INSERT INTO ofID (idType, id) VALUES (19, 1);
...
@@ -383,7 +386,7 @@ INSERT INTO ofID (idType, id) VALUES (19, 1);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
23
,
1
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
23
,
1
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
26
,
2
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
26
,
2
);
INSERT
INTO
ofVersion
(
name
,
version
)
VALUES
(
'openfire'
,
2
4
);
INSERT
INTO
ofVersion
(
name
,
version
)
VALUES
(
'openfire'
,
2
5
);
-- Entry for admin user
-- Entry for admin user
INSERT
INTO
ofUser
(
username
,
plainPassword
,
name
,
email
,
creationDate
,
modificationDate
)
INSERT
INTO
ofUser
(
username
,
plainPassword
,
name
,
email
,
creationDate
,
modificationDate
)
...
...
src/database/openfire_sqlserver.sql
View file @
8161cd40
...
@@ -256,6 +256,7 @@ CREATE TABLE ofMucMember (
...
@@ -256,6 +256,7 @@ CREATE TABLE ofMucMember (
CREATE
TABLE
ofMucConversationLog
(
CREATE
TABLE
ofMucConversationLog
(
roomID
INT
NOT
NULL
,
roomID
INT
NOT
NULL
,
messageID
INT
NOT
NULL
,
sender
NVARCHAR
(
1024
)
NOT
NULL
,
sender
NVARCHAR
(
1024
)
NOT
NULL
,
nickname
NVARCHAR
(
255
)
NULL
,
nickname
NVARCHAR
(
255
)
NULL
,
logTime
CHAR
(
15
)
NOT
NULL
,
logTime
CHAR
(
15
)
NOT
NULL
,
...
@@ -264,6 +265,7 @@ CREATE TABLE ofMucConversationLog (
...
@@ -264,6 +265,7 @@ CREATE TABLE ofMucConversationLog (
stanza
NTEXT
NULL
stanza
NTEXT
NULL
);
);
CREATE
INDEX
ofMucConversationLog_time_idx
ON
ofMucConversationLog
(
logTime
);
CREATE
INDEX
ofMucConversationLog_time_idx
ON
ofMucConversationLog
(
logTime
);
CREATE
INDEX
ofMucConversationLog_msg_id
ON
ofMucConversationLog
(
messageID
);
/* PubSub Tables */
/* PubSub Tables */
...
@@ -381,7 +383,7 @@ INSERT INTO ofID (idType, id) VALUES (19, 1);
...
@@ -381,7 +383,7 @@ INSERT INTO ofID (idType, id) VALUES (19, 1);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
23
,
1
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
23
,
1
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
26
,
2
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
26
,
2
);
INSERT
INTO
ofVersion
(
name
,
version
)
VALUES
(
'openfire'
,
2
4
);
INSERT
INTO
ofVersion
(
name
,
version
)
VALUES
(
'openfire'
,
2
5
);
/* Entry for admin user */
/* Entry for admin user */
INSERT
INTO
ofUser
(
username
,
plainPassword
,
name
,
email
,
creationDate
,
modificationDate
)
INSERT
INTO
ofUser
(
username
,
plainPassword
,
name
,
email
,
creationDate
,
modificationDate
)
...
...
src/database/openfire_sybase.sql
View file @
8161cd40
...
@@ -256,6 +256,7 @@ CREATE TABLE ofMucMember (
...
@@ -256,6 +256,7 @@ CREATE TABLE ofMucMember (
CREATE
TABLE
ofMucConversationLog
(
CREATE
TABLE
ofMucConversationLog
(
roomID
INT
NOT
NULL
,
roomID
INT
NOT
NULL
,
messageID
INT
NOT
NULL
,
sender
TEXT
NOT
NULL
,
sender
TEXT
NOT
NULL
,
nickname
NVARCHAR
(
255
)
NULL
,
nickname
NVARCHAR
(
255
)
NULL
,
logTime
CHAR
(
15
)
NOT
NULL
,
logTime
CHAR
(
15
)
NOT
NULL
,
...
@@ -264,6 +265,8 @@ CREATE TABLE ofMucConversationLog (
...
@@ -264,6 +265,8 @@ CREATE TABLE ofMucConversationLog (
stanza
TEXT
NULL
stanza
TEXT
NULL
);
);
CREATE
INDEX
ofMucConversationLog_time_idx
ON
ofMucConversationLog
(
logTime
);
CREATE
INDEX
ofMucConversationLog_time_idx
ON
ofMucConversationLog
(
logTime
);
CREATE
INDEX
ofMucConversationLog_msg_id
ON
ofMucConversationLog
(
messageID
);
/* PubSub Tables */
/* PubSub Tables */
...
@@ -381,7 +384,7 @@ INSERT INTO ofID (idType, id) VALUES (19, 1);
...
@@ -381,7 +384,7 @@ INSERT INTO ofID (idType, id) VALUES (19, 1);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
23
,
1
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
23
,
1
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
26
,
2
);
INSERT
INTO
ofID
(
idType
,
id
)
VALUES
(
26
,
2
);
INSERT
INTO
ofVersion
(
name
,
version
)
VALUES
(
'openfire'
,
2
4
);
INSERT
INTO
ofVersion
(
name
,
version
)
VALUES
(
'openfire'
,
2
5
);
/* Entry for admin user */
/* Entry for admin user */
INSERT
INTO
ofUser
(
username
,
plainPassword
,
name
,
email
,
creationDate
,
modificationDate
)
INSERT
INTO
ofUser
(
username
,
plainPassword
,
name
,
email
,
creationDate
,
modificationDate
)
...
...
src/database/upgrade/25/openfire_db2.sql
0 → 100644
View file @
8161cd40
CREATE
INDEX
ofMucConvLog_msg_id
ON
ofMucConversationLog
(
messageID
);
UPDATE
ofVersion
SET
version
=
25
WHERE
name
=
'openfire'
;
src/database/upgrade/25/openfire_hsqldb.sql
0 → 100644
View file @
8161cd40
CREATE
INDEX
ofMucConvLog_msg_id
ON
ofMucConversationLog
(
messageID
);
UPDATE
ofVersion
SET
version
=
24
WHERE
name
=
'openfire'
;
\ No newline at end of file
src/database/upgrade/25/openfire_mysql.sql
0 → 100644
View file @
8161cd40
ALTER
TABLE
ofMucConversationLog
ADD
INDEX
ofMucConvLog_msg_id
(
messageID
);
UPDATE
ofVersion
SET
version
=
24
WHERE
name
=
'openfire'
;
\ No newline at end of file
src/database/upgrade/25/openfire_oracle.sql
0 → 100644
View file @
8161cd40
CREATE
INDEX
ofMucConvLog_msg_id
ON
ofMucConversationLog
(
messageID
);
UPDATE
ofVersion
SET
version
=
24
WHERE
name
=
'openfire'
;
\ No newline at end of file
src/database/upgrade/25/openfire_postgresql.sql
0 → 100644
View file @
8161cd40
CREATE
INDEX
ofMucConvLog_msg_id
ON
ofMucConversationLog
(
messageID
);
UPDATE
ofVersion
SET
version
=
24
WHERE
name
=
'openfire'
;
\ No newline at end of file
src/database/upgrade/25/openfire_sqlserver.sql
0 → 100644
View file @
8161cd40
CREATE
INDEX
ofMucConvLog_msg_id
ON
ofMucConversationLog
(
messageID
);
UPDATE
ofVersion
SET
version
=
24
WHERE
name
=
'openfire'
;
\ No newline at end of file
src/database/upgrade/25/openfire_sybase.sql
0 → 100644
View file @
8161cd40
CREATE
INDEX
ofMucConvLog_msg_id
ON
ofMucConversationLog
(
messageID
);
UPDATE
ofVersion
SET
version
=
24
WHERE
name
=
'openfire'
;
\ No newline at end of file
src/java/org/jivesoftware/database/SchemaManager.java
View file @
8161cd40
...
@@ -68,7 +68,7 @@ public class SchemaManager {
...
@@ -68,7 +68,7 @@ public class SchemaManager {
/**
/**
* Current Openfire database schema version.
* Current Openfire database schema version.
*/
*/
private
static
final
int
DATABASE_VERSION
=
2
4
;
private
static
final
int
DATABASE_VERSION
=
2
5
;
/**
/**
* Checks the Openfire database schema to ensure that it's installed and up to date.
* Checks the Openfire database schema to ensure that it's installed and up to date.
...
...
src/java/org/jivesoftware/openfire/muc/spi/MUCPersistenceManager.java
View file @
8161cd40
...
@@ -129,8 +129,8 @@ public class MUCPersistenceManager {
...
@@ -129,8 +129,8 @@ public class MUCPersistenceManager {
private
static
final
String
DELETE_USER_MUCAFFILIATION
=
private
static
final
String
DELETE_USER_MUCAFFILIATION
=
"DELETE FROM ofMucAffiliation WHERE jid=?"
;
"DELETE FROM ofMucAffiliation WHERE jid=?"
;
private
static
final
String
ADD_CONVERSATION_LOG
=
private
static
final
String
ADD_CONVERSATION_LOG
=
"INSERT INTO ofMucConversationLog (roomID,sender,nickname,logTime,subject,body,stanza) "
+
"INSERT INTO ofMucConversationLog (roomID,
messageID,
sender,nickname,logTime,subject,body,stanza) "
+
"
VALUES (?,?,?,?,?,?,?)
"
;
"
SELECT ?,COUNT(*),?,?,?,?,?,? FROM ofMucConversationLog
"
;
/* Map of subdomains to their associated properties */
/* Map of subdomains to their associated properties */
private
static
ConcurrentHashMap
<
String
,
MUCServiceProperties
>
propertyMaps
=
new
ConcurrentHashMap
<>();
private
static
ConcurrentHashMap
<
String
,
MUCServiceProperties
>
propertyMaps
=
new
ConcurrentHashMap
<>();
...
...
src/plugins/monitoring/changelog.html
View file @
8161cd40
...
@@ -43,6 +43,12 @@
...
@@ -43,6 +43,12 @@
<h1>
<h1>
Monitoring Plugin Changelog
Monitoring Plugin Changelog
</h1>
</h1>
<p><b>
1.5.5
</b>
-- December 19, 2016
</p>
<ul>
<li>
[
<a
href=
'https://igniterealtime.org/issues/browse/OF-1246'
>
OF-1246
</a>
] - Support MAM (XEP-0313) for MUC (XEP-0045)
</li>
<li>
[
<a
href=
'https://igniterealtime.org/issues/browse/OF-1214'
>
OF-1214
</a>
] - Update MAM (XEP-0313) to support :0 and :1 versions
</li>
</ul>
<p><b>
1.5.4
</b>
-- April 27, 2016
</p>
<p><b>
1.5.4
</b>
-- April 27, 2016
</p>
<ul>
<ul>
<li>
[
<a
href=
'https://igniterealtime.org/issues/browse/OF-1132'
>
OF-1132
</a>
] - Ensure that namespace is defined on forwarded messages.
</li>
<li>
[
<a
href=
'https://igniterealtime.org/issues/browse/OF-1132'
>
OF-1132
</a>
] - Ensure that namespace is defined on forwarded messages.
</li>
...
...
src/plugins/monitoring/plugin.xml
View file @
8161cd40
...
@@ -4,10 +4,10 @@
...
@@ -4,10 +4,10 @@
<class>
org.jivesoftware.openfire.plugin.MonitoringPlugin
</class>
<class>
org.jivesoftware.openfire.plugin.MonitoringPlugin
</class>
<name>
Monitoring Service
</name>
<name>
Monitoring Service
</name>
<description>
Monitors conversations and statistics of the server.
</description>
<description>
Monitors conversations and statistics of the server.
</description>
<author>
Jive Software
</author>
<author>
IgniteRealtime //
Jive Software
</author>
<version>
1.5.
4
</version>
<version>
1.5.
5
</version>
<date>
4/27/2016
</date>
<date>
4/27/2016
</date>
<minServerVersion>
4.0.
0
</minServerVersion
>
<minServerVersion>
4.0.
99
</minServerVersion>
<!-- Allows the beta 4.1.0 --
>
<databaseKey>
monitoring
</databaseKey>
<databaseKey>
monitoring
</databaseKey>
<databaseVersion>
4
</databaseVersion>
<databaseVersion>
4
</databaseVersion>
...
...
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/impl/JdbcPersistenceManager.java
View file @
8161cd40
...
@@ -170,7 +170,7 @@ public class JdbcPersistenceManager implements PersistenceManager {
...
@@ -170,7 +170,7 @@ public class JdbcPersistenceManager implements PersistenceManager {
+
"ofMessageArchive.messageID, "
+
"ofConParticipant.bareJID "
+
"ofMessageArchive.messageID, "
+
"ofConParticipant.bareJID "
+
"FROM ofMessageArchive "
+
"FROM ofMessageArchive "
+
"INNER JOIN ofConParticipant ON ofMessageArchive.conversationID = ofConParticipant.conversationID "
+
"INNER JOIN ofConParticipant ON ofMessageArchive.conversationID = ofConParticipant.conversationID "
+
"WHERE
ofMessageArchive.stanza != NULL OR ofMessageArchive.body != NULL
"
;
+
"WHERE
(ofMessageArchive.stanza IS NOT NULL OR ofMessageArchive.body IS NOT NULL)
"
;
public
static
final
String
SELECT_MESSAGE_ORACLE
=
"SELECT "
public
static
final
String
SELECT_MESSAGE_ORACLE
=
"SELECT "
+
"ofMessageArchive.fromJID, "
+
"ofMessageArchive.fromJID, "
...
@@ -186,7 +186,7 @@ public class JdbcPersistenceManager implements PersistenceManager {
...
@@ -186,7 +186,7 @@ public class JdbcPersistenceManager implements PersistenceManager {
public
static
final
String
COUNT_MESSAGES
=
"SELECT COUNT(DISTINCT ofMessageArchive.messageID) "
public
static
final
String
COUNT_MESSAGES
=
"SELECT COUNT(DISTINCT ofMessageArchive.messageID) "
+
"FROM ofMessageArchive "
+
"FROM ofMessageArchive "
+
"INNER JOIN ofConParticipant ON ofMessageArchive.conversationID = ofConParticipant.conversationID "
+
"INNER JOIN ofConParticipant ON ofMessageArchive.conversationID = ofConParticipant.conversationID "
+
"WHERE
ofMessageArchive.stanza != NULL OR ofMessageArchive.body != NULL
"
;
+
"WHERE
(ofMessageArchive.stanza IS NOT NULL OR ofMessageArchive.body IS NOT NULL)
"
;
public
boolean
createMessage
(
ArchivedMessage
message
)
{
public
boolean
createMessage
(
ArchivedMessage
message
)
{
/* read only */
/* read only */
...
@@ -456,7 +456,7 @@ public class JdbcPersistenceManager implements PersistenceManager {
...
@@ -456,7 +456,7 @@ public class JdbcPersistenceManager implements PersistenceManager {
appendWhere
(
whereSB
,
"( "
,
MESSAGE_TO_JID
,
" = ? OR "
,
MESSAGE_FROM_JID
,
" = ? )"
);
appendWhere
(
whereSB
,
"( "
,
MESSAGE_TO_JID
,
" = ? OR "
,
MESSAGE_FROM_JID
,
" = ? )"
);
}
}
if
(
whereSB
.
length
()
!=
0
)
{
if
(
whereSB
.
length
()
!=
0
)
{
querySB
.
append
(
"
WHERE
"
).
append
(
whereSB
);
querySB
.
append
(
"
AND
"
).
append
(
whereSB
);
}
}
if
(
DbConnectionManager
.
getDatabaseType
()
==
DbConnectionManager
.
DatabaseType
.
sqlserver
)
{
if
(
DbConnectionManager
.
getDatabaseType
()
==
DbConnectionManager
.
DatabaseType
.
sqlserver
)
{
...
@@ -588,7 +588,7 @@ public class JdbcPersistenceManager implements PersistenceManager {
...
@@ -588,7 +588,7 @@ public class JdbcPersistenceManager implements PersistenceManager {
querySB
=
new
StringBuilder
(
COUNT_MESSAGES
);
querySB
=
new
StringBuilder
(
COUNT_MESSAGES
);
if
(
whereClause
!=
null
&&
whereClause
.
length
()
!=
0
)
{
if
(
whereClause
!=
null
&&
whereClause
.
length
()
!=
0
)
{
querySB
.
append
(
"
WHERE
"
).
append
(
whereClause
);
querySB
.
append
(
"
AND
"
).
append
(
whereClause
);
}
}
Connection
con
=
null
;
Connection
con
=
null
;
...
@@ -618,7 +618,7 @@ public class JdbcPersistenceManager implements PersistenceManager {
...
@@ -618,7 +618,7 @@ public class JdbcPersistenceManager implements PersistenceManager {
StringBuilder
querySB
;
StringBuilder
querySB
;
querySB
=
new
StringBuilder
(
COUNT_MESSAGES
);
querySB
=
new
StringBuilder
(
COUNT_MESSAGES
);
querySB
.
append
(
"
WHERE
"
);
querySB
.
append
(
"
AND
"
);
if
(
whereClause
!=
null
&&
whereClause
.
length
()
!=
0
)
{
if
(
whereClause
!=
null
&&
whereClause
.
length
()
!=
0
)
{
querySB
.
append
(
whereClause
);
querySB
.
append
(
whereClause
);
querySB
.
append
(
" AND "
);
querySB
.
append
(
" AND "
);
...
...
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/impl/MucMamPersistenceManager.java
0 → 100644
View file @
8161cd40
package
com
.
reucon
.
openfire
.
plugin
.
archive
.
impl
;
import
com.reucon.openfire.plugin.archive.ArchivedMessageConsumer
;
import
com.reucon.openfire.plugin.archive.PersistenceManager
;
import
com.reucon.openfire.plugin.archive.model.ArchivedMessage
;
import
com.reucon.openfire.plugin.archive.model.Conversation
;
import
com.reucon.openfire.plugin.archive.model.Participant
;
import
com.reucon.openfire.plugin.archive.xep0059.XmppResultSet
;
import
org.dom4j.Attribute
;
import
org.dom4j.Element
;
import
org.dom4j.Namespace
;
import
org.dom4j.io.SAXReader
;
import
org.eclipse.jdt.internal.compiler.apt.util.Archive
;
import
org.jivesoftware.database.DbConnectionManager
;
import
org.jivesoftware.openfire.XMPPServer
;
import
org.jivesoftware.openfire.muc.MUCRoom
;
import
org.jivesoftware.openfire.muc.MultiUserChatManager
;
import
org.jivesoftware.openfire.muc.MultiUserChatService
;
import
org.jivesoftware.openfire.muc.NotAllowedException
;
import
org.jivesoftware.util.JiveGlobals
;
import
org.jivesoftware.util.Log
;
import
org.jivesoftware.util.StringUtils
;
import
org.jivesoftware.util.XMPPDateTimeFormat
;
import
org.xmpp.packet.JID
;
import
org.xmpp.packet.Message
;
import
java.io.StringReader
;
import
java.math.BigInteger
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.LinkedList
;
import
java.util.List
;
/**
* Created by dwd on 25/07/16.
*/
public
class
MucMamPersistenceManager
implements
PersistenceManager
{
private
static
final
String
LOAD_HISTORY
=
"SELECT sender, nickname, logTime, subject, body, stanza, messageId FROM ofMucConversationLog "
+
"WHERE messageId IS NOT NULL AND logTime>? AND logTime <= ? AND roomID=? AND (nickname IS NOT NULL OR subject IS NOT NULL) "
;
private
static
final
String
WHERE_SENDER
=
" AND sender = ? "
;
private
static
final
String
WHERE_AFTER
=
" AND messageId > ? "
;
private
static
final
String
WHERE_BEFORE
=
" AND messageId < ? "
;
private
static
final
String
ORDER_BY
=
" ORDER BY logTime"
;
@Override
public
boolean
createMessage
(
ArchivedMessage
message
)
{
throw
new
UnsupportedOperationException
(
"MAM-MUC cannot perform this operation"
);
}
@Override
public
int
processAllMessages
(
ArchivedMessageConsumer
callback
)
{
throw
new
UnsupportedOperationException
(
"MAM-MUC cannot perform this operation"
);
}
@Override
public
boolean
createConversation
(
Conversation
conversation
)
{
throw
new
UnsupportedOperationException
(
"MAM-MUC cannot perform this operation"
);
}
@Override
public
boolean
updateConversationEnd
(
Conversation
conversation
)
{
throw
new
UnsupportedOperationException
(
"MAM-MUC cannot perform this operation"
);
}
@Override
public
boolean
createParticipant
(
Participant
participant
,
Long
conversationId
)
{
throw
new
UnsupportedOperationException
(
"MAM-MUC cannot perform this operation"
);
}
@Override
public
List
<
Conversation
>
findConversations
(
String
[]
participants
,
Date
startDate
,
Date
endDate
)
{
throw
new
UnsupportedOperationException
(
"MAM-MUC cannot perform this operation"
);
}
@Override
public
Collection
<
Conversation
>
findConversations
(
Date
startDate
,
Date
endDate
,
String
owner
,
String
with
,
XmppResultSet
xmppResultSet
)
{
throw
new
UnsupportedOperationException
(
"MAM-MUC cannot perform this operation"
);
}
@Override
public
Collection
<
ArchivedMessage
>
findMessages
(
Date
startDate
,
Date
endDate
,
String
owner
,
String
with
,
XmppResultSet
xmppResultSet
)
{
JID
mucRoom
=
new
JID
(
owner
);
MultiUserChatManager
manager
=
XMPPServer
.
getInstance
().
getMultiUserChatManager
();
MultiUserChatService
service
=
manager
.
getMultiUserChatService
(
mucRoom
);
MUCRoom
room
=
service
.
getChatRoom
(
mucRoom
.
getNode
());
Connection
connection
=
null
;
PreparedStatement
pstmt
=
null
;
ResultSet
rs
=
null
;
// If logging isn't enabled, do nothing.
if
(!
room
.
isLogEnabled
())
return
null
;
List
<
ArchivedMessage
>
msgs
=
new
LinkedList
<>();
if
(
startDate
==
null
)
{
startDate
=
new
Date
(
0L
);
}
if
(
endDate
==
null
)
{
endDate
=
new
Date
();
}
int
max
=
xmppResultSet
.
getMax
();
with
=
null
;
// TODO: Suppress this, since we don't yet have requestor information for access control.
try
{
connection
=
DbConnectionManager
.
getConnection
();
StringBuilder
sql
=
new
StringBuilder
(
LOAD_HISTORY
);
if
(
with
!=
null
)
{
sql
.
append
(
WHERE_SENDER
);
}
if
(
xmppResultSet
.
getAfter
()
!=
null
)
{
sql
.
append
(
WHERE_AFTER
);
}
if
(
xmppResultSet
.
getBefore
()
!=
null
)
{
sql
.
append
(
WHERE_BEFORE
);
}
sql
.
append
(
ORDER_BY
);
pstmt
=
connection
.
prepareStatement
(
sql
.
toString
());
pstmt
.
setString
(
1
,
StringUtils
.
dateToMillis
(
startDate
));
pstmt
.
setString
(
2
,
StringUtils
.
dateToMillis
(
endDate
));
pstmt
.
setLong
(
3
,
room
.
getID
());
int
pos
=
3
;
if
(
with
!=
null
)
{
pstmt
.
setString
(++
pos
,
with
);
}
if
(
xmppResultSet
.
getAfter
()
!=
null
)
{
pstmt
.
setLong
(++
pos
,
xmppResultSet
.
getAfter
());
}
if
(
xmppResultSet
.
getBefore
()
!=
null
)
{
pstmt
.
setLong
(++
pos
,
xmppResultSet
.
getBefore
());
}
rs
=
pstmt
.
executeQuery
();
while
(
rs
.
next
())
{
String
senderJID
=
rs
.
getString
(
1
);
String
nickname
=
rs
.
getString
(
2
);
Date
sentDate
=
new
Date
(
Long
.
parseLong
(
rs
.
getString
(
3
).
trim
()));
String
subject
=
rs
.
getString
(
4
);
String
body
=
rs
.
getString
(
5
);
String
stanza
=
rs
.
getString
(
6
);
long
id
=
rs
.
getLong
(
7
);
if
(
stanza
==
null
)
{
Message
message
=
new
Message
();
message
.
setType
(
Message
.
Type
.
groupchat
);
message
.
setSubject
(
subject
);
message
.
setBody
(
body
);
// Set the sender of the message
if
(
nickname
!=
null
&&
nickname
.
trim
().
length
()
>
0
)
{
JID
roomJID
=
room
.
getRole
().
getRoleAddress
();
// Recreate the sender address based on the nickname and room's JID
message
.
setFrom
(
new
JID
(
roomJID
.
getNode
(),
roomJID
.
getDomain
(),
nickname
,
true
));
}
else
{
// Set the room as the sender of the message
message
.
setFrom
(
room
.
getRole
().
getRoleAddress
());
}
stanza
=
message
.
toString
();
}
ArchivedMessage
archivedMessage
=
new
ArchivedMessage
(
sentDate
,
ArchivedMessage
.
Direction
.
from
,
null
,
null
);
archivedMessage
.
setStanza
(
stanza
);
archivedMessage
.
setId
(
id
);
msgs
.
add
(
archivedMessage
);
}
}
catch
(
SQLException
e
)
{
Log
.
error
(
"SQL failure during MAM-MUC: "
,
e
);
}
finally
{
DbConnectionManager
.
closeConnection
(
rs
,
pstmt
,
connection
);
}
// TODO - Not great, really should be done by suitable LIMIT stuff.
// Would need to reverse ordering in some cases and then reverse results.
boolean
complete
=
true
;
xmppResultSet
.
setCount
(
msgs
.
size
());
while
(
msgs
.
size
()
>
max
)
{
msgs
.
remove
(
msgs
.
size
()
-
1
);
complete
=
false
;
}
xmppResultSet
.
setComplete
(
complete
);
if
(
msgs
.
size
()
>
0
)
{
xmppResultSet
.
setFirst
(
msgs
.
get
(
0
).
getId
());
if
(
msgs
.
size
()
>
1
)
{
xmppResultSet
.
setLast
(
msgs
.
get
(
msgs
.
size
()
-
1
).
getId
());
}
}
return
msgs
;
}
@Override
public
Collection
<
Conversation
>
getActiveConversations
(
int
conversationTimeout
)
{
throw
new
UnsupportedOperationException
(
"MAM-MUC cannot perform this operation"
);
}
@Override
public
List
<
Conversation
>
getConversations
(
Collection
<
Long
>
conversationIds
)
{
throw
new
UnsupportedOperationException
(
"MAM-MUC cannot perform this operation"
);
}
@Override
public
Conversation
getConversation
(
String
ownerJid
,
String
withJid
,
Date
start
)
{
throw
new
UnsupportedOperationException
(
"MAM-MUC cannot perform this operation"
);
}
@Override
public
Conversation
getConversation
(
Long
conversationId
)
{
throw
new
UnsupportedOperationException
(
"MAM-MUC cannot perform this operation"
);
}
}
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/xep/AbstractIQHandler.java
View file @
8161cd40
...
@@ -4,6 +4,7 @@ import org.jivesoftware.openfire.IQHandlerInfo;
...
@@ -4,6 +4,7 @@ import org.jivesoftware.openfire.IQHandlerInfo;
import
org.jivesoftware.openfire.handler.IQHandler
;
import
org.jivesoftware.openfire.handler.IQHandler
;
import
org.jivesoftware.openfire.plugin.MonitoringPlugin
;
import
org.jivesoftware.openfire.plugin.MonitoringPlugin
;
import
org.xmpp.packet.IQ
;
import
org.xmpp.packet.IQ
;
import
org.xmpp.packet.JID
;
import
org.xmpp.packet.Packet
;
import
org.xmpp.packet.Packet
;
import
org.xmpp.packet.PacketError
;
import
org.xmpp.packet.PacketError
;
...
@@ -26,8 +27,8 @@ public abstract class AbstractIQHandler extends IQHandler {
...
@@ -26,8 +27,8 @@ public abstract class AbstractIQHandler extends IQHandler {
return
info
;
return
info
;
}
}
protected
PersistenceManager
getPersistenceManager
()
{
protected
PersistenceManager
getPersistenceManager
(
JID
jid
)
{
return
MonitoringPlugin
.
getInstance
().
getPersistenceManager
();
return
MonitoringPlugin
.
getInstance
().
getPersistenceManager
(
jid
);
}
}
protected
IndexManager
getIndexManager
()
{
protected
IndexManager
getIndexManager
()
{
...
...
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/xep/AbstractXepSupport.java
View file @
8161cd40
...
@@ -9,9 +9,12 @@ import java.util.Map;
...
@@ -9,9 +9,12 @@ import java.util.Map;
import
org.jivesoftware.openfire.IQRouter
;
import
org.jivesoftware.openfire.IQRouter
;
import
org.jivesoftware.openfire.XMPPServer
;
import
org.jivesoftware.openfire.XMPPServer
;
import
org.jivesoftware.openfire.auth.UnauthorizedException
;
import
org.jivesoftware.openfire.auth.UnauthorizedException
;
import
org.jivesoftware.openfire.container.Module
;
import
org.jivesoftware.openfire.disco.IQDiscoInfoHandler
;
import
org.jivesoftware.openfire.disco.IQDiscoInfoHandler
;
import
org.jivesoftware.openfire.disco.ServerFeaturesProvider
;
import
org.jivesoftware.openfire.disco.ServerFeaturesProvider
;
import
org.jivesoftware.openfire.handler.IQHandler
;
import
org.jivesoftware.openfire.handler.IQHandler
;
import
org.jivesoftware.openfire.muc.MultiUserChatManager
;
import
org.jivesoftware.openfire.muc.MultiUserChatService
;
import
org.jivesoftware.openfire.plugin.MonitoringPlugin
;
import
org.jivesoftware.openfire.plugin.MonitoringPlugin
;
import
org.jivesoftware.util.Log
;
import
org.jivesoftware.util.Log
;
import
org.xmpp.packet.IQ
;
import
org.xmpp.packet.IQ
;
...
@@ -23,9 +26,10 @@ public abstract class AbstractXepSupport {
...
@@ -23,9 +26,10 @@ public abstract class AbstractXepSupport {
protected
final
Map
<
String
,
IQHandler
>
element2Handlers
;
protected
final
Map
<
String
,
IQHandler
>
element2Handlers
;
protected
final
IQHandler
iqDispatcher
;
protected
final
IQHandler
iqDispatcher
;
protected
final
String
namespace
;
protected
final
String
namespace
;
protected
boolean
muc
=
false
;
protected
Collection
<
IQHandler
>
iqHandlers
;
protected
Collection
<
IQHandler
>
iqHandlers
;
public
AbstractXepSupport
(
XMPPServer
server
,
String
namespace
,
String
iqDispatcherNamespace
,
String
iqDispatcherName
)
{
public
AbstractXepSupport
(
XMPPServer
server
,
String
namespace
,
String
iqDispatcherNamespace
,
String
iqDispatcherName
,
boolean
muc
)
{
this
.
server
=
server
;
this
.
server
=
server
;
this
.
element2Handlers
=
Collections
this
.
element2Handlers
=
Collections
...
@@ -49,7 +53,7 @@ public abstract class AbstractXepSupport {
...
@@ -49,7 +53,7 @@ public abstract class AbstractXepSupport {
};
};
this
.
namespace
=
namespace
;
this
.
namespace
=
namespace
;
this
.
iqHandlers
=
Collections
.
emptyList
();
this
.
iqHandlers
=
Collections
.
emptyList
();
this
.
muc
=
muc
;
}
}
public
void
start
()
{
public
void
start
()
{
...
@@ -70,6 +74,12 @@ public abstract class AbstractXepSupport {
...
@@ -70,6 +74,12 @@ public abstract class AbstractXepSupport {
server
.
getIQDiscoInfoHandler
().
addServerFeature
(
i
.
next
());
server
.
getIQDiscoInfoHandler
().
addServerFeature
(
i
.
next
());
}
}
}
}
if
(
muc
)
{
MultiUserChatManager
manager
=
server
.
getMultiUserChatManager
();
for
(
MultiUserChatService
mucService
:
manager
.
getMultiUserChatServices
())
{
mucService
.
addIQHandler
(
iqHandler
);
}
}
}
}
server
.
getIQDiscoInfoHandler
().
addServerFeature
(
namespace
);
server
.
getIQDiscoInfoHandler
().
addServerFeature
(
namespace
);
server
.
getIQRouter
().
addHandler
(
iqDispatcher
);
server
.
getIQRouter
().
addHandler
(
iqDispatcher
);
...
@@ -96,6 +106,12 @@ public abstract class AbstractXepSupport {
...
@@ -96,6 +106,12 @@ public abstract class AbstractXepSupport {
}
}
}
}
}
}
if
(
muc
)
{
MultiUserChatManager
manager
=
server
.
getMultiUserChatManager
();
for
(
MultiUserChatService
mucService
:
manager
.
getMultiUserChatServices
())
{
mucService
.
removeIQHandler
(
iqHandler
);
}
}
}
}
if
(
iqRouter
!=
null
)
{
if
(
iqRouter
!=
null
)
{
iqRouter
.
removeHandler
(
iqDispatcher
);
iqRouter
.
removeHandler
(
iqDispatcher
);
...
...
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/xep0136/IQListHandler.java
View file @
8161cd40
...
@@ -49,7 +49,7 @@ public class IQListHandler extends AbstractIQHandler implements
...
@@ -49,7 +49,7 @@ public class IQListHandler extends AbstractIQHandler implements
}
}
private
Collection
<
Conversation
>
list
(
JID
from
,
ListRequest
request
)
{
private
Collection
<
Conversation
>
list
(
JID
from
,
ListRequest
request
)
{
return
getPersistenceManager
().
findConversations
(
request
.
getStart
(),
return
getPersistenceManager
(
from
).
findConversations
(
request
.
getStart
(),
request
.
getEnd
(),
from
.
toBareJID
(),
request
.
getWith
(),
request
.
getEnd
(),
from
.
toBareJID
(),
request
.
getWith
(),
request
.
getResultSet
());
request
.
getResultSet
());
}
}
...
...
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/xep0136/IQRetrieveHandler.java
View file @
8161cd40
...
@@ -97,7 +97,7 @@ public class IQRetrieveHandler extends AbstractIQHandler {
...
@@ -97,7 +97,7 @@ public class IQRetrieveHandler extends AbstractIQHandler {
}
}
private
Conversation
retrieve
(
JID
from
,
RetrieveRequest
request
)
{
private
Conversation
retrieve
(
JID
from
,
RetrieveRequest
request
)
{
return
getPersistenceManager
().
getConversation
(
from
.
toBareJID
(),
return
getPersistenceManager
(
from
).
getConversation
(
from
.
toBareJID
(),
request
.
getWith
(),
request
.
getStart
());
request
.
getWith
(),
request
.
getStart
());
}
}
...
...
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/xep0136/Xep0136Support.java
View file @
8161cd40
...
@@ -17,7 +17,7 @@ public class Xep0136Support extends AbstractXepSupport {
...
@@ -17,7 +17,7 @@ public class Xep0136Support extends AbstractXepSupport {
private
static
final
String
IQ_NAMESPACE
=
"urn:xmpp:archive"
;
private
static
final
String
IQ_NAMESPACE
=
"urn:xmpp:archive"
;
public
Xep0136Support
(
XMPPServer
server
)
{
public
Xep0136Support
(
XMPPServer
server
)
{
super
(
server
,
NAMESPACE_AUTO
,
IQ_NAMESPACE
,
"XEP-0136 IQ Dispatcher"
);
super
(
server
,
NAMESPACE_AUTO
,
IQ_NAMESPACE
,
"XEP-0136 IQ Dispatcher"
,
false
);
iqHandlers
=
new
ArrayList
<
IQHandler
>();
iqHandlers
=
new
ArrayList
<
IQHandler
>();
...
...
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/xep0313/IQQueryHandler.java
View file @
8161cd40
...
@@ -12,6 +12,9 @@ import org.jivesoftware.openfire.auth.UnauthorizedException;
...
@@ -12,6 +12,9 @@ import org.jivesoftware.openfire.auth.UnauthorizedException;
import
org.jivesoftware.openfire.disco.ServerFeaturesProvider
;
import
org.jivesoftware.openfire.disco.ServerFeaturesProvider
;
import
org.jivesoftware.openfire.forward.Forwarded
;
import
org.jivesoftware.openfire.forward.Forwarded
;
import
org.jivesoftware.openfire.handler.IQHandler
;
import
org.jivesoftware.openfire.handler.IQHandler
;
import
org.jivesoftware.openfire.muc.MUCRole
;
import
org.jivesoftware.openfire.muc.MUCRoom
;
import
org.jivesoftware.openfire.muc.MultiUserChatService
;
import
org.jivesoftware.openfire.session.Session
;
import
org.jivesoftware.openfire.session.Session
;
import
org.jivesoftware.util.XMPPDateTimeFormat
;
import
org.jivesoftware.util.XMPPDateTimeFormat
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -68,14 +71,45 @@ abstract class IQQueryHandler extends AbstractIQHandler implements
...
@@ -68,14 +71,45 @@ abstract class IQQueryHandler extends AbstractIQHandler implements
boolean
muc
=
false
;
boolean
muc
=
false
;
if
(!
XMPPServer
.
getInstance
().
isLocal
(
archiveJid
))
{
if
(!
XMPPServer
.
getInstance
().
isLocal
(
archiveJid
))
{
Log
.
debug
(
"Archive is not local (user)"
);
Log
.
debug
(
"Archive is not local (user)"
);
return
buildErrorResponse
(
packet
);
if
(
XMPPServer
.
getInstance
().
getMultiUserChatManager
().
getMultiUserChatService
(
archiveJid
)
==
null
)
{
Log
.
debug
(
"No chat service for this domain"
);
return
buildErrorResponse
(
packet
);
}
else
{
muc
=
true
;
Log
.
debug
(
"MUC"
);
}
}
}
JID
requestor
=
packet
.
getFrom
().
asBareJID
();
JID
requestor
=
packet
.
getFrom
().
asBareJID
();
Log
.
debug
(
"Requestor is {} for muc=={}"
,
requestor
,
muc
);
Log
.
debug
(
"Requestor is {} for muc=={}"
,
requestor
,
muc
);
// Auth checking.
// Auth checking.
if
(!
archiveJid
.
equals
(
requestor
))
{
// Not user's own
if
(
muc
)
{
MultiUserChatService
service
=
XMPPServer
.
getInstance
().
getMultiUserChatManager
().
getMultiUserChatService
(
archiveJid
);
MUCRoom
room
=
service
.
getChatRoom
(
archiveJid
.
getNode
());
if
(
room
==
null
)
{
return
buildErrorResponse
(
packet
);
}
boolean
pass
=
false
;
if
(
service
.
isSysadmin
(
requestor
))
{
pass
=
true
;
}
MUCRole
.
Affiliation
aff
=
room
.
getAffiliation
(
requestor
);
if
(
aff
!=
MUCRole
.
Affiliation
.
outcast
)
{
if
(
aff
==
MUCRole
.
Affiliation
.
owner
||
aff
==
MUCRole
.
Affiliation
.
admin
)
{
pass
=
true
;
}
else
if
(
room
.
isMembersOnly
())
{
if
(
aff
==
MUCRole
.
Affiliation
.
member
)
{
pass
=
true
;
}
}
else
{
pass
=
true
;
}
}
if
(!
pass
)
{
return
buildForbiddenResponse
(
packet
);
}
}
else
if
(!
archiveJid
.
equals
(
requestor
))
{
// Not user's own
// ... disallow unless admin.
// ... disallow unless admin.
if
(!
XMPPServer
.
getInstance
().
getAdmins
().
contains
(
requestor
))
{
if
(!
XMPPServer
.
getInstance
().
getAdmins
().
contains
(
requestor
))
{
return
buildForbiddenResponse
(
packet
);
return
buildForbiddenResponse
(
packet
);
...
@@ -162,7 +196,7 @@ abstract class IQQueryHandler extends AbstractIQHandler implements
...
@@ -162,7 +196,7 @@ abstract class IQQueryHandler extends AbstractIQHandler implements
Log
.
error
(
"Error parsing query date filters."
,
e
);
Log
.
error
(
"Error parsing query date filters."
,
e
);
}
}
return
getPersistenceManager
().
findMessages
(
return
getPersistenceManager
(
queryRequest
.
getArchive
()
).
findMessages
(
startDate
,
startDate
,
endDate
,
endDate
,
queryRequest
.
getArchive
().
toBareJID
(),
queryRequest
.
getArchive
().
toBareJID
(),
...
...
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/xep0313/Xep0313Support.java
View file @
8161cd40
...
@@ -16,7 +16,7 @@ public class Xep0313Support extends AbstractXepSupport {
...
@@ -16,7 +16,7 @@ public class Xep0313Support extends AbstractXepSupport {
private
static
final
String
NAMESPACE
=
"urn:xmpp:mam:0"
;
private
static
final
String
NAMESPACE
=
"urn:xmpp:mam:0"
;
public
Xep0313Support
(
XMPPServer
server
)
{
public
Xep0313Support
(
XMPPServer
server
)
{
super
(
server
,
NAMESPACE
,
NAMESPACE
,
"XEP-0313 IQ Dispatcher"
);
super
(
server
,
NAMESPACE
,
NAMESPACE
,
"XEP-0313 IQ Dispatcher"
,
true
);
this
.
iqHandlers
=
new
ArrayList
<>();
this
.
iqHandlers
=
new
ArrayList
<>();
iqHandlers
.
add
(
new
IQQueryHandler0
());
iqHandlers
.
add
(
new
IQQueryHandler0
());
...
...
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/xep0313/Xep0313Support1.java
View file @
8161cd40
...
@@ -15,7 +15,7 @@ public class Xep0313Support1 extends AbstractXepSupport {
...
@@ -15,7 +15,7 @@ public class Xep0313Support1 extends AbstractXepSupport {
private
static
final
String
NAMESPACE
=
"urn:xmpp:mam:1"
;
private
static
final
String
NAMESPACE
=
"urn:xmpp:mam:1"
;
public
Xep0313Support1
(
XMPPServer
server
)
{
public
Xep0313Support1
(
XMPPServer
server
)
{
super
(
server
,
NAMESPACE
,
NAMESPACE
,
"XEP-0313 IQ Dispatcher"
);
super
(
server
,
NAMESPACE
,
NAMESPACE
,
"XEP-0313 IQ Dispatcher"
,
true
);
this
.
iqHandlers
=
new
ArrayList
<>();
this
.
iqHandlers
=
new
ArrayList
<>();
iqHandlers
.
add
(
new
IQQueryHandler1
());
iqHandlers
.
add
(
new
IQQueryHandler1
());
...
...
src/plugins/monitoring/src/java/org/jivesoftware/openfire/archive/ConversationManager.java
View file @
8161cd40
...
@@ -1017,13 +1017,14 @@ public class ConversationManager implements Startable, ComponentEventListener{
...
@@ -1017,13 +1017,14 @@ public class ConversationManager implements Startable, ComponentEventListener{
}
else
{
}
else
{
pstmt
.
execute
();
pstmt
.
execute
();
}
}
count
++;
// Only batch up to 500 items at a time.
// Only batch up to 500 items at a time.
if
(
count
%
500
==
0
&&
DbConnectionManager
.
isBatchUpdatesSupported
())
{
if
(
count
>=
50
0
&&
DbConnectionManager
.
isBatchUpdatesSupported
())
{
pstmt
.
executeBatch
();
pstmt
.
executeBatch
();
count
=
0
;
}
}
count
++;
}
}
if
(
DbConnectionManager
.
isBatchUpdatesSupported
())
{
if
(
count
>
0
&&
DbConnectionManager
.
isBatchUpdatesSupported
())
{
pstmt
.
executeBatch
();
pstmt
.
executeBatch
();
}
}
...
@@ -1039,13 +1040,14 @@ public class ConversationManager implements Startable, ComponentEventListener{
...
@@ -1039,13 +1040,14 @@ public class ConversationManager implements Startable, ComponentEventListener{
}
else
{
}
else
{
pstmt
.
execute
();
pstmt
.
execute
();
}
}
count
++;
// Only batch up to 500 items at a time.
// Only batch up to 500 items at a time.
if
(
count
%
500
==
0
&&
DbConnectionManager
.
isBatchUpdatesSupported
())
{
if
(
count
>=
50
0
&&
DbConnectionManager
.
isBatchUpdatesSupported
())
{
pstmt
.
executeBatch
();
pstmt
.
executeBatch
();
count
=
0
;
}
}
count
++;
}
}
if
(
DbConnectionManager
.
isBatchUpdatesSupported
())
{
if
(
count
>
0
&&
DbConnectionManager
.
isBatchUpdatesSupported
())
{
pstmt
.
executeBatch
();
pstmt
.
executeBatch
();
}
}
...
@@ -1063,13 +1065,14 @@ public class ConversationManager implements Startable, ComponentEventListener{
...
@@ -1063,13 +1065,14 @@ public class ConversationManager implements Startable, ComponentEventListener{
}
else
{
}
else
{
pstmt
.
execute
();
pstmt
.
execute
();
}
}
count
++;
// Only batch up to 500 items at a time.
// Only batch up to 500 items at a time.
if
(
count
%
500
==
0
&&
DbConnectionManager
.
isBatchUpdatesSupported
())
{
if
(
count
>=
50
0
&&
DbConnectionManager
.
isBatchUpdatesSupported
())
{
pstmt
.
executeBatch
();
pstmt
.
executeBatch
();
count
=
0
;
}
}
count
++;
}
}
if
(
DbConnectionManager
.
isBatchUpdatesSupported
())
{
if
(
count
>
0
&&
DbConnectionManager
.
isBatchUpdatesSupported
())
{
pstmt
.
executeBatch
();
pstmt
.
executeBatch
();
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
src/plugins/monitoring/src/java/org/jivesoftware/openfire/plugin/MonitoringPlugin.java
View file @
8161cd40
...
@@ -22,6 +22,7 @@ package org.jivesoftware.openfire.plugin;
...
@@ -22,6 +22,7 @@ package org.jivesoftware.openfire.plugin;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileFilter
;
import
java.io.FileFilter
;
import
com.reucon.openfire.plugin.archive.impl.MucMamPersistenceManager
;
import
com.reucon.openfire.plugin.archive.xep0313.Xep0313Support1
;
import
com.reucon.openfire.plugin.archive.xep0313.Xep0313Support1
;
import
org.jivesoftware.openfire.XMPPServer
;
import
org.jivesoftware.openfire.XMPPServer
;
import
org.jivesoftware.openfire.archive.ArchiveIndexer
;
import
org.jivesoftware.openfire.archive.ArchiveIndexer
;
...
@@ -52,6 +53,9 @@ import com.reucon.openfire.plugin.archive.impl.ArchiveManagerImpl;
...
@@ -52,6 +53,9 @@ import com.reucon.openfire.plugin.archive.impl.ArchiveManagerImpl;
import
com.reucon.openfire.plugin.archive.impl.JdbcPersistenceManager
;
import
com.reucon.openfire.plugin.archive.impl.JdbcPersistenceManager
;
import
com.reucon.openfire.plugin.archive.xep0136.Xep0136Support
;
import
com.reucon.openfire.plugin.archive.xep0136.Xep0136Support
;
import
com.reucon.openfire.plugin.archive.xep0313.Xep0313Support
;
import
com.reucon.openfire.plugin.archive.xep0313.Xep0313Support
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.xmpp.packet.JID
;
/**
/**
* Openfire Monitoring plugin.
* Openfire Monitoring plugin.
...
@@ -70,11 +74,13 @@ public class MonitoringPlugin implements Plugin {
...
@@ -70,11 +74,13 @@ public class MonitoringPlugin implements Plugin {
private
static
MonitoringPlugin
instance
;
private
static
MonitoringPlugin
instance
;
private
boolean
enabled
=
true
;
private
boolean
enabled
=
true
;
private
PersistenceManager
persistenceManager
;
private
PersistenceManager
persistenceManager
;
private
PersistenceManager
mucPersistenceManager
;
private
ArchiveManager
archiveManager
;
private
ArchiveManager
archiveManager
;
private
IndexManager
indexManager
;
private
IndexManager
indexManager
;
private
Xep0136Support
xep0136Support
;
private
Xep0136Support
xep0136Support
;
private
Xep0313Support
xep0313Support
;
private
Xep0313Support
xep0313Support
;
private
Xep0313Support1
xep0313Support1
;
private
Xep0313Support1
xep0313Support1
;
private
Logger
Log
;
public
MonitoringPlugin
()
{
public
MonitoringPlugin
()
{
instance
=
this
;
instance
=
this
;
...
@@ -129,7 +135,12 @@ public class MonitoringPlugin implements Plugin {
...
@@ -129,7 +135,12 @@ public class MonitoringPlugin implements Plugin {
return
indexManager
;
return
indexManager
;
}
}
public
PersistenceManager
getPersistenceManager
()
{
public
PersistenceManager
getPersistenceManager
(
JID
jid
)
{
Log
.
debug
(
"Getting PersistenceManager for {}"
,
jid
);
if
(
XMPPServer
.
getInstance
().
getMultiUserChatManager
().
getMultiUserChatService
(
jid
)
!=
null
)
{
Log
.
debug
(
"Using MucPersistenceManager"
);
return
mucPersistenceManager
;
}
return
persistenceManager
;
return
persistenceManager
;
}
}
...
@@ -145,6 +156,7 @@ public class MonitoringPlugin implements Plugin {
...
@@ -145,6 +156,7 @@ public class MonitoringPlugin implements Plugin {
}
}
public
void
initializePlugin
(
PluginManager
manager
,
File
pluginDirectory
)
{
public
void
initializePlugin
(
PluginManager
manager
,
File
pluginDirectory
)
{
Log
=
LoggerFactory
.
getLogger
(
MonitoringPlugin
.
class
);
/* Configuration */
/* Configuration */
conversationTimeout
=
JiveGlobals
.
getIntProperty
(
conversationTimeout
=
JiveGlobals
.
getIntProperty
(
...
@@ -154,6 +166,7 @@ public class MonitoringPlugin implements Plugin {
...
@@ -154,6 +166,7 @@ public class MonitoringPlugin implements Plugin {
false
);
false
);
persistenceManager
=
new
JdbcPersistenceManager
();
persistenceManager
=
new
JdbcPersistenceManager
();
mucPersistenceManager
=
new
MucMamPersistenceManager
();
archiveManager
=
new
ArchiveManagerImpl
(
persistenceManager
,
archiveManager
=
new
ArchiveManagerImpl
(
persistenceManager
,
indexManager
,
conversationTimeout
);
indexManager
,
conversationTimeout
);
...
...
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