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