mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Separated MessageHeader interface from Message interface.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package net.sf.briar.api.protocol;
|
||||
|
||||
public interface Message {
|
||||
import java.io.InputStream;
|
||||
|
||||
public interface Message extends MessageHeader {
|
||||
|
||||
/**
|
||||
* The maximum length of a message body in bytes. To allow for future
|
||||
@@ -19,30 +21,15 @@ public interface Message {
|
||||
/** The length of the random salt in bytes. */
|
||||
static final int SALT_LENGTH = 8;
|
||||
|
||||
/** Returns the message's unique identifier. */
|
||||
MessageId getId();
|
||||
/** Returns the length of the message in bytes. */
|
||||
int getLength();
|
||||
|
||||
/** Returns the serialised representation of the entire message. */
|
||||
byte[] getSerialisedBytes();
|
||||
|
||||
/**
|
||||
* Returns the message's parent, or MessageId.NONE if this is the first
|
||||
* message in a thread.
|
||||
* Returns a stream for reading the serialised representation of the entire
|
||||
* message.
|
||||
*/
|
||||
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 size of the message in bytes. */
|
||||
int getSize();
|
||||
|
||||
/** Returns the serialised representation of the message. */
|
||||
byte[] getBytes();
|
||||
InputStream getSerialisedStream();
|
||||
}
|
||||
25
api/net/sf/briar/api/protocol/MessageHeader.java
Normal file
25
api/net/sf/briar/api/protocol/MessageHeader.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package net.sf.briar.api.protocol;
|
||||
|
||||
public interface MessageHeader {
|
||||
|
||||
/** 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();
|
||||
}
|
||||
Reference in New Issue
Block a user