Example #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;
  }
Example #2
0
 public static void delete(Thread thread, User user) {
   remoteProvider.delete(thread, user);
   localProvider.delete(thread, user);
 }
Example #3
0
 public static int getPosition(Thread thread, User user) {
   return localProvider.getPosition(thread, user);
 }
Example #4
0
 public static List<Section> getSections(User user) {
   return remoteProvider.getSections(user);
 }