Rename client version to major version.

This commit is contained in:
akwizgran
2018-04-16 16:35:48 +01:00
parent cadb17987c
commit 2e570ba50d
68 changed files with 296 additions and 296 deletions

View File

@@ -12,19 +12,19 @@ public interface ContactGroupFactory {
/**
* Creates a group that is not shared with any contacts.
*/
Group createLocalGroup(ClientId clientId, int clientVersion);
Group createLocalGroup(ClientId clientId, int majorVersion);
/**
* Creates a group for the given client to share with the given contact.
*/
Group createContactGroup(ClientId clientId, int clientVersion,
Group createContactGroup(ClientId clientId, int majorVersion,
Contact contact);
/**
* Creates a group for the given client to share between the given authors
* identified by their AuthorIds.
*/
Group createContactGroup(ClientId clientId, int clientVersion,
Group createContactGroup(ClientId clientId, int majorVersion,
AuthorId authorId1, AuthorId authorId2);
}

View File

@@ -241,7 +241,7 @@ public interface DatabaseComponent {
* <p/>
* Read-only.
*/
Collection<Group> getGroups(Transaction txn, ClientId c, int clientVersion)
Collection<Group> getGroups(Transaction txn, ClientId c, int majorVersion)
throws DbException;
/**

View File

@@ -18,9 +18,9 @@ public interface TransportPropertyManager {
ClientId CLIENT_ID = new ClientId("org.briarproject.bramble.properties");
/**
* The current version of the transport property client.
* The current major version of the transport property client.
*/
int CLIENT_VERSION = 0;
int MAJOR_VERSION = 0;
/**
* Stores the given properties received while adding a contact - they will

View File

@@ -17,22 +17,22 @@ public interface ClientVersioningManager {
ClientId CLIENT_ID = new ClientId("org.briarproject.bramble.versioning");
/**
* The current version of the versioning client.
* The current major version of the versioning client.
*/
int CLIENT_VERSION = 0;
int MAJOR_VERSION = 0;
/**
* Registers a client that will be advertised to contacts. This method
* should be called before {@link LifecycleManager#startServices(String)}.
*/
void registerClient(ClientId clientId, int clientVersion);
void registerClient(ClientId clientId, int majorVersion);
/**
* Registers a hook that will be called when the visibility of the given
* client changes. This method should be called before
* {@link LifecycleManager#startServices(String)}.
*/
void registerClientVersioningHook(ClientId clientId, int clientVersion,
void registerClientVersioningHook(ClientId clientId, int majorVersion,
ClientVersioningHook hook);
/**
@@ -40,7 +40,7 @@ public interface ClientVersioningManager {
* contact.
*/
Visibility getClientVisibility(Transaction txn, ContactId contactId,
ClientId clientId, int clientVersion) throws DbException;
ClientId clientId, int majorVersion) throws DbException;
interface ClientVersioningHook {

View File

@@ -32,16 +32,16 @@ public class Group {
private final GroupId id;
private final ClientId clientId;
private final int clientVersion;
private final int majorVersion;
private final byte[] descriptor;
public Group(GroupId id, ClientId clientId, int clientVersion,
public Group(GroupId id, ClientId clientId, int majorVersion,
byte[] descriptor) {
if (descriptor.length > MAX_GROUP_DESCRIPTOR_LENGTH)
throw new IllegalArgumentException();
this.id = id;
this.clientId = clientId;
this.clientVersion = clientVersion;
this.majorVersion = majorVersion;
this.descriptor = descriptor;
}
@@ -60,10 +60,10 @@ public class Group {
}
/**
* Returns the version of the client to which the group belongs.
* Returns the major version of the client to which the group belongs.
*/
public int getClientVersion() {
return clientVersion;
public int getMajorVersion() {
return majorVersion;
}
/**

View File

@@ -6,7 +6,7 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
public interface GroupFactory {
/**
* Creates a group with the given client ID, client version and descriptor.
* Creates a group with the given client ID, major version and descriptor.
*/
Group createGroup(ClientId c, int clientVersion, byte[] descriptor);
Group createGroup(ClientId c, int majorVersion, byte[] descriptor);
}

View File

@@ -37,7 +37,7 @@ public interface ValidationManager {
* Registers the message validator for the given client. This method
* should be called before {@link LifecycleManager#startServices(String)}.
*/
void registerMessageValidator(ClientId c, int clientVersion,
void registerMessageValidator(ClientId c, int majorVersion,
MessageValidator v);
/**
@@ -46,7 +46,7 @@ public interface ValidationManager {
* method should be called before
* {@link LifecycleManager#startServices(String)}.
*/
void registerIncomingMessageHook(ClientId c, int clientVersion,
void registerIncomingMessageHook(ClientId c, int majorVersion,
IncomingMessageHook hook);
interface MessageValidator {