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
8028f7db
Commit
8028f7db
authored
Feb 16, 2018
by
Guus der Kinderen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-1486: Monitoring plugin - MUC MAM should allow for backwards-paging RSM.
parent
5ff3a19e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
18 deletions
+37
-18
changelog.html
src/plugins/monitoring/changelog.html
+6
-0
plugin.xml
src/plugins/monitoring/plugin.xml
+2
-2
pom.xml
src/plugins/monitoring/pom.xml
+1
-1
MucMamPersistenceManager.java
...penfire/plugin/archive/impl/MucMamPersistenceManager.java
+12
-15
XmppResultSet.java
...reucon/openfire/plugin/archive/xep0059/XmppResultSet.java
+16
-0
No files found.
src/plugins/monitoring/changelog.html
View file @
8028f7db
...
...
@@ -43,6 +43,12 @@
<h1>
Monitoring Plugin Changelog
</h1>
<p><b>
1.6.0
</b>
-- Feb 16, 2018
</p>
<ul>
<li>
[
<a
href=
'https://issues.igniterealtime.org/browse/OF-1486'
>
OF-1486
</a>
] - MAM RSM queries for MUC should allow for 'backwards-paging'.
</li>
</ul>
<p><b>
1.5.9
</b>
-- Feb 13, 2018
</p>
<ul>
<li>
[
<a
href=
'https://issues.igniterealtime.org/browse/OF-1482'
>
OF-1482
</a>
] - MAM query response for MUC should have a 'from'.
</li>
...
...
src/plugins/monitoring/plugin.xml
View file @
8028f7db
...
...
@@ -5,8 +5,8 @@
<name>
Monitoring Service
</name>
<description>
Monitors conversations and statistics of the server.
</description>
<author>
IgniteRealtime // Jive Software
</author>
<version>
1.
5.9
</version>
<date>
2/1
3
/2018
</date>
<version>
1.
6.0
</version>
<date>
2/1
6
/2018
</date>
<minServerVersion>
4.1.0
</minServerVersion>
<databaseKey>
monitoring
</databaseKey>
<databaseVersion>
4
</databaseVersion>
...
...
src/plugins/monitoring/pom.xml
View file @
8028f7db
...
...
@@ -8,7 +8,7 @@
</parent>
<groupId>
org.igniterealtime.openfire.plugins
</groupId>
<artifactId>
monitoring
</artifactId>
<version>
1.
5.9
</version>
<version>
1.
6.0
</version>
<name>
Monitoring Plugin
</name>
<description>
Monitors conversations and statistics of the server.
</description>
...
...
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/impl/MucMamPersistenceManager.java
View file @
8028f7db
...
...
@@ -6,39 +6,28 @@ 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.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
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
;
import
java.util.*
;
/**
* Created by dwd on 25/07/16.
*/
public
class
MucMamPersistenceManager
implements
PersistenceManager
{
private
final
static
Logger
Log
=
LoggerFactory
.
getLogger
(
MucMamPersistenceManager
.
class
);
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) "
;
...
...
@@ -83,6 +72,7 @@ public class MucMamPersistenceManager implements PersistenceManager {
@Override
public
Collection
<
ArchivedMessage
>
findMessages
(
Date
startDate
,
Date
endDate
,
String
owner
,
String
with
,
XmppResultSet
xmppResultSet
)
{
Log
.
debug
(
"Finding messages of owner '{}' with start date '{}', end date '{}' with '{}' and resultset '{}'."
,
new
Object
[]
{
owner
,
startDate
,
endDate
,
with
,
xmppResultSet
}
);
JID
mucRoom
=
new
JID
(
owner
);
MultiUserChatManager
manager
=
XMPPServer
.
getInstance
().
getMultiUserChatManager
();
MultiUserChatService
service
=
manager
.
getMultiUserChatService
(
mucRoom
);
...
...
@@ -166,12 +156,19 @@ public class MucMamPersistenceManager implements PersistenceManager {
}
// TODO - Not great, really should be done by suitable LIMIT stuff.
// Would need to reverse ordering in some cases and then reverse results.
boolean
pagingBackwards
=
xmppResultSet
.
getBefore
()
!=
null
&&
xmppResultSet
.
getAfter
()
==
null
;
if
(
pagingBackwards
)
{
Collections
.
reverse
(
msgs
);
}
boolean
complete
=
true
;
xmppResultSet
.
setCount
(
msgs
.
size
());
while
(
msgs
.
size
()
>
max
)
{
msgs
.
remove
(
msgs
.
size
()
-
1
);
complete
=
false
;
}
if
(
pagingBackwards
)
{
Collections
.
reverse
(
msgs
);
}
xmppResultSet
.
setComplete
(
complete
);
if
(
msgs
.
size
()
>
0
)
{
xmppResultSet
.
setFirst
(
msgs
.
get
(
0
).
getId
());
...
...
src/plugins/monitoring/src/java/com/reucon/openfire/plugin/archive/xep0059/XmppResultSet.java
View file @
8028f7db
...
...
@@ -212,4 +212,20 @@ public class XmppResultSet
return
set
;
}
@Override
public
String
toString
()
{
return
"XmppResultSet{"
+
"after="
+
after
+
", before="
+
before
+
", index="
+
index
+
", max="
+
max
+
", first="
+
first
+
", firstIndex="
+
firstIndex
+
", last="
+
last
+
", count="
+
count
+
", complete="
+
complete
+
'}'
;
}
}
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