01: /**
02: * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17: * USA
18: *
19: * Component of: Red Hat Application Server
20: *
21: * Initial Developers: Greg Lapouchnian
22: * Patrick Smith
23: *
24: */package olstore.domain.logic;
25:
26: import java.util.Collection;
27: import java.util.Map;
28:
29: import olstore.domain.manager.CartManager;
30: import olstore.dto.AddressValue;
31: import olstore.dto.ItemValue;
32: import olstore.dto.PictureValue;
33: import olstore.dto.TypeValue;
34: import olstore.dto.UserValue;
35:
36: /**
37: * An interface for the olstore bean that will act as a POJO to let us expose
38: * the methods in the store's beans so that we can easily replace the back end EJBs
39: * without much modification to the other classes in the the application.
40: */
41: public interface OlstoreFacade {
42:
43: public ItemValue getItemById(String itemId) throws Exception;
44:
45: public PictureValue getPictureById(String itemId) throws Exception;
46:
47: public Collection getAll();
48:
49: public Collection getItemsByType(String type);
50:
51: public CartManager getShoppingCart(String username);
52:
53: public Collection getTypes();
54:
55: public Collection getOrders(String username);
56:
57: public UserValue getUser(String username);
58:
59: public Collection getAllUsers();
60:
61: public Collection findByMainPageAndFriendsOf(String username);
62:
63: public Collection findByMainPageAndSpecialOffer();
64:
65: public Collection findByMainPage();
66:
67: public void saveItem(ItemValue item) throws Exception;
68:
69: public Collection getUserPurchased(String username);
70:
71: public void saveType(TypeValue type) throws Exception;
72:
73: public void saveUser(UserValue user, AddressValue address,
74: String username) throws Exception;
75:
76: public void createUser(UserValue user, AddressValue address)
77: throws Exception;
78:
79: public String getDefaultType() throws Exception;
80:
81: public Collection getPropertiesForType(String type)
82: throws Exception;
83:
84: public boolean isPopulated();
85:
86: public Collection findOrdersForUpdate();
87:
88: public void setStatus(Integer id, String status);
89:
90: public void markItemAsInteresting(Integer itemId, String user)
91: throws Exception;
92:
93: public Map getFriendsMap(String username, Collection items);
94: }
|