mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +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.
|
||||
*
|
||||
* @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.
|
||||
* If this is thrown, delivery will be attempted again at next startup,
|
||||
* whereas if a FormatException is thrown, the message will be permanently
|
||||
|
||||
@@ -164,8 +164,20 @@ public interface ContactManager {
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,6 +102,9 @@ public interface LifecycleManager {
|
||||
|
||||
enum Priority {EARLY, NORMAL, LATE}
|
||||
|
||||
/**
|
||||
* @param txn A read-write transaction
|
||||
*/
|
||||
void onDatabaseOpened(Transaction txn) throws DbException;
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,8 @@ public interface IncomingMessageHook {
|
||||
/**
|
||||
* 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.
|
||||
* If this is thrown, delivery will be attempted again at next startup,
|
||||
* whereas if an InvalidMessageException is thrown,
|
||||
|
||||
@@ -46,7 +46,14 @@ public interface ClientVersioningManager {
|
||||
ClientId clientId, int majorVersion) throws DbException;
|
||||
|
||||
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,
|
||||
Visibility v) throws DbException;
|
||||
}
|
||||
|
||||
@@ -124,6 +124,12 @@ public interface BlogManager {
|
||||
void registerRemoveBlogHook(RemoveBlogHook hook);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -100,6 +100,12 @@ public interface ForumManager {
|
||||
void setReadFlag(GroupId g, MessageId m, boolean read) throws DbException;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,9 +140,22 @@ public interface PrivateGroupManager {
|
||||
@NotNullByDefault
|
||||
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)
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user