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