diff options
author | Damian Minkov <damencho@jitsi.org> | 2014-11-18 11:11:20 +0200 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2014-11-18 11:29:13 +0200 |
commit | d47cbb28e3613a0b1c59e408e0fa15d74c8053fb (patch) | |
tree | c2b8deb7083fd6a4f6612e2eb173a5543a066ee6 /src/net/java/sip/communicator/service | |
parent | 12d551f7a15b1aeb9aafe6449c9911a8f82bd97e (diff) | |
download | jitsi-d47cbb28e3613a0b1c59e408e0fa15d74c8053fb.zip jitsi-d47cbb28e3613a0b1c59e408e0fa15d74c8053fb.tar.gz jitsi-d47cbb28e3613a0b1c59e408e0fa15d74c8053fb.tar.bz2 |
Adds advanced msg history service, to allow plugins to insert messages into the history, and tests for the implementation.
Diffstat (limited to 'src/net/java/sip/communicator/service')
-rw-r--r-- | src/net/java/sip/communicator/service/history/HistoryWriter.java | 15 | ||||
-rw-r--r-- | src/net/java/sip/communicator/service/msghistory/MessageHistoryAdvancedService.java | 39 |
2 files changed, 54 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/service/history/HistoryWriter.java b/src/net/java/sip/communicator/service/history/HistoryWriter.java index 3d952b3..413b300 100644 --- a/src/net/java/sip/communicator/service/history/HistoryWriter.java +++ b/src/net/java/sip/communicator/service/history/HistoryWriter.java @@ -70,6 +70,21 @@ public interface HistoryWriter throws IOException; /** + * Stores the passed propertyValues complying with the + * historyRecordStructure. + * + * @param propertyValues + * The values of the record. + * @param timestamp + * The timestamp of the record. + * + * @throws IOException + */ + public void insertRecord( + String[] propertyValues, Date timestamp, String timestampProperty) + throws IOException; + + /** * Updates a record by searching for record with idProperty which have idValue * and updating/creating the property with newValue. * diff --git a/src/net/java/sip/communicator/service/msghistory/MessageHistoryAdvancedService.java b/src/net/java/sip/communicator/service/msghistory/MessageHistoryAdvancedService.java new file mode 100644 index 0000000..53786cb --- /dev/null +++ b/src/net/java/sip/communicator/service/msghistory/MessageHistoryAdvancedService.java @@ -0,0 +1,39 @@ +/* + * Jitsi, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.service.msghistory; + +import net.java.sip.communicator.service.protocol.*; + +import java.util.*; + +/** + * Adds advanced operation to the message service like inserting/editing + * messages. Can be used to insert messages when synchronizing history with + * external source. + * @author Damian Minkov + */ +public interface MessageHistoryAdvancedService +{ + /** + * Inserts message to the history. Allows to update the already saved + * history. + * @param direction String direction of the message in or out. + * @param source The source Contact + * @param destination The destination Contact + * @param message Message message to be written + * @param messageTimestamp Date this is the timestamp when was message + * received that came from the protocol provider + * @param isSmsSubtype whether message to write is an sms + */ + public void insertMessage( + String direction, + Contact source, + Contact destination, + Message message, + Date messageTimestamp, + boolean isSmsSubtype); +} |