Add javadocs to DB hook interfaces.

This commit is contained in:
akwizgran
2019-04-26 16:42:36 +01:00
parent 56fbc93962
commit 891c82b2e5
8 changed files with 52 additions and 3 deletions

View File

@@ -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

View File

@@ -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;
}
}

View File

@@ -102,6 +102,9 @@ public interface LifecycleManager {
enum Priority {EARLY, NORMAL, LATE}
/**
* @param txn A read-write transaction
*/
void onDatabaseOpened(Transaction txn) throws DbException;
}
}

View File

@@ -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,

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -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;
}