Create PrivateGroupManager Facade and stub implementation

This commit is contained in:
Torsten Grote
2016-09-28 16:54:28 -03:00
parent 8b50cb1461
commit 6ece398a21
38 changed files with 691 additions and 146 deletions

View File

@@ -1,44 +1,18 @@
package org.briarproject.api.forum;
import org.briarproject.api.clients.BaseGroup;
import org.briarproject.api.sharing.Shareable;
import org.briarproject.api.sync.Group;
import org.briarproject.api.sync.GroupId;
public class Forum implements Shareable {
private final Group group;
private final String name;
private final byte[] salt;
public class Forum extends BaseGroup implements Shareable {
public Forum(Group group, String name, byte[] salt) {
this.group = group;
this.name = name;
this.salt = salt;
}
public GroupId getId() {
return group.getId();
}
public Group getGroup() {
return group;
}
public String getName() {
return name;
}
public byte[] getSalt() {
return salt;
}
@Override
public int hashCode() {
return group.hashCode();
super(group, name, salt);
}
@Override
public boolean equals(Object o) {
return o instanceof Forum && group.equals(((Forum) o).group);
return o instanceof Forum && super.equals(o);
}
}

View File

@@ -1,30 +1,25 @@
package org.briarproject.api.forum;
import org.briarproject.api.clients.BaseMessage;
import org.briarproject.api.identity.Author;
import org.briarproject.api.sync.Message;
import org.briarproject.api.sync.MessageId;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class ForumPost {
public class ForumPost extends BaseMessage {
private final Message message;
private final MessageId parent;
private final Author author;
public ForumPost(Message message, MessageId parent, Author author) {
this.message = message;
this.parent = parent;
public ForumPost(@NotNull Message message, @Nullable MessageId parent,
@Nullable Author author) {
super(message, parent);
this.author = author;
}
public Message getMessage() {
return message;
}
public MessageId getParent() {
return parent;
}
@Nullable
public Author getAuthor() {
return author;
}
}