Class BuyBookService
- java.lang.Object
-
- jadex.bdi.examples.booktrading.seller.BuyBookService
-
- All Implemented Interfaces:
IBuyBookService
public class BuyBookService extends java.lang.Object implements IBuyBookService
Implementation of the buy book service.
-
-
Field Summary
Fields Modifier and Type Field Description protected IBDIXAgentFeature
agent
The agent.
-
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 bookIFuture<java.lang.Integer>
callForProposal(java.lang.String title)
Ask the seller for a a quote on a book.
-
-
-
Field Detail
-
agent
protected IBDIXAgentFeature agent
The agent.
-
-
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 interfaceIBuyBookService
- 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 interfaceIBuyBookService
- Parameters:
title
- The book title.price
- The price to pay.- Returns:
- A future indicating if the transaction was successful.
-
-