Class CaldavCredentialsResolver
It exists because there are three callers, not one: the client mints an endpoint's target and then authorizes every request on it, and the relay authorizes the requests it forwards on its own transport. Each building its own context is the divergence the contract was designed to remove — a connector kind or a channel drifting in one of them fails as a wrong provider resolved, not as a compile error.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe kind this connector is known by platform-wide, which is how a provider shared across connectors finds its CalDAV-specific adapter. -
Constructor Summary
ConstructorsConstructorDescriptionCaldavCredentialsResolver(org.exoplatform.services.connector.credentials.ConnectorCredentialsService connectorCredentialsService) -
Method Summary
Modifier and TypeMethodDescriptionauthorization(Long serverId, String providerName, String exoLogin) TheAuthorizationvalue for that account, as the configured provider produced it — Basic today, whatever a future provider answers tomorrow.voidinvalidate(Long serverId, String providerName, String exoLogin) Tells the configured provider that the material it produced for this account was refused by the calendar server, so a caching provider forgets it.targetAccount(Long serverId, String providerName, String exoLogin) The account a conversation addresses, as the configured provider names it — the user's own for Personal, someone else's for a provider that authenticates as a technical account.
-
Field Details
-
CONNECTOR_KIND
The kind this connector is known by platform-wide, which is how a provider shared across connectors finds its CalDAV-specific adapter.- See Also:
-
-
Constructor Details
-
CaldavCredentialsResolver
public CaldavCredentialsResolver(org.exoplatform.services.connector.credentials.ConnectorCredentialsService connectorCredentialsService)
-
-
Method Details
-
targetAccount
The account a conversation addresses, as the configured provider names it — the user's own for Personal, someone else's for a provider that authenticates as a technical account.- Parameters:
serverId- registration the account references, or null for the legacy propertyproviderName- provider the registration is configured withexoLogin- the eXo login the target is resolved for- Returns:
- the account name to place in the URL, or null when the provider has none to offer
- Throws:
CalDavException- when no provider of that name can answer
-
authorization
TheAuthorizationvalue for that account, as the configured provider produced it — Basic today, whatever a future provider answers tomorrow. Never assembled here.Callers resolve it per request rather than once per endpoint, deliberately: material can expire between two requests of one operation, and a scheme whose header depends on the method and the URI could not be served by a value frozen earlier. The cost is the provider's: Personal caches nothing and rebuilds from the stored setting on every call - four setting reads and a decode per request today - which is accepted for the one provider whose material never expires, and is what a caching provider removes.
Material the provider hands back already expired is never sent: it is invalidated and produced once more, and only once - a provider answering expired material twice is its own defect and surfaces as the failure below.
A failure here is deliberately a plain
CalDavExceptionand never aCalDavAuthenticationException: the latter means the calendar server refused a credential, which the sync engine answers by pausing that user's account. Failing to produce a credential is a different thing — a technical account misconfigured, a provider unable to reach its own authority — and it is the connector's fault, not this user's. Pausing them one by one would bury an administrator's problem under user-level noise.- Parameters:
serverId- registration the account references, or null for the legacy propertyproviderName- provider the registration is configured withexoLogin- the eXo login the credentials are produced for- Returns:
- the header value to send
- Throws:
CalDavException- when the configured provider cannot produce credentials for the account
-
invalidate
Tells the configured provider that the material it produced for this account was refused by the calendar server, so a caching provider forgets it. Called exactly once per refusal by the two places that see one - the client and the relay - and never in a retry loop, as the contract asks. Personal has nothing to forget and answers nothing.- Parameters:
serverId- registration the account references, or null for the legacy propertyproviderName- provider the registration is configured withexoLogin- the eXo login the refused material was produced for
-