Skip to content

Commit

Permalink
xep-0313 implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyHeavey committed May 5, 2015
1 parent 92e3eb1 commit 7096891
Show file tree
Hide file tree
Showing 32 changed files with 920 additions and 151 deletions.
4 changes: 2 additions & 2 deletions plugin.xml
Expand Up @@ -9,8 +9,8 @@
<date>10/28/2014</date>
<minServerVersion>3.9.0</minServerVersion>
<databaseKey>monitoring</databaseKey>
<databaseVersion>2</databaseVersion>
<databaseVersion>3</databaseVersion>

<adminconsole>
<tab id="tab-server">
<sidebar id="stats-dashboard" name="${admin.sidebar.statistics.name}" description="${admin.item.stats-dashboard.description}">
Expand Down
4 changes: 3 additions & 1 deletion src/database/monitoring_db2.sql
@@ -1,7 +1,7 @@
-- $Revision$
-- $Date$

INSERT INTO ofVersion (name, version) VALUES ('monitoring', 2);
INSERT INTO ofVersion (name, version) VALUES ('monitoring', 3);

CREATE TABLE ofConversation (
conversationID INTEGER NOT NULL,
Expand All @@ -28,12 +28,14 @@ CREATE INDEX entConPar_con_idx ON ofConParticipant (conversationID, bareJID, jid
CREATE INDEX entConPar_jid_idx ON ofConParticipant (bareJID);

CREATE TABLE ofMessageArchive (
messageID BIGINT NULL,
conversationID INTEGER NOT NULL,
fromJID VARCHAR(1024) NOT NULL,
fromJIDResource VARCHAR(255) NULL,
toJID VARCHAR(1024) NOT NULL,
toJIDResource VARCHAR(255) NULL,
sentDate BIGINT NOT NULL,
stanza LONG VARCHAR NULL,
body LONG VARCHAR
);
CREATE INDEX ofMessageArchive_con_idx ON ofMessageArchive (conversationID);
Expand Down
4 changes: 3 additions & 1 deletion src/database/monitoring_hsqldb.sql
@@ -1,7 +1,7 @@
// $Revision$
// $Date$

INSERT INTO ofVersion (name, version) VALUES ('monitoring', 2);
INSERT INTO ofVersion (name, version) VALUES ('monitoring', 3);

CREATE TABLE ofConversation (
conversationID BIGINT NOT NULL,
Expand All @@ -28,12 +28,14 @@ CREATE INDEX ofConParticipant_conv_idx ON ofConParticipant (conversationID, bare
CREATE INDEX ofConParticipant_jid_idx ON ofConParticipant (bareJID);

CREATE TABLE ofMessageArchive (
messageID BIGINT NULL,
conversationID BIGINT NOT NULL,
fromJID VARCHAR(1024) NOT NULL,
fromJIDResource VARCHAR(255) NULL,
toJID VARCHAR(1024) NOT NULL,
toJIDResource VARCHAR(255) NULL,
sentDate BIGINT NOT NULL,
stanza LONGVARCHAR NULL,
body LONGVARCHAR
);
CREATE INDEX ofMessageArchive_con_idx ON ofMessageArchive (conversationID);
Expand Down
4 changes: 3 additions & 1 deletion src/database/monitoring_mysql.sql
@@ -1,7 +1,7 @@
# $Revision$
# $Date$

INSERT INTO ofVersion (name, version) VALUES ('monitoring', 2);
INSERT INTO ofVersion (name, version) VALUES ('monitoring', 3);

CREATE TABLE ofConversation (
conversationID BIGINT NOT NULL,
Expand All @@ -28,12 +28,14 @@ CREATE TABLE ofConParticipant (
);

CREATE TABLE ofMessageArchive (
messageID BIGINT NULL,
conversationID BIGINT NOT NULL,
fromJID VARCHAR(255) NOT NULL,
fromJIDResource VARCHAR(100) NULL,
toJID VARCHAR(255) NOT NULL,
toJIDResource VARCHAR(100) NULL,
sentDate BIGINT NOT NULL,
stanza TEXT NULL,
body TEXT,
INDEX ofMessageArchive_con_idx (conversationID)
);
Expand Down
4 changes: 3 additions & 1 deletion src/database/monitoring_oracle.sql
@@ -1,7 +1,7 @@
-- $Revision$
-- $Date$

INSERT INTO ofVersion (name, version) VALUES ('monitoring', 2);
INSERT INTO ofVersion (name, version) VALUES ('monitoring', 3);

CREATE TABLE ofConversation (
conversationID INTEGER NOT NULL,
Expand All @@ -28,12 +28,14 @@ CREATE INDEX ofConParticipant_conv_idx ON ofConParticipant (conversationID, bare
CREATE INDEX ofConParticipant_jid_idx ON ofConParticipant (bareJID);

CREATE TABLE ofMessageArchive (
messageID INTEGER NULL,
conversationID INTEGER NOT NULL,
fromJID VARCHAR2(1024) NOT NULL,
fromJIDResource VARCHAR2(255) NULL,
toJID VARCHAR2(1024) NOT NULL,
toJIDResource VARCHAR2(255) NULL,
sentDate INTEGER NOT NULL,
stanza LONG NULL,
body LONG
);
CREATE INDEX ofMessageArchive_con_idx ON ofMessageArchive (conversationID);
Expand Down
4 changes: 3 additions & 1 deletion src/database/monitoring_postgresql.sql
@@ -1,7 +1,7 @@
-- $Revision$
-- $Date$

INSERT INTO ofVersion (name, version) VALUES ('monitoring', 2);
INSERT INTO ofVersion (name, version) VALUES ('monitoring', 3);

CREATE TABLE ofConversation (
conversationID INTEGER NOT NULL,
Expand All @@ -28,12 +28,14 @@ CREATE INDEX ofConParticipant_conv_idx ON ofConParticipant (conversationID, bare
CREATE INDEX ofConParticipant_jid_idx ON ofConParticipant (bareJID);

CREATE TABLE ofMessageArchive (
messageID BIGINT NULL,
conversationID INTEGER NOT NULL,
fromJID VARCHAR(1024) NOT NULL,
fromJIDResource VARCHAR(1024) NULL,
toJID VARCHAR(1024) NOT NULL,
toJIDResource VARCHAR(1024) NULL,
sentDate BIGINT NOT NULL,
stanza TEXT NULL,
body TEXT
);
CREATE INDEX ofMessageArchive_con_idx ON ofMessageArchive (conversationID);
Expand Down
4 changes: 3 additions & 1 deletion src/database/monitoring_sqlserver.sql
@@ -1,7 +1,7 @@
/* $Revision$ */
/* $Date$ */

INSERT INTO ofVersion (name, version) VALUES ('monitoring', 2);
INSERT INTO ofVersion (name, version) VALUES ('monitoring', 3);

CREATE TABLE ofConversation (
conversationID BIGINT NOT NULL,
Expand All @@ -28,12 +28,14 @@ CREATE INDEX ofConParticipant_conv_idx ON ofConParticipant (conversationID, bare
CREATE INDEX ofConParticipant_jid_idx ON ofConParticipant (bareJID);

CREATE TABLE ofMessageArchive (
messageID BIGINT NULL,
conversationID BIGINT NOT NULL,
fromJID NVARCHAR(1024) NOT NULL,
fromJIDResource NVARCHAR(1024) NULL,
toJID NVARCHAR(1024) NOT NULL,
toJIDResource NVARCHAR(1024) NULL,
sentDate BIGINT NOT NULL,
stanza NVARCHAR(MAX) NULL,
body NVARCHAR(MAX)
);
CREATE INDEX ofMessageArchive_con_idx ON ofMessageArchive (conversationID);
Expand Down
8 changes: 8 additions & 0 deletions src/database/upgrade/3/monitoring_db2.sql
@@ -0,0 +1,8 @@
-- $Revision$
-- $Date$

ALTER TABLE ofMessageArchive ADD COLUMN messageID BIGINT NULL;
ALTER TABLE ofMessageArchive ADD COLUMN stanza LONG VARCHAR NULL;

-- Update database version
UPDATE ofVersion SET version = 3 WHERE name = 'monitoring';
8 changes: 8 additions & 0 deletions src/database/upgrade/3/monitoring_hsqldb.sql
@@ -0,0 +1,8 @@
-- $Revision$
-- $Date$

ALTER TABLE ofMessageArchive ADD COLUMN messageID BIGINT NULL;
ALTER TABLE ofMessageArchive ADD COLUMN stanza LONGVARCHAR NULL;

-- Update database version
UPDATE ofVersion SET version = 3 WHERE name = 'monitoring';
8 changes: 8 additions & 0 deletions src/database/upgrade/3/monitoring_mysql.sql
@@ -0,0 +1,8 @@
-- $Revision$
-- $Date$

ALTER TABLE ofMessageArchive ADD COLUMN messageID BIGINT NULL;
ALTER TABLE ofMessageArchive ADD COLUMN stanza TEXT NULL;

-- Update database version
UPDATE ofVersion SET version = 3 WHERE name = 'monitoring';
10 changes: 10 additions & 0 deletions src/database/upgrade/3/monitoring_oracle.sql
@@ -0,0 +1,10 @@
-- $Revision$
-- $Date$

ALTER TABLE ofMessageArchive ADD messageID INTEGER NULL;
ALTER TABLE ofMessageArchive ADD stanza LONG NULL;

-- Update database version
UPDATE ofVersion SET version = 3 WHERE name = 'monitoring';

commit;
8 changes: 8 additions & 0 deletions src/database/upgrade/3/monitoring_postgresql.sql
@@ -0,0 +1,8 @@
-- $Revision$
-- $Date$

ALTER TABLE ofMessageArchive ADD COLUMN messageID BIGINT NULL;
ALTER TABLE ofMessageArchive ADD COLUMN stanza TEXT NULL;

-- Update database version
UPDATE ofVersion SET version = 3 WHERE name = 'monitoring';
8 changes: 8 additions & 0 deletions src/database/upgrade/3/monitoring_sqlserver.sql
@@ -0,0 +1,8 @@
-- $Revision$
-- $Date$

ALTER TABLE ofMessageArchive ADD messageID BIGINT NULL;
ALTER TABLE ofMessageArchive ADD stanza NVARCHAR(MAX) NULL;

-- Update database version
UPDATE ofVersion SET version = 3 WHERE name = 'monitoring';
Expand Up @@ -65,10 +65,22 @@ public interface PersistenceManager
* @param owner bare jid of the owner of the conversation to find or <code>null</code> for any.
* @param with bare jid of the communication partner or <code>null</code> for any. This is either
* the jid of another XMPP user or the jid of a group chat.
* @return the conversations that matched search critera without messages and participants.
* @return the conversations that matched search criteria without messages and participants.
*/
Collection<Conversation> findConversations(Date startDate, Date endDate, String owner, String with, XmppResultSet xmppResultSet);

/**
* Searches for messages.
*
* @param startDate earliest start date of the message to find or <code>null</code> for any.
* @param endDate latest end date of the message to find or <code>null</code> for any.
* @param owner bare jid of the owner of the message to find or <code>null</code> for any.
* @param with bare jid of the communication partner or <code>null</code> for any. This is either
* the jid of another XMPP user or the jid of a group chat.
* @return the messages that matched search criteria.
*/
Collection<ArchivedMessage> findMessages(Date startDate, Date endDate, String owner, String with, XmppResultSet xmppResultSet);

Collection<Conversation> getActiveConversations(int conversationTimeout);

List<Conversation> getConversations(Collection<Long> conversationIds);
Expand Down

0 comments on commit 7096891

Please sign in to comment.