Class BlueMindSubscriptionClient
Why a subscription at all. A CS:share writes an access entry
and nothing else (SharingProtocol.java); BlueMind's DAV home lists
subscriptions, not readable containers (DavStore.java,
getCalendarDavResource), and so does its webmail, whose "Add"
modal subscribes a readable-but-unsubscribed container with
offlineSync=true (SubscribeOtherContainersModal.vue). So a
calendar shared from eXo is invisible to the colleague — in eXo and in
BlueMind — until somebody subscribes them, and this client does what their
"Add" click would.
The call.
POST /api/users/{domainUid}/subscriptions/{subject}/_subscribe with a
JSON array of {containerUid, offlineSync, automount}
(parent/user/net.bluemind.user.api/.../IUserSubscription.java,
ContainerSubscription.java); the reverse is _unsubscribe
with an array of container uids. The service checks
ROLE_MANAGE_USER_SUBSCRIPTIONS or ROLE_SELF on the subject
in the container's domain (UserSubscriptionService.java) — the
subject's own session, same domain — and no access check: subscribing is a
per-user display preference, readable or not. A subscription that already
exists is updated, not refused, so the call is idempotent. The answer is a
200 with an empty body; a fault is {errorCode, errorType, message}
— 403 for PERMISSION_DENIED, and for an unknown container
NOT_FOUND (subscriptionToContainer), which
ResponseBuilder.replyServerFault sends as a 500 at BlueMind master
and which this client also accepts as a 404, since no capture has yet
settled which of the two a live server sends; both are the same absence
here.
Whose session, and the one check that guards it. The session is
opened with the colleague's stored credentials — the endpoint is
minted for their eXo login — because only they may edit their
subscriptions. The {domainUid} in the path is not stored anywhere in
eXo; it comes from the login answer, as does authUser.uid, and the
client refuses before any POST when that uid is not the one it was
asked to edit (BlueMindSubjectMismatchException): a principal
recorded from a stale discovery, or a colleague reconnected as somebody
else, must never make eXo edit another account with a password it holds.
The session is still closed by BlueMindRestSession.call(org.exoplatform.caldav.client.CalDavEndpoint, java.util.function.Function<org.exoplatform.caldav.client.bluemind.BlueMindRestSession.Session, T>).
Same server, the colleague's credentials from storage, one session per job,
nothing secret in a message: BlueMindRestSession's rules, shared
with every other REST conversation this add-on holds with BlueMind.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanWhether the subscription is mounted in the colleague's views at once.static final booleanWhether the subscribed calendar also synchronises to the colleague's devices: BlueMind's own webmail default, and the PO's choice — the calendar reaches their phone as a hand subscription would. -
Constructor Summary
ConstructorsConstructorDescriptionThe client Spring builds, over the shared session. -
Method Summary
Modifier and TypeMethodDescription<T> TasSharee(CalDavEndpoint shareeEndpoint, String shareeUid, Function<BlueMindSubscriptions, T> job) Runs edits of one colleague's subscriptions in one session opened as them, after checking the session is theirs.ownersOf(CalDavEndpoint accountEndpoint) Whose each calendar in an account's view is, read as the account itself (EXO-90347).voidsubscribe(CalDavEndpoint shareeEndpoint, String shareeUid, String containerUid) Subscribes one colleague to one container, in a session of its own.voidunsubscribe(CalDavEndpoint shareeEndpoint, String shareeUid, String containerUid) Unsubscribes one colleague from one container, in a session of its own.
-
Field Details
-
OFFLINE_SYNC
public static final boolean OFFLINE_SYNCWhether the subscribed calendar also synchronises to the colleague's devices: BlueMind's own webmail default, and the PO's choice — the calendar reaches their phone as a hand subscription would.- See Also:
-
AUTOMOUNT
public static final boolean AUTOMOUNTWhether the subscription is mounted in the colleague's views at once.- See Also:
-
-
Constructor Details
-
BlueMindSubscriptionClient
The client Spring builds, over the shared session.- Parameters:
session- the REST session every BlueMind conversation shares
-
-
Method Details
-
subscribe
Subscribes one colleague to one container, in a session of its own.- Parameters:
shareeEndpoint- the colleague's DAV endpoint, minted for their eXo loginshareeUid- the directory entry uid eXo recorded for themcontainerUid- the container uid- Throws:
CalDavException- asasSharee(org.exoplatform.caldav.client.CalDavEndpoint, java.lang.String, java.util.function.Function<org.exoplatform.caldav.client.bluemind.BlueMindSubscriptions, T>)andBlueMindSubscriptions.subscribe(java.lang.String)throw
-
unsubscribe
Unsubscribes one colleague from one container, in a session of its own.- Parameters:
shareeEndpoint- the colleague's DAV endpoint, minted for their eXo loginshareeUid- the directory entry uid eXo recorded for themcontainerUid- the container uid- Throws:
CalDavException- asasSharee(org.exoplatform.caldav.client.CalDavEndpoint, java.lang.String, java.util.function.Function<org.exoplatform.caldav.client.bluemind.BlueMindSubscriptions, T>)andBlueMindSubscriptions.unsubscribe(java.lang.String)throw
-
ownersOf
Whose each calendar in an account's view is, read as the account itself (EXO-90347).GET /api/users/{domainUid}/subscriptions/{uid}?type=calendar(IUserSubscription.listSubscriptions), in a session opened with the account's stored credentials, addressed to the uid BlueMind authenticated that session as — never a uid a caller names, so the listing read is by construction the account's own. The answer is a JSON array ofContainerSubscriptionDescriptor, of which two members are read:containerUidandowner; an entry lacking either is skipped. Captured live on 2026-09-16 (bluemind-rest-subscriptions-after-subscribe.captured.json): the account's own calendars carry its uid as owner, a colleague's shared calendar carries the colleague's, a pool vehicle carries the resource's.The same session rules as every other call here: same server, the account's credentials from storage, one session per call, closed afterwards, nothing secret in a message.
- Parameters:
accountEndpoint- the account's DAV endpoint, minted from the registry for the user's eXo login- Returns:
- the authenticated uid and the owner of every listed calendar
- Throws:
UnsupportedOperationException- when the account's configured credentials are not a login and passwordCalDavAuthenticationException- when BlueMind refuses the login or the sessionCalDavForbiddenException- when BlueMind refuses the listingCalDavUnreachableException- when the server cannot be reachedCalDavException- when the login names no uid or no domain, or the answer is anything but a JSON array