2
2
3
3
import com .reucon .openfire .plugin .archive .model .ArchivedMessage ;
4
4
import com .reucon .openfire .plugin .archive .model .Conversation ;
5
- import com .reucon .openfire .plugin .archive .model .Participant ;
6
5
import com .reucon .openfire .plugin .archive .xep0059 .XmppResultSet ;
7
6
import org .jivesoftware .util .NotFoundException ;
8
7
import org .xmpp .packet .JID ;
9
8
10
9
import java .util .Collection ;
11
10
import java .util .Date ;
12
- import java .util .List ;
13
11
14
12
/**
15
13
* Manages database persistence.
16
14
*/
17
15
public interface PersistenceManager
18
16
{
19
- /**
20
- * Creates a new archived message.
21
- *
22
- * @param message the message to create.
23
- * @return <code>true</code> on success, <code>false</code> otherwise.
24
- */
25
- boolean createMessage (ArchivedMessage message );
26
-
27
- /**
28
- * Selects all messages and passes each message to the given callback for processing.
29
- *
30
- * @param callback callback to process messages.
31
- * @return number of messages processed.
32
- */
33
- int processAllMessages (ArchivedMessageConsumer callback );
34
-
35
- /**
36
- * Creates a new conversation.
37
- *
38
- * @param conversation the conversation to create.
39
- * @return <code>true</code> on success, <code>false</code> otherwise.
40
- */
41
- boolean createConversation (Conversation conversation );
42
-
43
- /**
44
- * Updates the end time of a conversation. The conversation must be persisted.
45
- *
46
- * @param conversation conversation to update with id and endDate attributes not null.
47
- * @return <code>true</code> on success, <code>false</code> otherwise.
48
- */
49
- boolean updateConversationEnd (Conversation conversation );
50
-
51
- /**
52
- * Adds a new participant to a conversation.
53
- *
54
- * @param participant the participant to add.
55
- * @param conversationId id of the conversation to add the participant to.
56
- * @return <code>true</code> on success, <code>false</code> otherwise.
57
- */
58
- boolean createParticipant (Participant participant , Long conversationId );
59
-
60
- List <Conversation > findConversations (String [] participants , Date startDate , Date endDate );
61
-
62
17
/**
63
18
* Searches for conversations.
64
19
*
@@ -85,10 +40,6 @@ public interface PersistenceManager
85
40
*/
86
41
Collection <ArchivedMessage > findMessages ( Date startDate , Date endDate , JID owner , JID with , String query , XmppResultSet xmppResultSet , boolean useStableID ) throws NotFoundException ;
87
42
88
- Collection <Conversation > getActiveConversations (int conversationTimeout );
89
-
90
- List <Conversation > getConversations (Collection <Long > conversationIds );
91
-
92
43
/**
93
44
* Returns the conversation with the given owner, with and start time including participants and messages.
94
45
*
@@ -97,13 +48,5 @@ public interface PersistenceManager
97
48
* @param start exact start time
98
49
* @return the matching conversation or <code>null</code> if none matches.
99
50
*/
100
- Conversation getConversation (JID owner , JID with , Date start );
101
-
102
- /**
103
- * Returns the conversation with the given id including participants and messages.
104
- *
105
- * @param conversationId id of the conversation to retrieve.
106
- * @return the matching conversation or <code>null</code> if none matches.
107
- */
108
- Conversation getConversation (Long conversationId );
51
+ Conversation getConversation (JID owner , JID with , Date start ); // TODO move to ConversationManager?
109
52
}
0 commit comments