mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
StorageStatus is no longer needed.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user