Resolve merge conflict with social-backup-poc

This commit is contained in:
ameba23
2021-10-06 11:32:11 +02:00
33 changed files with 768 additions and 83 deletions

View File

@@ -0,0 +1,22 @@
package org.briarproject.briar.api.handshakekeyexchange;
import org.briarproject.bramble.api.sync.ClientId;
import org.briarproject.briar.api.conversation.ConversationManager;
public interface HandshakeKeyExchangeManager extends ConversationManager.ConversationClient {
/**
* The unique ID of the client.
*/
ClientId CLIENT_ID = new ClientId("org.briarproject.briar.handshakekeyexchange");
/**
* The current major version of the handshake key exchange client.
*/
int MAJOR_VERSION = 0;
/**
* The current minor version of the handshake key exchange client.
*/
int MINOR_VERSION = 0;
}

View File

@@ -1,17 +1,22 @@
package org.briarproject.briar.api.socialbackup;
import org.briarproject.bramble.api.identity.Identity;
import org.briarproject.bramble.api.plugin.TransportId;
import org.briarproject.bramble.api.properties.TransportProperties;
import java.util.List;
import java.util.Map;
public class SocialBackup {
private Identity identity;
private List<ContactData> contacts;
private Map<TransportId, TransportProperties> localTransportProperties;
private int version;
public SocialBackup (Identity identity, List<ContactData> contacts, int version) {
public SocialBackup (Identity identity, List<ContactData> contacts, Map<TransportId, TransportProperties> localTransportProperties, int version) {
this.identity = identity;
this.contacts = contacts;
this.localTransportProperties = localTransportProperties;
this.version = version;
}
@@ -23,6 +28,10 @@ public class SocialBackup {
return contacts;
}
public Map<TransportId, TransportProperties> getLocalTransportProperties() {
return localTransportProperties;
}
public int getVersion() {
return version;
}

View File

@@ -6,17 +6,21 @@ import org.briarproject.briar.api.socialbackup.ReturnShardPayload;
import org.briarproject.briar.api.socialbackup.SocialBackup;
import java.security.GeneralSecurityException;
import java.util.Set;
public interface RestoreAccount {
enum AddReturnShardPayloadResult {
DUPLICATE,
MISMATCH,
OK
OK,
RECOVERED
}
int getNumberOfShards();
Set<String> getEncodedShards();
AddReturnShardPayloadResult addReturnShardPayload(ReturnShardPayload toAdd);
boolean canRecover();
@@ -25,5 +29,11 @@ public interface RestoreAccount {
SocialBackup getSocialBackup();
void addContactsToDb() throws DbException;
// void addContactsToDb() throws DbException;
void restoreFromPrevious(Set<String> previousShards);
void restoreAccountWhenDatabaseReady() throws DbException;
// void addLocalTransportProperties() throws DbException;
}