Exemplo n.º 1
0
  public static CurrencyInfo reloadCurrencyInfo(String id) throws SQLException {
    CurrencyInfo currency = CurrencyInfo.loadCurrency(id);
    if (currency == null) CurrencyDb.remove(id);
    else CurrencyDb.put(currency.CurrencyId, currency);

    return currency;
  }
Exemplo n.º 2
0
  public static List<CurrencyInfo> reloadCurrencies() throws SQLException {
    ConcurrentMap<String, CurrencyInfo> currencyDb = new ConcurrentHashMap<String, CurrencyInfo>();

    List<CurrencyInfo> currencies = CurrencyInfo.loadCurrencies();

    for (CurrencyInfo currency : currencies) {
      currencyDb.put(currency.CurrencyId, currency);
    }

    CurrencyDb = currencyDb;

    return currencies;
  }
Exemplo n.º 3
0
 // TODO: send reload message to cluster
 public static void removeCurrency(String id) throws SQLException {
   CurrencyDb.remove(id);
   CurrencyInfo.deleteById(id);
 }
Exemplo n.º 4
0
 // TODO: send reload message to cluster
 public static void addCurrency(CurrencyInfo currency) throws SQLException {
   currency.save();
   CurrencyDb.put(currency.CurrencyId, currency);
 }