Class CaldavConnectorServiceImpl

java.lang.Object
org.exoplatform.caldav.service.CaldavConnectorServiceImpl
All Implemented Interfaces:
org.exoplatform.caldav.service.CaldavConnectorService

public class CaldavConnectorServiceImpl extends Object implements org.exoplatform.caldav.service.CaldavConnectorService
  • Constructor Details

    • CaldavConnectorServiceImpl

      public CaldavConnectorServiceImpl(CaldavConnectorStorage caldavConnectorStorage)
  • Method Details

    • createCaldavSetting

      public void createCaldavSetting(org.exoplatform.caldav.model.CaldavUserSetting caldavUserSetting, long userIdentityId) throws IllegalAccessException
      Specified by:
      createCaldavSetting in interface org.exoplatform.caldav.service.CaldavConnectorService
      Throws:
      IllegalAccessException
    • getCaldavSetting

      public org.exoplatform.caldav.model.CaldavUserSetting getCaldavSetting(long userIdentityId)
      Retrieves the CalDAV settings of a user, with the base URL of the server the account speaks to resolved in this order: the declared server the account references, else the seed registration, else the legacy exo.agenda.caldav.connector.url property — today's behaviour, kept for deployments whose registry is empty.

      Two relay-era guarantees are made here. The password never leaves the platform: it is blanked before the setting is returned, since the only consumer of this method is the settings REST the browser reads, and the browser no longer speaks to CalDAV servers itself — the relay injects the stored credentials server-side. And the serverId is the effective one: when the registry resolves a row (the referenced one, else the seed), its id is set on the DTO even for legacy accounts that stored none, because that id is how the browser addresses the relay.

      Specified by:
      getCaldavSetting in interface org.exoplatform.caldav.service.CaldavConnectorService
      Parameters:
      userIdentityId - User identity getting the caldav user setting
      Returns:
      the setting of that user, its caldavUrl resolved, its password blanked, never null
    • getCaldavServerService

      protected CaldavServerService getCaldavServerService()
      Resolves the server registry lazily through the kernel/Spring bridge, and remembers it. A registry that cannot be resolved (the Spring context not up yet, or a test container without it) simply leaves the legacy property-based URL in charge.
      Returns:
      the registry, or null when the bridge cannot provide it
    • getCaldavSyncService

      protected CaldavSyncService getCaldavSyncService()
      Resolves the sync engine lazily through the kernel/Spring bridge, and remembers it. An engine that cannot be resolved — the Spring context not up yet, or a test container without it — simply leaves the throttle alone, which costs a first sync its promptness and nothing else.
      Returns:
      the engine, or null when the bridge cannot provide it
    • getCaldavDeletionService

      protected CaldavDeletionService getCaldavDeletionService()
      The deletion engine, resolved through the bridge on first use.

      Null when it cannot be resolved, and disconnecting then removes the settings and nothing else — the previous behaviour. Leaving a mirror calendar behind is a poor outcome; refusing to disconnect because of it would be a worse one.

      Returns:
      the engine, or null when the bridge cannot provide it
    • setCaldavDeletionService

      protected void setCaldavDeletionService(CaldavDeletionService caldavDeletionService)
      Hands the deletion engine to tests, which have no container to resolve it from.
      Parameters:
      caldavDeletionService - the engine to use
    • setCaldavSyncService

      protected void setCaldavSyncService(CaldavSyncService caldavSyncService)
      Hands the engine to tests, which have no container to resolve it from.
      Parameters:
      caldavSyncService - the engine to use
    • setCaldavServerService

      protected void setCaldavServerService(CaldavServerService caldavServerService)
      Hands the registry to tests, which have no container to resolve it from.
      Parameters:
      caldavServerService - the registry to use
    • deleteCaldavSetting

      public void deleteCaldavSetting(long userIdentityId)
      Specified by:
      deleteCaldavSetting in interface org.exoplatform.caldav.service.CaldavConnectorService
    • deleteCaldavSetting

      public void deleteCaldavSetting(long userIdentityId, String username)
      Specified by:
      deleteCaldavSetting in interface org.exoplatform.caldav.service.CaldavConnectorService
    • getCaldavConnectionIdentityService

      protected CaldavConnectionIdentityService getCaldavConnectionIdentityService()
      The connection-identity engine, resolved through the bridge on first use.
      Returns:
      the engine, or null when the bridge cannot provide it
    • setCaldavConnectionIdentityService

      protected void setCaldavConnectionIdentityService(CaldavConnectionIdentityService caldavConnectionIdentityService)
      Hands the connection-identity engine to tests, which have no container to resolve it from.
      Parameters:
      caldavConnectionIdentityService - the engine to use
    • saveMirrorCalendarHref

      public void saveMirrorCalendarHref(String mirrorCalendarHref, long userIdentityId)
      Specified by:
      saveMirrorCalendarHref in interface org.exoplatform.caldav.service.CaldavConnectorService