Package org.exoplatform.caldav.plugin
Interface CalendarSubscriptionChannel
- All Known Implementing Classes:
BlueMindSubscriptionChannel,NoSubscriptionChannel
public interface CalendarSubscriptionChannel
How a calendar server product lays out, and lets eXo edit, the calendars
an account subscribes to — the calendars of somebody else that its
DAV listing shows under the account's own home, and that a share only
reaches once the colleague is subscribed.
How it is found. CalendarSubscriptionChannelRegistry
collects every bean implementing this interface, across web applications:
a contributor is a Spring @Service, never final. The channel
of an account is the first one that names its principal's uid
(userUidOf(java.lang.String)); a listed collection is a subscription when the first
channel that reads one in it says so (subscriptionOf(java.lang.String, java.lang.String)).
What happens without one. A listed collection is what the DAV
listing says it is (no subscription is recognised by its name), no owner
listing is read, and a subscription change eXo owes an account is
abandoned with a reason at the next drain rather than retried
(NoSubscriptionChannel).
-
Method Summary
Modifier and TypeMethodDescription<T> TasSubscriber(CalDavEndpoint endpoint, String userUid, Function<SubscriptionEdits, T> job) Runs subscription edits in one session opened as a user, after checking the session really is theirs.id()The channel's stable identifier, for the log.ownersOf(CalDavEndpoint endpoint) The owner of every calendar an account's session sees, as the server itself answers it.subscriptionOf(String href, String principal) The subscription a collection listed in an account's home is, when its name says it belongs to somebody else.The uid this product addresses a user by, read from their DAV principal.
-
Method Details
-
id
String id()The channel's stable identifier, for the log.- Returns:
- the identifier, never blank
-
userUidOf
The uid this product addresses a user by, read from their DAV principal.- Parameters:
principal- a principal path, any spelling, may be null- Returns:
- the uid, or null when the principal is not one of this product's user principals — acting on a guessed uid is worse than not acting
-
subscriptionOf
The subscription a collection listed in an account's home is, when its name says it belongs to somebody else.- Parameters:
href- the collection's path, raw or canonicalprincipal- the account's own principal path, may be null or blank when the server named none- Returns:
- the subscription, or null when the collection is not one, names the account itself, or no principal is known
-
asSubscriber
Runs subscription edits in one session opened as a user, after checking the session really is theirs.- Type Parameters:
T- what the job produces- Parameters:
endpoint- the user's DAV endpoint, minted for their eXo loginuserUid- the uid eXo recorded for themjob- the edits to make- Returns:
- what the job produced
- Throws:
UnsupportedOperationException- when the user's configured credentials cannot open such a sessionCalDavSubjectMismatchException- when the server authenticated somebody other than the recorded uid; nothing was sentCalDavException- when the session cannot be opened or an edit is answered with a failure
-
ownersOf
The owner of every calendar an account's session sees, as the server itself answers it.- Parameters:
endpoint- the account's endpoint- Returns:
- the listing, never null
- Throws:
UnsupportedOperationException- when the account's configured credentials cannot open such a sessionRuntimeException- whatever stops the listing from being read
-