StorageStatus is no longer needed.

This commit is contained in:
akwizgran
2016-02-11 15:02:41 +00:00
parent 6505db58e6
commit 074892b677
13 changed files with 28 additions and 193 deletions

View File

@@ -1,6 +1,5 @@
package org.briarproject.api.contact;
import org.briarproject.api.db.StorageStatus;
import org.briarproject.api.identity.Author;
import org.briarproject.api.identity.AuthorId;
@@ -9,14 +8,11 @@ public class Contact {
private final ContactId id;
private final Author author;
private final AuthorId localAuthorId;
private final StorageStatus status;
public Contact(ContactId id, Author author, AuthorId localAuthorId,
StorageStatus status) {
public Contact(ContactId id, Author author, AuthorId localAuthorId) {
this.id = id;
this.author = author;
this.localAuthorId = localAuthorId;
this.status = status;
}
public ContactId getId() {
@@ -31,10 +27,6 @@ public class Contact {
return localAuthorId;
}
public StorageStatus getStatus() {
return status;
}
@Override
public int hashCode() {
return id.hashCode();

View File

@@ -317,18 +317,6 @@ public interface DatabaseComponent {
*/
void removeTransport(Transaction txn, TransportId t) throws DbException;
/**
* Sets the status of the given contact.
*/
void setContactStatus(Transaction txn, ContactId c, StorageStatus s)
throws DbException;
/**
* Sets the status of the given local pseudonym.
*/
void setLocalAuthorStatus(Transaction txn, AuthorId a, StorageStatus s)
throws DbException;
/**
* Marks the given message as shared or unshared.
*/

View File

@@ -1,21 +0,0 @@
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();
}
}

View File

@@ -1,20 +1,16 @@
package org.briarproject.api.identity;
import org.briarproject.api.db.StorageStatus;
/** A pseudonym for the local user. */
public class LocalAuthor extends Author {
private final byte[] privateKey;
private final long created;
private final StorageStatus status;
public LocalAuthor(AuthorId id, String name, byte[] publicKey,
byte[] privateKey, long created, StorageStatus status) {
byte[] privateKey, long created) {
super(id, name, publicKey);
this.privateKey = privateKey;
this.created = created;
this.status = status;
}
/** Returns the private key used to generate the pseudonym's signatures. */
@@ -29,9 +25,4 @@ public class LocalAuthor extends Author {
public long getTimeCreated() {
return created;
}
/** Returns the status of the pseudonym. */
public StorageStatus getStatus() {
return status;
}
}