mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Initial implementation of client versioning client.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package org.briarproject.bramble.api.sync;
|
||||
|
||||
import org.briarproject.bramble.api.contact.Contact;
|
||||
import org.briarproject.bramble.api.db.DbException;
|
||||
import org.briarproject.bramble.api.db.Transaction;
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.bramble.api.sync.Group.Visibility;
|
||||
|
||||
@NotNullByDefault
|
||||
public interface ClientVersioningManager {
|
||||
|
||||
/**
|
||||
* The unique ID of the versioning client.
|
||||
*/
|
||||
ClientId CLIENT_ID = new ClientId("org.briarproject.bramble.versioning");
|
||||
|
||||
/**
|
||||
* The current version of the versioning client.
|
||||
*/
|
||||
int CLIENT_VERSION = 0;
|
||||
|
||||
void registerClient(ClientId clientId, int clientVersion);
|
||||
|
||||
void registerClientVersioningHook(ClientId clientId, int clientVersion,
|
||||
ClientVersioningHook hook);
|
||||
|
||||
interface ClientVersioningHook {
|
||||
|
||||
void onClientVisibilityChanging(Transaction txn, Contact c,
|
||||
Visibility v) throws DbException;
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,9 @@ public interface SyncConstants {
|
||||
*/
|
||||
int MAX_RECORD_PAYLOAD_LENGTH = 48 * 1024; // 48 KiB
|
||||
|
||||
/** The maximum length of a group descriptor in bytes. */
|
||||
/**
|
||||
* The maximum length of a group descriptor in bytes.
|
||||
*/
|
||||
int MAX_GROUP_DESCRIPTOR_LENGTH = 16 * 1024; // 16 KiB
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user