Update JavaDoc for SharingState change

This commit is contained in:
Torsten Grote
2023-01-16 10:30:32 -03:00
parent e52cbd896e
commit c5fb1416bd
2 changed files with 33 additions and 5 deletions

View File

@@ -80,8 +80,10 @@ public interface GroupInvitationManager extends ConversationClient {
Collection<GroupInvitationItem> getInvitations() throws DbException;
/**
* Returns true if the given contact can be invited to the given private
* group.
* Returns the current {@link SharingStatus} for the given {@link Contact}
* and {@link PrivateGroup} identified by the given {@link GroupId}.
* This indicates whether the {@link PrivateGroup} can be shared
* with the contact.
*/
SharingStatus getSharingStatus(Contact c, GroupId g) throws DbException;
}

View File

@@ -18,7 +18,27 @@ public interface SharingManager<S extends Shareable>
extends ConversationClient {
enum SharingStatus {
SHAREABLE, INVITED, SHARING, NOT_SUPPORTED
/**
* The {@link Shareable} can be shared with the requested contact.
*/
SHAREABLE,
/**
* The {@link Shareable} can not be shared with the requested contact,
* because of an ongoing sharing session.
* In most cases, this means that the contact was already invited.
*/
INVITED,
/**
* The {@link Shareable} can not be shared with the requested contact,
* because it is already being shared.
*/
SHARING,
/**
* The {@link Shareable} can not be shared with the requested contact,
* because it is not supported by that contact.
* This could be a missing or outdated client.
*/
NOT_SUPPORTED
}
/**
@@ -82,12 +102,18 @@ public interface SharingManager<S extends Shareable>
throws DbException;
/**
* Returns true if the group not already shared and no invitation is open
* Returns the current {@link SharingStatus} for the given {@link Contact}
* and {@link Shareable} identified by the given {@link GroupId}.
* This indicates whether the {@link Shareable} can be shared
* with the contact.
*/
SharingStatus getSharingStatus(GroupId g, Contact c) throws DbException;
/**
* Returns true if the group not already shared and no invitation is open
* Returns the current {@link SharingStatus} for the given {@link Contact}
* and {@link Shareable} identified by the given {@link GroupId}.
* This indicates whether the {@link Shareable} can be shared
* with the contact.
*/
SharingStatus getSharingStatus(Transaction txn, GroupId g, Contact c)
throws DbException;