Interface AgendaUserSettingsService
-
Method Summary
Modifier and TypeMethodDescriptiongetAgendaUserSettings(long identityId) Get list of user settings to use in events by defaultgetAvailabilitySharing(long userIdentityId) Returns how widely the given user lets their busy time be disclosed to other people.Retrieves the globally configured embed map provider identifier.voidRemoves the globally configured embed map provider setting.voidremoveUserConnector(String connectorName, long userIdentityId) Removes a connected account from the user's agenda settings, leaving the accounts held on other providers untouched.voidsaveAgendaUserSettings(long identityId, AgendaUserSettings agendaUserSettings) Save user agenda settings to use in events by defaultvoidsaveAvailabilitySharing(long userIdentityId, AvailabilitySharing availabilitySharing) Records how widely a user lets their busy time be disclosed to other people.voidsaveEmbedMapProvider(String providerId) Saves the globally configured embed map provider identifier.voidsaveUserConnector(String connectorName, String connectorUserId, long userIdentityId) Saves a connected account on a remote events provider.
-
Method Details
-
saveAgendaUserSettings
Save user agenda settings to use in events by default- Parameters:
identityId- technical identifier ofIdentityagendaUserSettings- object ofAgendaUserSettings
-
getAgendaUserSettings
Get list of user settings to use in events by default- Parameters:
identityId- technical identifier ofIdentity- Returns:
AgendaUserSettings
-
saveUserConnector
Saves a connected account on a remote events provider. The account is upserted per provider: a user may hold several accounts at the same time (typically one CalDAV account plus one or more remote accounts), at most one per provider, so connecting a provider that already holds an account replaces that account's remote user id and leaves the other providers' accounts untouched.- Parameters:
connectorName- connector identifierconnectorUserId- user identifier on remote provideruserIdentityId- user social identifier
-
removeUserConnector
Removes a connected account from the user's agenda settings, leaving the accounts held on other providers untouched. A blank connector name removes every connected account, which is the behaviour the reset had when only one account could exist.- Parameters:
connectorName- connector identifier of the account to remove, or blank to remove them alluserIdentityId- user social identifier
-
getDefaultReminders
List<EventReminderParameter> getDefaultReminders()- Returns:
ListofEventReminderParameterthat will be used for users who didn't changed default settings about preferred reminders
-
getEmbedMapProvider
String getEmbedMapProvider()Retrieves the globally configured embed map provider identifier. This setting is shared across all users of the platform.- Returns:
- the provider id (e.g.
"google-maps"or"openStreet-map"), ornullif no provider has been explicitly configured
-
saveEmbedMapProvider
Saves the globally configured embed map provider identifier. This setting is shared across all users of the platform.- Parameters:
providerId- the identifier of the map provider to use, must not be blank- Throws:
IllegalArgumentException- ifproviderIdis blank
-
removeEmbedMapProvider
void removeEmbedMapProvider()Removes the globally configured embed map provider setting. After this call,getEmbedMapProvider()will returnnull. -
getAvailabilitySharing
Returns how widely the given user lets their busy time be disclosed to other people.A user who has never chosen gets
AvailabilitySharing.DEFAULT. A stored value that cannot be understood is treated asAvailabilitySharing.NOBODY: absence means "never chose", which the default answers, whereas an unreadable value is a broken store, and a broken store must not widen a disclosure.This is the only reader of that stored value. What it means for who may read whose free/busy is decided in exactly one other place,
AgendaAvailabilityService— this method reports a preference, it does not grant anything.- Parameters:
userIdentityId- technical identifier of the user whose choice is wanted- Returns:
- the user's choice, never
null
-
saveAvailabilitySharing
Records how widely a user lets their busy time be disclosed to other people.The value is stored under its own settings key rather than inside the
AgendaUserSettingsblob, because that blob is replaced wholesale byPUT /v1/agenda/settingswith whatever the client sends: a client unaware of the field would silently reset a user's disclosure choice, which is not a thing a settings save may do by omission.Only the user concerned may change their own choice; the caller is responsible for having established that the identity it passes is the authenticated one, as for every other per-user setting here.
- Parameters:
userIdentityId- technical identifier of the user making the choiceavailabilitySharing- the choice to record- Throws:
IllegalArgumentException- when the identity is not a positive identifier, or the choice isnull
-