コード例 #1
0
  /** {@inheritDoc} */
  @Override
  public void deleteBook(final String id) throws DataNotFoundException {

    bookStorage.deleteBook(id);
    BookKey bookKey = new BookKey(new Book(id));
    exoBookCache.remove(bookKey);
    exoBooksCache.clearCache();
  }
コード例 #2
0
  /** {@inheritDoc} */
  @Override
  public void updateBook(final Book book) throws DataNotFoundException {

    BookKey bookKey = new BookKey(new Book(book.getId()));
    exoBookCache.remove(bookKey);
    exoBooksCache.clearCache();

    bookStorage.updateBook(book);
  }
コード例 #3
0
  /** {@inheritDoc} */
  @Override
  public Book insert(final Book book) throws DataDuplicateException, DataNotFoundException {

    Book returnBook = bookStorage.insert(book);
    BookKey bookKey = new BookKey(returnBook);
    exoBookCache.put(bookKey, new BookData(book));
    exoBooksCache.clearCache();

    return returnBook;
  }
コード例 #4
0
 /** {@inheritDoc} */
 @Override
 public void deleteAll() {
   bookStorage.deleteAll();
   exoBookCache.clearCache();
   exoBooksCache.clearCache();
 }