public interface AccountCache
Modifier and Type | Method and Description |
---|---|
void |
evict(Account.Id accountId) |
void |
evictAll() |
void |
evictByUsername(java.lang.String username) |
AccountState |
get(Account.Id accountId)
Returns an
AccountState instance for the given account ID. |
AccountState |
getByUsername(java.lang.String username) |
AccountState |
getIfPresent(Account.Id accountId)
Returns an
AccountState instance for the given account ID if it is present in the
cache. |
AccountState |
getOrNull(Account.Id accountId)
Returns an
AccountState instance for the given account ID. |
AccountState get(Account.Id accountId)
AccountState
instance for the given account ID. If not cached yet the
account is loaded. Returns an empty AccountState
instance to represent a missing
account.accountId
- ID of the account that should be retrievedAccountState
instance for the given account ID, if no account with this ID
exists an empty AccountState
instance is returned to represent the missing accountAccountState getOrNull(Account.Id accountId)
AccountState
instance for the given account ID. If not cached yet the
account is loaded. Returns null
if the account is missing.accountId
- ID of the account that should be retrievedAccountState
instance for the given account ID, if no account with this ID
exists null
is returnedAccountState getIfPresent(Account.Id accountId)
AccountState
instance for the given account ID if it is present in the
cache.accountId
- ID of the account that should be retrievedAccountState
instance for the given account ID if it is present in the cache,
otherwise null
AccountState getByUsername(java.lang.String username)
void evict(Account.Id accountId) throws java.io.IOException
java.io.IOException
void evictByUsername(java.lang.String username)
void evictAll() throws java.io.IOException
java.io.IOException