org.cocome.tradingsystem.inventory.application.store
Interface StoreIf

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
StoreImpl

public interface StoreIf
extends java.rmi.Remote

This interface represents the interface StoreIf of the component InventoryApplication, as shown in the component diagram of figure xx.

Author:
herold

Method Summary
 ProductWithStockItemTO changePrice(StockItemTO stockItemTO)
          Updates sales price of a stock item.
 java.util.List<ProductWithSupplierTO> getAllProducts()
          Determines all products of the portfolio of a given store and the supplier for each of them.
 java.util.List<ProductWithSupplierAndStockItemTO> getAllProductsWithOptionalStockItem()
          Determines all products of the portfolio of a given store and the supplier for each of them.
 ComplexOrderTO getOrder(long orderId)
          Returns order information for a given order id.
 java.util.List<ProductWithStockItemTO> getProductsWithLowStock()
          Determines products and stock items which are nearly out of stock, meaning amount is lower than 10% of maximal stock.
 ComplexOrderEntryTO[] getStockItems(ProductTO[] requiredProductTOs)
           
 StoreWithEnterpriseTO getStore()
          Gets transfer object with information of the store in which the component is running.
 void markProductsUnavailableInStock(ProductMovementTO requiredProductsAndAmount)
           
 java.util.List<ComplexOrderTO> orderProducts(ComplexOrderTO complexOrder)
          Creates a list of orders for different suppliers for an initial list of products to be ordered by a store.
 void rollInReceivedOrder(ComplexOrderTO complexOrderTO)
          Updates stocks after order delivery.
 

Method Detail

getStore

StoreWithEnterpriseTO getStore()
                               throws java.rmi.RemoteException
Gets transfer object with information of the store in which the component is running. This information is retrieved by the component during configuration and initialization.

Returns:
Store and enterprise information about the local store.
Throws:
java.rmi.RemoteException

getProductsWithLowStock

java.util.List<ProductWithStockItemTO> getProductsWithLowStock()
                                                               throws java.rmi.RemoteException
Determines products and stock items which are nearly out of stock, meaning amount is lower than 10% of maximal stock. Used for realization of UC 3.

Returns:
Returns a list of products and their stock item in the given store.
Throws:
java.rmi.RemoteException

getAllProducts

java.util.List<ProductWithSupplierTO> getAllProducts()
                                                     throws java.rmi.RemoteException
Determines all products of the portfolio of a given store and the supplier for each of them. Used for realization of UC 3.

Returns:
Returns a list of products and their suppliers
Throws:
java.rmi.RemoteException

getAllProductsWithOptionalStockItem

java.util.List<ProductWithSupplierAndStockItemTO> getAllProductsWithOptionalStockItem()
                                                                                      throws java.rmi.RemoteException
Determines all products of the portfolio of a given store and the supplier for each of them. Additionally the corresponding stockitems are queried

Returns:
Returns a list of products, their suppliers and the corresponding StockItem if they have any
Throws:
java.rmi.RemoteException

orderProducts

java.util.List<ComplexOrderTO> orderProducts(ComplexOrderTO complexOrder)
                                             throws java.rmi.RemoteException
Creates a list of orders for different suppliers for an initial list of products to be ordered by a store. ProductOrder is persisted and ordering date is set to date of method execution. Used for realization of UC 3.

Parameters:
complexOrder - Initial order which contains all products to be ordered.
Returns:
Returns a list of orders, one for each supplier that is affected.
Throws:
java.rmi.RemoteException

getOrder

ComplexOrderTO getOrder(long orderId)
                        throws java.rmi.RemoteException
Returns order information for a given order id. Used for realization of UC 4.

Parameters:
orderId - The id of the order.
Returns:
Detailed order information of the desired order. NULL, if there is no order with the given id.
Throws:
java.rmi.RemoteException

rollInReceivedOrder

void rollInReceivedOrder(ComplexOrderTO complexOrderTO)
                         throws java.rmi.RemoteException
Updates stocks after order delivery. Adds amount of ordered items to the stock items of the store. Sets delivery date to date of method execution. Used for realization of UC 4.

Parameters:
complexOrderTO - Contains the order which is rolled in.
Throws:
java.rmi.RemoteException

changePrice

ProductWithStockItemTO changePrice(StockItemTO stockItemTO)
                                   throws java.rmi.RemoteException
Updates sales price of a stock item. Used for realization of UC 7.

Parameters:
stockItemTO - Stock item with new price.
Returns:
Returns instance of ProductWithStockItemTO which holds product information and updated price information for stock item identified by stockItemTO.
Throws:
java.rmi.RemoteException

markProductsUnavailableInStock

void markProductsUnavailableInStock(ProductMovementTO requiredProductsAndAmount)
                                    throws java.rmi.RemoteException,
                                           ProductNotAvailableException
Parameters:
requiredProductsAndAmount - The product required at another store; includes the amount of required products.
Throws:
ProductNotAvailableException - Thrown if the local stock of the required product is less than the required amount.
java.rmi.RemoteException

getStockItems

ComplexOrderEntryTO[] getStockItems(ProductTO[] requiredProductTOs)
                                    throws java.rmi.RemoteException
Parameters:
requiredProductTOs - The products to look up in the stock
Returns:
The products including amounts from the stock
Throws:
java.rmi.RemoteException