Exemple #1
0
  @SuppressWarnings("unchecked")
  public static DataSet<Thread> getThreads(
      User user, int pageIndex, int pageSize, boolean cacheable, boolean flush) {
    String key = null;
    DataSet<Thread> datas = null;

    key = MessageFormat.format(KEY_BOOKMARKS, user.getUserId(), pageIndex, pageSize);
    if (flush) AppCache.remove(key);

    datas = (DataSet<Thread>) AppCache.get(key);
    if (datas == null) {
      datas = remoteProvider.getThreads(user, pageIndex, pageSize);
      if (cacheable) AppCache.add(key, datas, false);
    }

    return datas;
  }