org.cocome.tradingsystem.inventory.application.productdispatcher.impl
Class ProductDispatcher

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.cocome.tradingsystem.inventory.application.productdispatcher.impl.ProductDispatcher
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, ProductDispatcherIf

public class ProductDispatcher
extends java.rmi.server.UnicastRemoteObject
implements ProductDispatcherIf

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
ProductDispatcher()
           
 
Method Summary
 ProductAmountTO[] orderProductsAvailableAtOtherStores(EnterpriseTO enterpriseTO, StoreTO callingStore, java.util.Collection<ProductAmountTO> productAmounts)
          Executes a query to search for a product (that ran out of stock at one store) at other stores in the region.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProductDispatcher

public ProductDispatcher()
                  throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException
Method Detail

orderProductsAvailableAtOtherStores

public ProductAmountTO[] orderProductsAvailableAtOtherStores(EnterpriseTO enterpriseTO,
                                                             StoreTO callingStore,
                                                             java.util.Collection<ProductAmountTO> productAmounts)
Description copied from interface: ProductDispatcherIf
Executes a query to search for a product (that ran out of stock at one store) at other stores in the region.

Required for Use-Case 8 (product exchange (on low stock) among stores). Called by an InventoryApplication.

Specified by:
orderProductsAvailableAtOtherStores in interface ProductDispatcherIf
Parameters:
enterpriseTO - The enterprise managing the transfer
callingStore - The store running out of stock.
productAmounts - The products running out at the calling store and the required amount of those products.
Returns:
Returns a list of the required products that will be made available by the enterprise. The included amount of products might be "0" to indicate that a product is not available in the enterprise.

Products that are indicates to be available (amount > 0) are prepared for delivery by the delivering store (markProductsUnavailableInStock).