@Override @Loggable(value = LogLevel.TRACE) public void updateEmail(Account account) throws AccountManagementException { try { accountService.updateEmail(account); CacheManager.clear(CacheKey.ACCOUNTS); } catch (AccountServiceException e) { throw new AccountManagementException(e.getMessage(), e.getCause()); } }
@Loggable(value = LogLevel.TRACE) public List<Account> getAccounts(User user) throws AccountManagementException { List<Account> accountList = getAccountListFromCache(); if (accountList != null) { return accountList; } else { try { accountList = new ArrayList<Account>(); for (CustAcctMapDAO accountMap : getAccountMap(user)) { accountList.add(getAccount(accountMap.getAccountNo())); } CacheManager.set(CacheKey.ACCOUNTS, accountList); return accountList; } catch (AccountManagementException e) { throw e; } } }
private List<Account> getAccountListFromCache() { return (List<Account>) CacheManager.get(CacheKey.ACCOUNTS); }