Moved MessageHeader into DB component and added read/starred flags.

This commit is contained in:
akwizgran
2011-10-26 17:07:09 +01:00
parent 0f6b0e88c1
commit 6d91603bf7
14 changed files with 108 additions and 83 deletions

View File

@@ -16,7 +16,6 @@ import net.sf.briar.api.protocol.Batch;
import net.sf.briar.api.protocol.Group;
import net.sf.briar.api.protocol.GroupId;
import net.sf.briar.api.protocol.Message;
import net.sf.briar.api.protocol.MessageHeader;
import net.sf.briar.api.protocol.MessageId;
import net.sf.briar.api.protocol.Offer;
import net.sf.briar.api.protocol.SubscriptionUpdate;

View File

@@ -1,4 +1,8 @@
package net.sf.briar.api.protocol;
package net.sf.briar.api.db;
import net.sf.briar.api.protocol.AuthorId;
import net.sf.briar.api.protocol.GroupId;
import net.sf.briar.api.protocol.MessageId;
public interface MessageHeader {
@@ -22,4 +26,10 @@ public interface MessageHeader {
/** Returns the timestamp created by the message's author. */
long getTimestamp();
/** Returns true if the message has been read. */
boolean getRead();
/** Returns true if the message has been starred. */
boolean getStarred();
}

View File

@@ -1,6 +1,6 @@
package net.sf.briar.api.protocol;
public interface Message extends MessageHeader {
public interface Message {
/**
* The maximum length of a message body in bytes. To allow for future
@@ -19,6 +19,27 @@ public interface Message extends MessageHeader {
/** The length of the random salt in bytes. */
static final int SALT_LENGTH = 8;
/** Returns the message's unique identifier. */
MessageId getId();
/**
* Returns the message's parent, or MessageId.NONE if this is the first
* message in a thread.
*/
MessageId getParent();
/** Returns the group to which the message belongs. */
GroupId getGroup();
/** Returns the message's author. */
AuthorId getAuthor();
/** Returns the message's subject line. */
String getSubject();
/** Returns the timestamp created by the message's author. */
long getTimestamp();
/** Returns the length of the serialised message in bytes. */
int getLength();

View File

@@ -1,7 +0,0 @@
package net.sf.briar.api.protocol;
public interface MessageHeaderFactory {
MessageHeader createMessageHeader(MessageId id, MessageId parent,
GroupId group, AuthorId author, String subject, long timestamp);
}