Interface AgendaUserSettingsService


public interface AgendaUserSettingsService
  • Method Details

    • saveAgendaUserSettings

      void saveAgendaUserSettings(long identityId, AgendaUserSettings agendaUserSettings)
      Save user agenda settings to use in events by default
      Parameters:
      identityId - technical identifier of Identity
      agendaUserSettings - object of AgendaUserSettings
    • getAgendaUserSettings

      AgendaUserSettings getAgendaUserSettings(long identityId)
      Get list of user settings to use in events by default
      Parameters:
      identityId - technical identifier of Identity
      Returns:
      AgendaUserSettings
    • saveUserConnector

      void saveUserConnector(String connectorName, String connectorUserId, long userIdentityId)
      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 identifier
      connectorUserId - user identifier on remote provider
      userIdentityId - user social identifier
    • removeUserConnector

      void removeUserConnector(String connectorName, long userIdentityId)
      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 all
      userIdentityId - user social identifier
    • getDefaultReminders

      List<EventReminderParameter> getDefaultReminders()
      Returns:
      List of EventReminderParameter that 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"), or null if no provider has been explicitly configured
    • saveEmbedMapProvider

      void saveEmbedMapProvider(String providerId)
      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 - if providerId is blank
    • removeEmbedMapProvider

      void removeEmbedMapProvider()
      Removes the globally configured embed map provider setting. After this call, getEmbedMapProvider() will return null.
    • getAvailabilitySharing

      AvailabilitySharing getAvailabilitySharing(long userIdentityId)
      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 as AvailabilitySharing.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

      void saveAvailabilitySharing(long userIdentityId, AvailabilitySharing availabilitySharing)
      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 AgendaUserSettings blob, because that blob is replaced wholesale by PUT /v1/agenda/settings with 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 choice
      availabilitySharing - the choice to record
      Throws:
      IllegalArgumentException - when the identity is not a positive identifier, or the choice is null