mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 05:09:53 +01:00
Add javadocs to DB hook interfaces.
This commit is contained in:
@@ -33,7 +33,8 @@ public abstract class BdfIncomingMessageHook implements IncomingMessageHook {
|
|||||||
/**
|
/**
|
||||||
* Called once for each incoming message that passes validation.
|
* Called once for each incoming message that passes validation.
|
||||||
*
|
*
|
||||||
* @return whether or not this message should be shared
|
* @param txn A read-write transaction
|
||||||
|
* @return Whether or not this message should be shared
|
||||||
* @throws DbException Should only be used for real database errors.
|
* @throws DbException Should only be used for real database errors.
|
||||||
* If this is thrown, delivery will be attempted again at next startup,
|
* If this is thrown, delivery will be attempted again at next startup,
|
||||||
* whereas if a FormatException is thrown, the message will be permanently
|
* whereas if a FormatException is thrown, the message will be permanently
|
||||||
|
|||||||
@@ -164,8 +164,20 @@ public interface ContactManager {
|
|||||||
|
|
||||||
interface ContactHook {
|
interface ContactHook {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a contact is being added.
|
||||||
|
*
|
||||||
|
* @param txn A read-write transaction
|
||||||
|
* @param c The contact that is being added
|
||||||
|
*/
|
||||||
void addingContact(Transaction txn, Contact c) throws DbException;
|
void addingContact(Transaction txn, Contact c) throws DbException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a contact is being removed
|
||||||
|
*
|
||||||
|
* @param txn A read-write transaction
|
||||||
|
* @param c The contact that is being removed
|
||||||
|
*/
|
||||||
void removingContact(Transaction txn, Contact c) throws DbException;
|
void removingContact(Transaction txn, Contact c) throws DbException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,6 +102,9 @@ public interface LifecycleManager {
|
|||||||
|
|
||||||
enum Priority {EARLY, NORMAL, LATE}
|
enum Priority {EARLY, NORMAL, LATE}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param txn A read-write transaction
|
||||||
|
*/
|
||||||
void onDatabaseOpened(Transaction txn) throws DbException;
|
void onDatabaseOpened(Transaction txn) throws DbException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,8 @@ public interface IncomingMessageHook {
|
|||||||
/**
|
/**
|
||||||
* Called once for each incoming message that passes validation.
|
* Called once for each incoming message that passes validation.
|
||||||
*
|
*
|
||||||
* @return whether or not this message should be shared
|
* @param txn A read-write transaction
|
||||||
|
* @return Whether or not this message should be shared
|
||||||
* @throws DbException Should only be used for real database errors.
|
* @throws DbException Should only be used for real database errors.
|
||||||
* If this is thrown, delivery will be attempted again at next startup,
|
* If this is thrown, delivery will be attempted again at next startup,
|
||||||
* whereas if an InvalidMessageException is thrown,
|
* whereas if an InvalidMessageException is thrown,
|
||||||
|
|||||||
@@ -46,7 +46,14 @@ public interface ClientVersioningManager {
|
|||||||
ClientId clientId, int majorVersion) throws DbException;
|
ClientId clientId, int majorVersion) throws DbException;
|
||||||
|
|
||||||
interface ClientVersioningHook {
|
interface ClientVersioningHook {
|
||||||
|
/**
|
||||||
|
* Called when the visibility of a client with respect to a contact is
|
||||||
|
* changing.
|
||||||
|
*
|
||||||
|
* @param txn A read-write transaction
|
||||||
|
* @param c The contact affected by the visibility change
|
||||||
|
* @param v The new visibility of the client
|
||||||
|
*/
|
||||||
void onClientVisibilityChanging(Transaction txn, Contact c,
|
void onClientVisibilityChanging(Transaction txn, Contact c,
|
||||||
Visibility v) throws DbException;
|
Visibility v) throws DbException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,6 +124,12 @@ public interface BlogManager {
|
|||||||
void registerRemoveBlogHook(RemoveBlogHook hook);
|
void registerRemoveBlogHook(RemoveBlogHook hook);
|
||||||
|
|
||||||
interface RemoveBlogHook {
|
interface RemoveBlogHook {
|
||||||
|
/**
|
||||||
|
* Called when a blog is being removed.
|
||||||
|
*
|
||||||
|
* @param txn A read-write transaction
|
||||||
|
* @param b The blog that is being removed
|
||||||
|
*/
|
||||||
void removingBlog(Transaction txn, Blog b) throws DbException;
|
void removingBlog(Transaction txn, Blog b) throws DbException;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,12 @@ public interface ForumManager {
|
|||||||
void setReadFlag(GroupId g, MessageId m, boolean read) throws DbException;
|
void setReadFlag(GroupId g, MessageId m, boolean read) throws DbException;
|
||||||
|
|
||||||
interface RemoveForumHook {
|
interface RemoveForumHook {
|
||||||
|
/**
|
||||||
|
* Called when a forum is being removed.
|
||||||
|
*
|
||||||
|
* @param txn A read-write transaction
|
||||||
|
* @param f The forum that is being removed
|
||||||
|
*/
|
||||||
void removingForum(Transaction txn, Forum f) throws DbException;
|
void removingForum(Transaction txn, Forum f) throws DbException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,9 +140,22 @@ public interface PrivateGroupManager {
|
|||||||
@NotNullByDefault
|
@NotNullByDefault
|
||||||
interface PrivateGroupHook {
|
interface PrivateGroupHook {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a member is being added to a private group.
|
||||||
|
*
|
||||||
|
* @param txn A read-write transaction
|
||||||
|
* @param g The ID of the private group
|
||||||
|
* @param a The member that is being added
|
||||||
|
*/
|
||||||
void addingMember(Transaction txn, GroupId g, Author a)
|
void addingMember(Transaction txn, GroupId g, Author a)
|
||||||
throws DbException;
|
throws DbException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a private group is being removed.
|
||||||
|
*
|
||||||
|
* @param txn A read-write transaction
|
||||||
|
* @param g The ID of the private group that is being removed
|
||||||
|
*/
|
||||||
void removingGroup(Transaction txn, GroupId g) throws DbException;
|
void removingGroup(Transaction txn, GroupId g) throws DbException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user