Interface AltAccountService
Everything here leaves the live session alone. That is the whole point: a "check all my alts"
sweep, a background refresh, or a bulk import cannot be built on AltLoginService.loginAccount(AltAccount),
because that installs each account it touches as the active session — fifty accounts, fifty session
switches, and whichever finished last wins.
AltLoginService.loginAccount(AltAccount) is this plus one step: refresh(AltAccount), and then
the injection.
Neither method throws at the caller or completes its future exceptionally. Every failure, a runtime
closed before the call included, is an AccountStatus whose AccountStatus.failure()
says what kind it was.
Not designed for host implementation; methods may be added in minor releases.
- Since:
- 0.8.0
-
Method Summary
Modifier and TypeMethodDescriptioncheck(AltAccount account) Asks the service whether an account's stored token still works, changing nothing.refresh(AltAccount account) Makes an account usable if it can be, renewing from its refresh token when the stored one is spent and persisting the rotated credential.
-
Method Details
-
check
Asks the service whether an account's stored token still works, changing nothing.Never renews and never rotates. That matters more than it looks: the token endpoint issues a new refresh token on every redemption, so a validation sweep built on
refresh(AltAccount)would spend one rotation per account per sweep. An offline account, or one holding no token at all, is answered without a request.- Parameters:
account- the account to check- Returns:
- a future holding what the account is worth right now
- Since:
- 0.8.0
-
refresh
Makes an account usable if it can be, renewing from its refresh token when the stored one is spent and persisting the rotated credential.A live token on an account that cannot be renewed is reported valid without a request, so this is not more expensive than a login for the common case. Never installs a session.
- Parameters:
account- the account to refresh- Returns:
- a future holding the outcome, carrying renewed credentials when there are any
- Since:
- 0.8.0
-