1 31 package org.blojsom.fetcher; 32 33 import org.blojsom.blog.*; 34 35 import javax.servlet.http.HttpServletRequest ; 36 import javax.servlet.http.HttpServletResponse ; 37 import java.util.Map ; 38 import java.util.List ; 39 import java.util.Date ; 40 41 48 public interface Fetcher { 49 50 55 public void init() throws FetcherException; 56 57 62 public Entry newEntry(); 63 64 69 public Comment newComment(); 70 71 76 public Trackback newTrackback(); 77 78 83 public Pingback newPingback(); 84 85 90 public Category newCategory(); 91 92 97 public Blog newBlog(); 98 99 104 public User newUser(); 105 106 112 public String [] loadBlogIDs() throws FetcherException; 113 114 121 public Blog loadBlog(String blogId) throws FetcherException; 122 123 129 public void saveBlog(Blog blog) throws FetcherException; 130 131 137 public void deleteBlog(Blog blog) throws FetcherException; 138 139 150 public Entry[] fetchEntries(HttpServletRequest httpServletRequest, 151 HttpServletResponse httpServletResponse, 152 Blog blog, 153 String flavor, 154 Map context) throws FetcherException; 155 156 164 public Entry[] loadAllEntriesForCategory(Blog blog, Integer categoryId) throws FetcherException; 165 166 175 public Entry[] loadEntriesForCategory(Blog blog, Integer categoryId, Integer limit) throws FetcherException; 176 177 186 public Entry[] loadEntries(Blog blog, int pageSize, int page) throws FetcherException; 187 188 196 public Entry[] findEntries(Blog blog, String query) throws FetcherException; 197 198 209 public Entry[] findEntriesByMetadataKeyValue(Blog blog, String metadataKey, String metadataValue, 210 boolean pre, boolean post) throws FetcherException; 211 212 220 public Entry[] findEntriesWithMetadataKey(Blog blog, String metadataKey) throws FetcherException; 221 222 231 public Entry[] findEntriesBetweenDates(Blog blog, Date startDate, Date endDate) throws FetcherException; 232 233 240 public Integer countEntries(Blog blog) throws FetcherException; 241 242 250 public Entry loadEntry(Blog blog, Integer entryId) throws FetcherException; 251 252 260 public Entry loadEntry(Blog blog, String postSlug) throws FetcherException; 261 262 273 public Category[] fetchCategories(HttpServletRequest httpServletRequest, 274 HttpServletResponse httpServletResponse, 275 Blog blog, 276 String flavor, 277 Map context) throws FetcherException; 278 279 286 public Category[] loadAllCategories(Blog blog) throws FetcherException; 287 288 296 public Category loadCategory(Blog blog, Integer categoryId) throws FetcherException; 297 298 306 public Category loadCategory(Blog blog, String name) throws FetcherException; 307 308 315 public void saveEntry(Blog blog, Entry entry) throws FetcherException; 316 317 324 public void loadEntry(Blog blog, Entry entry) throws FetcherException; 325 326 333 public void deleteEntry(Blog blog, Entry entry) throws FetcherException; 334 335 342 public void saveCategory(Blog blog, Category category) throws FetcherException; 343 344 351 public void loadCategory(Blog blog, Category category) throws FetcherException; 352 353 360 public void deleteCategory(Blog blog, Category category) throws FetcherException; 361 362 369 public void saveComment(Blog blog, Comment comment) throws FetcherException; 370 371 378 public void loadComment(Blog blog, Comment comment) throws FetcherException; 379 380 387 public void deleteComment(Blog blog, Comment comment) throws FetcherException; 388 389 395 public List loadRecentComments(Blog blog) throws FetcherException; 396 397 404 public void saveTrackback(Blog blog, Trackback trackback) throws FetcherException; 405 406 413 public void loadTrackback(Blog blog, Trackback trackback) throws FetcherException; 414 415 422 public void deleteTrackback(Blog blog, Trackback trackback) throws FetcherException; 423 424 430 public List loadRecentTrackbacks(Blog blog) throws FetcherException; 431 432 439 public void savePingback(Blog blog, Pingback pingback) throws FetcherException; 440 441 448 public void loadPingback(Blog blog, Pingback pingback) throws FetcherException; 449 450 459 public Pingback loadPingback(Blog blog, String sourceURI, String targetURI) throws FetcherException; 460 461 468 public void deletePingback(Blog blog, Pingback pingback) throws FetcherException; 469 470 476 public List loadRecentPingbacks(Blog blog) throws FetcherException; 477 478 484 public User[] getUsers(Blog blog); 485 486 493 public User loadUser(Blog blog, String userLogin) throws FetcherException; 494 495 503 public User loadUser(Blog blog, Integer userID) throws FetcherException; 504 505 513 public User saveUser(Blog blog, User user) throws FetcherException; 514 515 522 public void deleteUser(Blog blog, Integer userID) throws FetcherException; 523 524 532 public List findResponsesByStatus(Blog blog, String [] status) throws FetcherException; 533 534 542 public List findResponsesByQuery(Blog blog, String query) throws FetcherException; 543 544 549 public void destroy() throws FetcherException; 550 } 551 | Popular Tags |