19 package org.sleuthkit.autopsy.communications;
21 import com.google.common.cache.CacheBuilder;
22 import com.google.common.cache.CacheLoader;
23 import com.google.common.cache.LoadingCache;
24 import java.util.ArrayList;
25 import java.util.Collection;
26 import java.util.List;
27 import java.util.concurrent.ExecutionException;
28 import java.util.concurrent.TimeUnit;
29 import java.util.logging.Level;
44 private final LoadingCache<Account, List<PersonaAccount>>
accountMap;
52 accountMap = CacheBuilder.newBuilder().expireAfterAccess(5, TimeUnit.MINUTES).build(
53 new CacheLoader<Account, List<PersonaAccount>>() {
55 public List<PersonaAccount> load(Account key) {
56 List<PersonaAccount> accountList =
new ArrayList<>();
60 accountList.addAll(accounts);
63 logger.log(Level.WARNING, String.format(
"Unable to load Persona information for account: %s", key), ex);
77 if (instance == null) {
93 static public synchronized List<PersonaAccount>
getPersonaAccounts(Account account)
throws ExecutionException {
static Collection< PersonaAccount > getPersonaAccountsForAccount(long accountId)
final LoadingCache< Account, List< PersonaAccount > > accountMap
static final Logger logger
static synchronized List< PersonaAccount > getPersonaAccounts(Account account)
synchronized static Logger getLogger(String name)
static synchronized CVTPersonaCache getInstance()
static CVTPersonaCache instance
static boolean isEnabled()