Addressed issues from code review.

This commit is contained in:
akwizgran
2016-01-20 14:07:24 +00:00
parent c4692a7007
commit 281ca734e3
18 changed files with 115 additions and 127 deletions

View File

@@ -301,10 +301,10 @@ public interface DatabaseComponent {
void removeTransport(TransportId t) throws DbException;
/** Sets the status of the given contact. */
void setContactStatus(ContactId c, Contact.Status s) throws DbException;
void setContactStatus(ContactId c, StorageStatus s) throws DbException;
/** Sets the status of the given local pseudonym. */
void setLocalAuthorStatus(AuthorId a, LocalAuthor.Status s)
void setLocalAuthorStatus(AuthorId a, StorageStatus s)
throws DbException;
/** Marks the given message as valid or invalid. */

View File

@@ -0,0 +1,21 @@
package org.briarproject.api.db;
public enum StorageStatus {
ADDING(0), ACTIVE(1), REMOVING(2);
private final int value;
StorageStatus(int value) {
this.value = value;
}
public int getValue() {
return value;
}
public static StorageStatus fromValue(int value) {
for (StorageStatus s : values()) if (s.value == value) return s;
throw new IllegalArgumentException();
}
}