Interface BulkOperations
No operation here installs a session. A host writing its own loop over
AltLoginService.loginAccount(AltAccount) gets fifty session switches and, on account
nine, a rate limit it has no way to recognise.
Not designed for host implementation; methods may be added in minor releases.
- Since:
- 0.9.0
-
Method Summary
Modifier and TypeMethodDescriptioncheckAll(List<AltAccount> accounts, BulkOptions options, BulkProgress progress) Checks every given account without renewing anything.default BulkHandleentitlementsAll(List<AltAccount> accounts, BulkOptions options, BulkProgress progress) Reads what every given account owns, without renewing or changing anything.importCredentials(List<String> entries, LoginMode mode, BulkOptions options, BulkProgress progress) Resolves a list of pasted credentials into accounts.refreshAll(List<AltAccount> accounts, BulkOptions options, BulkProgress progress) Refreshes every given account, renewing the ones whose tokens are spent and persisting each rotation.
-
Method Details
-
importCredentials
BulkHandle importCredentials(List<String> entries, LoginMode mode, BulkOptions options, BulkProgress progress) Resolves a list of pasted credentials into accounts.Each line is classified by
CredentialKind.detect(String)and sent to the route that fits it. A line that cannot be placed fails as that entry rather than being guessed at. WithLoginMode.ADDthe resolved accounts are stored; the live session is not touched either way, so the host chooses afterwards what to log into. Neither is the store's current account, and no account is stamped as used: a sign-in the user makes while the import runs stays current.- Parameters:
entries- the credential lines, one per accountmode- whether to store what is resolvedoptions- how to pace the runprogress- where to report progress, orBulkProgress.NONE- Returns:
- a handle on the running operation
- Since:
- 0.9.0
-
refreshAll
Refreshes every given account, renewing the ones whose tokens are spent and persisting each rotation.- Parameters:
accounts- the accounts to refreshoptions- how to pace the runprogress- where to report progress, orBulkProgress.NONE- Returns:
- a handle on the running operation
- Since:
- 0.9.0
-
checkAll
Checks every given account without renewing anything.The one to reach for when only looking: the token endpoint rotates the refresh token on every redemption, so a sweep built on
refreshAll(List, BulkOptions, BulkProgress)spends one rotation per account per sweep.- Parameters:
accounts- the accounts to checkoptions- how to pace the runprogress- where to report progress, orBulkProgress.NONE- Returns:
- a handle on the running operation
- Since:
- 0.9.0
-
entitlementsAll
default BulkHandle entitlementsAll(List<AltAccount> accounts, BulkOptions options, BulkProgress progress) Reads what every given account owns, without renewing or changing anything."Which of these own Java outright, and which are riding a subscription that can lapse" is a question about the whole list, so it is paced like the other sweeps: the same spacing, retries, progress, cancellation and stop-on-rate-limit, with each request routed for its own account. A successful entry carries the product set on
BulkEntryResult.entitlements(); an account that owns nothing succeeds with an empty set, because the read worked.Each account is read with the access token it currently holds. One whose token has expired fails its entry as
AltsFailure.Kind.UNAUTHORIZED; runrefreshAll(List, BulkOptions, BulkProgress)first when the tokens may be stale. An account with no token at all — an offline one — fails the same way without a request being made.- Parameters:
accounts- the accounts to readoptions- how to pace the runprogress- where to report progress, orBulkProgress.NONE- Returns:
- a handle on the running operation
- Throws:
UnsupportedOperationException- if this implementation predates the entitlement sweep- Since:
- 0.12.0
-