Extract ForumFactory from ForumManager

The code for creating forums in ForumManager was used by
ForumSharingManager and also needed by InviteeEngine.
This extracts it into its own class.

Closes #375
This commit is contained in:
Torsten Grote
2016-05-16 16:56:44 -03:00
parent fb85345392
commit aad9f5142b
9 changed files with 110 additions and 61 deletions

View File

@@ -0,0 +1,11 @@
package org.briarproject.api.forum;
public interface ForumFactory {
/** Creates a forum with the given name. */
Forum createForum(String name);
/** Creates a forum with the given name and salt. */
Forum createForum(String name, byte[] salt);
}

View File

@@ -13,14 +13,8 @@ public interface ForumManager {
/** Returns the unique ID of the forum client. */
ClientId getClientId();
/** Creates a forum with the given name. */
Forum createForum(String name);
/** Creates a forum with the given name and salt. */
Forum createForum(String name, byte[] salt);
/** Subscribes to a forum. */
void addForum(Forum f) throws DbException;
Forum addForum(String name) throws DbException;
/** Unsubscribes from a forum. */
void removeForum(Forum f) throws DbException;