/**
 * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * Component of: Red Hat Application Server
 * 
 * Initial Developers: Greg Lapouchnian
 *                     Patrick Smith
 *
 */

package olstore.domain.logic;

import java.util.Collection;
import java.util.Map;

import olstore.domain.manager.CartManager;
import olstore.dto.AddressValue;
import olstore.dto.ItemValue;
import olstore.dto.PictureValue;
import olstore.dto.TypeValue;
import olstore.dto.UserValue;

/**
 * An interface for the olstore bean that will act as a POJO to let us expose
 * the methods in the store's beans so that we can easily replace the back end EJBs
 * without much modification to the other classes in the the application.
 */
public interface OlstoreFacade {
    
    public ItemValue getItemById(String itemId) throws Exception;
    public PictureValue getPictureById(String itemId) throws Exception;
    public Collection getAll();
    public Collection getItemsByType(String type);
    public CartManager getShoppingCart(String username);
    public Collection getTypes();
    public Collection getOrders(String username);
    public UserValue getUser(String username);
    public Collection getAllUsers();
    public Collection findByMainPageAndFriendsOf(String username);
    public Collection findByMainPageAndSpecialOffer();
    public Collection findByMainPage();
    public void saveItem(ItemValue item) throws Exception;
    public Collection getUserPurchased(String username);
    public void saveType(TypeValue type) throws Exception;
    public void saveUser(UserValue user, AddressValue address, String username) throws Exception;
    public void createUser(UserValue user, AddressValue address) throws Exception;
    public String getDefaultType() throws Exception;
    public Collection getPropertiesForType(String type) throws Exception;
    public boolean isPopulated();
    public Collection findOrdersForUpdate();
    public void setStatus(Integer id, String status);
    public void markItemAsInteresting(Integer itemId, String user) throws Exception;
    public Map getFriendsMap(String username, Collection items);
}
