public class BuyerEJB extends Object implements BuyerRemote, BuyerLocal
Modifier and Type | Field and Description |
---|---|
private AuctionItemDAO |
auctionItemDAO |
private EntityManager |
em |
private static org.apache.commons.logging.Log |
log |
private OrderDAO |
orderDAO |
private PersonDAO |
userDAO |
Constructor and Description |
---|
BuyerEJB() |
Modifier and Type | Method and Description |
---|---|
long |
bidProduct(long itemId,
String userId,
double amount) |
List<AuctionItem> |
getAvailableItems(int index,
int count) |
AuctionItem |
getItem(long itemId) |
Order |
getOrder(long orderId) |
(package private) void |
init() |
private AuctionItem |
makeDTO(AuctionItem item) |
private AuctionItem |
makeDTO(AuctionItem item,
Order order) |
private List<AuctionItem> |
makeDTO(List<AuctionItem> items) |
private List<Bid> |
makeDTO(List<Bid> bids,
AuctionItem item) |
private Order |
makeDTO(Order order) |
private Person |
makeDTO(Person owner,
AuctionItem item) |
private Person |
makeDTO(Person bidder,
Bid bid) |
private Person |
makeDTO(Person buyer,
Order order) |
long |
placeOrder(long productId,
String userId,
double maxAmount) |
private static final org.apache.commons.logging.Log log
private EntityManager em
private AuctionItemDAO auctionItemDAO
private PersonDAO userDAO
private OrderDAO orderDAO
@PostConstruct void init()
public long bidProduct(long itemId, String userId, double amount) throws MarketException
bidProduct
in interface Buyer
MarketException
public List<AuctionItem> getAvailableItems(int index, int count) throws MarketException
getAvailableItems
in interface Buyer
MarketException
public AuctionItem getItem(long itemId) throws MarketException
getItem
in interface Buyer
MarketException
public Order getOrder(long orderId) throws MarketException
getOrder
in interface Buyer
MarketException
public long placeOrder(long productId, String userId, double maxAmount) throws MarketException
placeOrder
in interface Buyer
MarketException
private List<AuctionItem> makeDTO(List<AuctionItem> items)
private AuctionItem makeDTO(AuctionItem item)
private List<Bid> makeDTO(List<Bid> bids, AuctionItem item)
private AuctionItem makeDTO(AuctionItem item, Order order)
private Person makeDTO(Person owner, AuctionItem item)
Copyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.