Class MailAccountSource
- All Implemented Interfaces:
org.exoplatform.bluemind.client.BlueMindAccountSource
bluemind-client asks for it: the connector's
BlueMind server, and the login and password the mail host's own session
resolves for its caller on the IMAP channel — BlueMind's REST login takes the
mailbox's own IMAP password, or the session id a credentials provider
presents as one. Values only: nothing of the host's credentials resolver,
which is a @Component the Kernel/Spring bridge does not export.
Who a session is kept for. The mail connector, in the "mail:" namespace of the add-on's one session cache; the eXo user the host's session acts as; the login the resolved material names, which is the account the session will be BlueMind's for; and the mail origin. A session is therefore reused only for the same user on the same connector whose credentials name the same account, and a calendar registration sharing the connector's id never meets it.
A refused login reaches the provider once. When the provider may
produce fresh material (MailboxAclSession.retriesAfterRefusal()), the
client tells it through invalidate() and logs in once more; when it
may not, the caller tells it through reportRefusal() after the call
failed, and nothing is sent again. Either way the provider hears of a
refusal exactly once per call.
Not a bean: one per call, over the session the host handed the engine. Nothing it holds outlives the call.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMailAccountSource(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, URI server, javax.mail.PasswordAuthentication material) The source of one call, over material the host's session resolved. -
Method Summary
Modifier and TypeMethodDescriptionorg.exoplatform.bluemind.client.model.BlueMindAccountaccount()The account a login is made with: the material this call started with, or fresh material afterinvalidate().apiRoot()The connector's BlueMind server, without producing anything.voidTells the provider its material was refused, so that the nextaccount()resolves fresh material.booleanWhether a refused login is worth one more on fresh material: the provider's answer, through the host's session.voidTells the provider its material was refused, once: after a call that failed with an authentication refusal once a login was made with the material, unless the client already told it.org.exoplatform.bluemind.client.model.BlueMindSessionKey
-
Field Details
-
LOGIN_ORIGIN
What the mail side names itself as in BlueMind's login audit.- See Also:
-
SERVER_NAMESPACE
The namespace of the mail connectors' ids in the add-on's one session cache.- See Also:
-
-
Constructor Details
-
MailAccountSource
public MailAccountSource(org.exoplatform.emailConnector.service.acl.MailboxAclSession session, URI server, javax.mail.PasswordAuthentication material) The source of one call, over material the host's session resolved.- Parameters:
session- the caller's own sessionserver- the connector's BlueMind servermaterial- the login and password the session resolved, not blank
-
-
Method Details
-
apiRoot
The connector's BlueMind server, without producing anything.- Specified by:
apiRootin interfaceorg.exoplatform.bluemind.client.BlueMindAccountSource- Returns:
- the server's address
-
account
public org.exoplatform.bluemind.client.model.BlueMindAccount account()The account a login is made with: the material this call started with, or fresh material afterinvalidate().- Specified by:
accountin interfaceorg.exoplatform.bluemind.client.BlueMindAccountSource- Returns:
- the account
- Throws:
org.exoplatform.bluemind.client.exception.BlueMindAuthenticationException- when the session resolves no login and password, or fresh material naming another account than the one the session is kept fororg.exoplatform.emailConnector.exception.MailboxAclException- when the provider cannot produce material
-
sessionKey
public org.exoplatform.bluemind.client.model.BlueMindSessionKey sessionKey()- Specified by:
sessionKeyin interfaceorg.exoplatform.bluemind.client.BlueMindAccountSource
-
refreshable
public boolean refreshable()Whether a refused login is worth one more on fresh material: the provider's answer, through the host's session.- Specified by:
refreshablein interfaceorg.exoplatform.bluemind.client.BlueMindAccountSource- Returns:
- true when the provider produces its material itself
-
invalidate
public void invalidate()Tells the provider its material was refused, so that the nextaccount()resolves fresh material.- Specified by:
invalidatein interfaceorg.exoplatform.bluemind.client.BlueMindAccountSource
-
reportRefusal
public void reportRefusal()Tells the provider its material was refused, once: after a call that failed with an authentication refusal once a login was made with the material, unless the client already told it.
-