Пример #1
0
 /** Looks up book by isbn to see if it exists, throw exceptioni. Else add the book to storage */
 @Override
 public boolean addBook(String isbn, String title, int maxCheckoutLength, List<Author> authors)
     throws LibrarySystemException {
   Book book = new Book(isbn, title, maxCheckoutLength, authors);
   DataAccess da = new DataAccessFacade();
   da.saveNewBook(book);
   return false;
 }
Пример #2
0
  @Override
  public boolean addBookCopy(String isbn) throws LibrarySystemException {
    Book book = searchBook(isbn);
    if (book == null)
      throw new LibrarySystemException(
          "No book with isbn " + isbn + " is in the library collection!");
    book.addCopy();

    DataAccess da = new DataAccessFacade();
    da.saveNewBook(book);

    return true;
  }