Package org.exoplatform.bluemind.client
Interface BlueMindAccountSource
public interface BlueMindAccountSource
The port through which the client obtains the credentials a session is
opened with, and the account the session may be kept for — values only, so
that the client names no host type.
Implemented by each consumer over its own credentials seam (in
bluemind-services: the calendar plugins over
CaldavCredentialsResolver, the mail engine over the mail host's
MailboxAclSession, both ending in commons-exo's
ConnectorCredentialsService). The client never resolves credentials
itself: that would make it depend on the credentials framework, and the
credentials framework's BlueMind provider depends on the client.
-
Method Summary
Modifier and TypeMethodDescriptionaccount()Produces the account's credentials, for a login.apiRoot()The server the account lives on, without producing any credentials: it is what the kept session is compared with, and producing credentials may cost BlueMind calls of its own (a technical login and a sudo).default voidTells the credentials seam that the material it produced was refused, so that the nextaccount()produces fresh material.default booleanWhether a refused login is worth one more try on fresh material: true when the material is something the provider produced and may have gone stale (underbluemind-sudo, a kept BlueMind session), false when it carries what the user typed — a second login would only be a second failed attempt against the user's account (EXO-89649).default BlueMindSessionKeyThe account a session opened with this source's credentials may be kept for and reused under (BlueMindRestClient.call(org.exoplatform.bluemind.client.BlueMindAccountSource, java.util.function.Function<org.exoplatform.bluemind.client.BlueMindSession, T>)).
-
Method Details
-
apiRoot
URI apiRoot()The server the account lives on, without producing any credentials: it is what the kept session is compared with, and producing credentials may cost BlueMind calls of its own (a technical login and a sudo).- Returns:
- any address on the server; only its scheme, host and port are used
-
account
BlueMindAccount account()Produces the account's credentials, for a login.- Returns:
- the account; its
BlueMindAccount.apiRoot()must name the same server asapiRoot(), or nothing is sent - Throws:
UnsupportedOperationException- when the configured credentials are not a login and password this API takes
-
sessionKey
The account a session opened with this source's credentials may be kept for and reused under (BlueMindRestClient.call(org.exoplatform.bluemind.client.BlueMindAccountSource, java.util.function.Function<org.exoplatform.bluemind.client.BlueMindSession, T>)). It is the source's to name because it is the source that knows which credentials it produces: a key must change whenever the credentials would name another account, or a session opened as one account would serve a call made as another.- Returns:
- the key, or null when the session must not be kept — the call then opens its own session and closes it
-
refreshable
default boolean refreshable()Whether a refused login is worth one more try on fresh material: true when the material is something the provider produced and may have gone stale (underbluemind-sudo, a kept BlueMind session), false when it carries what the user typed — a second login would only be a second failed attempt against the user's account (EXO-89649).- Returns:
- false unless the source says otherwise
-
invalidate
default void invalidate()Tells the credentials seam that the material it produced was refused, so that the nextaccount()produces fresh material. Called once per refused material, the retry's refusal included, whether or not the source isrefreshable().
-