mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Blog Client with Factory and Validator
This implements a simple initial blog client that covers the basic blog actions, but no deletion/removal of blogs, yet. Classes for Blogs and Blog Post Headers have been introduced along with the associated factories. A `BlogPostValidator` has been added that validates incoming blog posts. Closes #402 Closes #404
This commit is contained in:
55
briar-api/src/org/briarproject/api/clients/PostHeader.java
Normal file
55
briar-api/src/org/briarproject/api/clients/PostHeader.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package org.briarproject.api.clients;
|
||||
|
||||
import org.briarproject.api.identity.Author;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
|
||||
public abstract class PostHeader {
|
||||
|
||||
private final MessageId id;
|
||||
private final MessageId parentId;
|
||||
private final long timestamp;
|
||||
private final Author author;
|
||||
private final Author.Status authorStatus;
|
||||
private final String contentType;
|
||||
private final boolean read;
|
||||
|
||||
public PostHeader(MessageId id, MessageId parentId, long timestamp,
|
||||
Author author, Author.Status authorStatus, String contentType,
|
||||
boolean read) {
|
||||
this.id = id;
|
||||
this.parentId = parentId;
|
||||
this.timestamp = timestamp;
|
||||
this.author = author;
|
||||
this.authorStatus = authorStatus;
|
||||
this.contentType = contentType;
|
||||
this.read = read;
|
||||
}
|
||||
|
||||
public MessageId getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Author getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public Author.Status getAuthorStatus() {
|
||||
return authorStatus;
|
||||
}
|
||||
|
||||
public String getContentType() {
|
||||
return contentType;
|
||||
}
|
||||
|
||||
public long getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public boolean isRead() {
|
||||
return read;
|
||||
}
|
||||
|
||||
public MessageId getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user