Use author encoding and parsing helpers everywhere.

This commit is contained in:
akwizgran
2018-01-16 17:38:21 +00:00
parent 68634e0f28
commit e474042af7
24 changed files with 190 additions and 290 deletions

View File

@@ -24,10 +24,6 @@ public interface BlogConstants {
String KEY_TYPE = "type";
String KEY_TIMESTAMP = "timestamp";
String KEY_TIME_RECEIVED = "timeReceived";
String KEY_AUTHOR_ID = "id";
String KEY_FORMAT_VERSION = "formatVersion";
String KEY_AUTHOR_NAME = "name";
String KEY_PUBLIC_KEY = "publicKey";
String KEY_AUTHOR = "author";
String KEY_RSS_FEED = "rssFeed";
String KEY_READ = "read";

View File

@@ -16,26 +16,26 @@ public class Feed {
private final Blog blog;
private final LocalAuthor localAuthor;
@Nullable
private final String description, author;
private final String description, rssAuthor;
private final long added, updated, lastEntryTime;
public Feed(String url, Blog blog, LocalAuthor localAuthor,
@Nullable String description, @Nullable String author, long added,
long updated, long lastEntryTime) {
@Nullable String description, @Nullable String rssAuthor,
long added, long updated, long lastEntryTime) {
this.url = url;
this.blog = blog;
this.localAuthor = localAuthor;
this.description = description;
this.author = author;
this.rssAuthor = rssAuthor;
this.added = added;
this.updated = updated;
this.lastEntryTime = lastEntryTime;
}
public Feed(String url, Blog blog, LocalAuthor localAuthor,
@Nullable String description, @Nullable String author, long added) {
this(url, blog, localAuthor, description, author, added, 0L, 0L);
@Nullable String description, @Nullable String rssAuthor,
long added) {
this(url, blog, localAuthor, description, rssAuthor, added, 0L, 0L);
}
public Feed(String url, Blog blog, LocalAuthor localAuthor, long added) {
@@ -68,8 +68,8 @@ public class Feed {
}
@Nullable
public String getAuthor() {
return author;
public String getRssAuthor() {
return rssAuthor;
}
public long getAdded() {

View File

@@ -18,12 +18,10 @@ public interface FeedConstants {
// group metadata keys
String KEY_FEEDS = "feeds";
String KEY_FEED_URL = "feedURL";
String KEY_FORMAT_VERSION = "formatVersion";
String KEY_BLOG_TITLE = "blogTitle";
String KEY_PUBLIC_KEY = "publicKey";
String KEY_PRIVATE_KEY = "privateKey";
String KEY_FEED_DESC = "feedDesc";
String KEY_FEED_AUTHOR = "feedAuthor";
String KEY_FEED_PRIVATE_KEY = "feedPrivateKey";
String KEY_FEED_DESC = "feedDesc";
String KEY_FEED_RSS_AUTHOR = "feedRssAuthor";
String KEY_FEED_ADDED = "feedAdded";
String KEY_FEED_UPDATED = "feedUpdated";
String KEY_FEED_LAST_ENTRY = "feedLastEntryTime";

View File

@@ -23,10 +23,6 @@ public interface ForumConstants {
String KEY_TIMESTAMP = "timestamp";
String KEY_PARENT = "parent";
String KEY_AUTHOR = "author";
String KEY_ID = "id";
String KEY_FORMAT_VERSION = "formatVersion";
String KEY_NAME = "name";
String KEY_PUBLIC_KEY = "publicKey";
String KEY_LOCAL = "local";
String KEY_READ = "read";

View File

@@ -11,12 +11,12 @@ public interface PrivateGroupFactory {
/**
* Creates a private group with the given name and author.
*/
PrivateGroup createPrivateGroup(String name, Author author);
PrivateGroup createPrivateGroup(String name, Author creator);
/**
* Creates a private group with the given name, author and salt.
*/
PrivateGroup createPrivateGroup(String name, Author author, byte[] salt);
PrivateGroup createPrivateGroup(String name, Author creator, byte[] salt);
/**
* Parses a group and returns the corresponding PrivateGroup.