Class BuyBookService

  • All Implemented Interfaces:
    IBuyBookService

    public class BuyBookService
    extends java.lang.Object
    implements IBuyBookService
    Implementation of the buy book service.
    • Constructor Summary

      Constructors 
      Constructor Description
      BuyBookService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IFuture<java.lang.Void> acceptProposal​(java.lang.String title, int price)
      Buy a book
      IFuture<java.lang.Integer> callForProposal​(java.lang.String title)
      Ask the seller for a a quote on a book.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BuyBookService

        public BuyBookService()
    • Method Detail

      • callForProposal

        public IFuture<java.lang.Integer> callForProposal​(java.lang.String title)
        Ask the seller for a a quote on a book.
        Specified by:
        callForProposal in interface IBuyBookService
        Parameters:
        title - The book title.
        Returns:
        The price.
      • acceptProposal

        public IFuture<java.lang.Void> acceptProposal​(java.lang.String title,
                                                      int price)
        Buy a book
        Specified by:
        acceptProposal in interface IBuyBookService
        Parameters:
        title - The book title.
        price - The price to pay.
        Returns:
        A future indicating if the transaction was successful.