Class CaldavConnectorServiceImpl
- All Implemented Interfaces:
org.exoplatform.caldav.service.CaldavConnectorService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateCaldavSetting(org.exoplatform.caldav.model.CaldavUserSetting caldavUserSetting, long userIdentityId) voidcreateProviderBackedSetting(org.exoplatform.caldav.model.CaldavUserSetting caldavUserSetting, long userIdentityId) Records a connection whose credentials the platform produces, so no password was ever typed and none is stored.voiddeleteCaldavSetting(long userIdentityId) voiddeleteCaldavSetting(long userIdentityId, String username) protected org.exoplatform.agenda.service.AgendaCalendarShareServiceAgenda's calendar share service, resolved through the bridge on first use: a Spring@Serviceof the agenda add-on, reached from this Kernel component as the other engines are.protected CaldavConnectionIdentityServiceThe connection-identity engine, resolved through the bridge on first use.protected CaldavDeletionServiceThe deletion engine, resolved through the bridge on first use.protected CaldavServerOwnerServiceThe engine keeping what each account's mailbox sees, resolved lazily as its siblings are.protected CaldavServerServiceResolves the server registry lazily through the kernel/Spring bridge, and remembers it.org.exoplatform.caldav.model.CaldavUserSettinggetCaldavSetting(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 legacyexo.agenda.caldav.connector.urlproperty — today's behaviour, kept for deployments whose registry is empty.protected CaldavSyncServiceResolves the sync engine lazily through the kernel/Spring bridge, and remembers it.protected CalendarServerFlavourRegistryThe installed server flavours, resolved lazily as the engines above are.voidsaveMirrorCalendarHref(String mirrorCalendarHref, long userIdentityId) protected voidsetAgendaCalendarShareService(org.exoplatform.agenda.service.AgendaCalendarShareService agendaCalendarShareService) Hands agenda's calendar share service to tests, which have no container to resolve it from.protected voidsetCaldavConnectionIdentityService(CaldavConnectionIdentityService caldavConnectionIdentityService) Hands the connection-identity engine to tests, which have no container to resolve it from.protected voidsetCaldavDeletionService(CaldavDeletionService caldavDeletionService) Hands the deletion engine to tests, which have no container to resolve it from.protected voidsetCaldavServerOwnerService(CaldavServerOwnerService caldavServerOwnerService) The seam the tests use.protected voidsetCaldavServerService(CaldavServerService caldavServerService) Hands the registry to tests, which have no container to resolve it from.protected voidsetCaldavSyncService(CaldavSyncService caldavSyncService) Hands the engine to tests, which have no container to resolve it from.protected voidsetCalendarServerFlavourRegistry(CalendarServerFlavourRegistry calendarServerFlavourRegistry) The seam the tests use.
-
Constructor Details
-
CaldavConnectorServiceImpl
-
-
Method Details
-
createCaldavSetting
public void createCaldavSetting(org.exoplatform.caldav.model.CaldavUserSetting caldavUserSetting, long userIdentityId) throws IllegalAccessException - Specified by:
createCaldavSettingin interfaceorg.exoplatform.caldav.service.CaldavConnectorService- Throws:
IllegalAccessException
-
createProviderBackedSetting
public void createProviderBackedSetting(org.exoplatform.caldav.model.CaldavUserSetting caldavUserSetting, long userIdentityId) throws IllegalAccessException Records a connection whose credentials the platform produces, so no password was ever typed and none is stored.The caller has verified that the configured provider needs nothing from the user - this method is reachable only from the one-click connect path, which refuses a provider that asks. Getting that wrong would connect an account nobody proved anything about, which is why the check lives at the entry point rather than here, where it could only repeat it.
Everything that follows a typed connection follows this one too: the frozen bindings thaw, the throttle is forgotten and the destinations are established. A user connected in a click is owed their calendars exactly as much as one who typed a password.
- Specified by:
createProviderBackedSettingin interfaceorg.exoplatform.caldav.service.CaldavConnectorService- Parameters:
caldavUserSetting- the account the provider named, with no passworduserIdentityId- identity of the connecting user- Throws:
IllegalAccessException- when no account is named
-
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 legacyexo.agenda.caldav.connector.urlproperty — 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:
getCaldavSettingin interfaceorg.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
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
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
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
Hands the deletion engine to tests, which have no container to resolve it from.- Parameters:
caldavDeletionService- the engine to use
-
setCaldavSyncService
Hands the engine to tests, which have no container to resolve it from.- Parameters:
caldavSyncService- the engine to use
-
setCaldavServerService
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:
deleteCaldavSettingin interfaceorg.exoplatform.caldav.service.CaldavConnectorService
-
deleteCaldavSetting
- Specified by:
deleteCaldavSettingin interfaceorg.exoplatform.caldav.service.CaldavConnectorService
-
getCalendarServerFlavourRegistry
The installed server flavours, resolved lazily as the engines above are.- Returns:
- the registry, or null when it cannot be resolved
-
setCalendarServerFlavourRegistry
protected void setCalendarServerFlavourRegistry(CalendarServerFlavourRegistry calendarServerFlavourRegistry) The seam the tests use.- Parameters:
calendarServerFlavourRegistry- the installed server flavours
-
getCaldavServerOwnerService
The engine keeping what each account's mailbox sees, resolved lazily as its siblings are.- Returns:
- the engine, or null when it cannot be resolved
-
setCaldavServerOwnerService
The seam the tests use.- Parameters:
caldavServerOwnerService- the engine keeping what each account's mailbox sees
-
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
- Specified by:
saveMirrorCalendarHrefin interfaceorg.exoplatform.caldav.service.CaldavConnectorService
-