Ejemplo n.º 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();
  }
Ejemplo n.º 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);
  }
Ejemplo n.º 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;
  }
Ejemplo n.º 4
0
 /** {@inheritDoc} */
 @Override
 public void deleteAll() {
   bookStorage.deleteAll();
   exoBookCache.clearCache();
   exoBooksCache.clearCache();
 }