pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.shop.model
Interface ShopItem

All Superinterfaces:
IHasAlternativeImages, IHasMainImage, IHasVariants, INameable, INamed, JDOMable, java.io.Serializable, StoreItem
All Known Implementing Classes:
ShopContent, ShopVariant

public interface ShopItem
extends StoreItem

Version:
$Revision: 1979 $
Author:
Christian Schatt

Method Summary
 void decreaseStockBy(int amount)
          Decreases the stock by the given amount.
 java.lang.Integer getAbsoluteMaxOrderSize(User user)
          returns the absolute maximum order size for the given User.
 java.lang.Integer getAbsoluteMinOrderSize(User user)
          returns the absolute minimum order size for the given User.
 java.util.List<Price> getAvailablePrices(User user)
          returns a list of Prices which are available to the given User, ordered by Price.getAmount(), Price.getMinOrderSize().
 Price getBestPrice(User pUser, int pAmount)
          Returns the best Price for the given User and the given amount.
 java.util.Set<Price> getPrices()
          Returns the Prices of the ShopItem.
 java.util.Set<Price> getPrices(Status status)
          returns all Prices with the given status.
 java.util.Set<Price> getPrices(Status status, int amount)
          returns all Prices with the given status available for the given amount.
 java.lang.String getShopItemId()
          returns a string identifying the ShopItem, starting either with c for Contents or v for Variant followed by the primary key.
 Status getStatus()
          Returns the Status of the ShopItem.
 java.lang.Integer getStock()
          Returns the stock of the ShopItem.
 void increaseStockBy(int amount)
          Increases the stock by the given amount.
 boolean isStockMaintainable()
          Determines whether the stock is maintainable for the ShopItem.
 boolean isStockMaintained()
          Determines whether the stock is maintained for the ShopItem.
 void setPrices(java.util.Set<Price> pPrices)
          Sets the Prices of the ShopItem.
 void setStatus(Status pStatus)
          Sets the Status of the ShopItem.
 void setStock(java.lang.Integer stock)
          Sets the stock of the ShopItem.
 
Methods inherited from interface org.torweg.pulse.component.store.model.StoreItem
equals, getAlternativeImages, getAssociatedVirtualFiles, getAttachments, getDescription, getDescriptionElement, getFullTextValue, getId, getMainImage, getOrderCode, getSummary, getSummaryElement, hashCode, onVirtualFileSystemChange, setAlternativeImages, setAssociatedVirtualFiles, setAttachments, setDescription, setMainImage, setOrderCode, setSummary
 
Methods inherited from interface org.torweg.pulse.util.INameable
setName
 
Methods inherited from interface org.torweg.pulse.util.INamed
getName
 
Methods inherited from interface org.torweg.pulse.site.content.IHasVariants
getVariants
 
Methods inherited from interface org.torweg.pulse.bundle.JDOMable
deserializeToJDOM
 

Method Detail

getShopItemId

java.lang.String getShopItemId()
returns a string identifying the ShopItem, starting either with c for Contents or v for Variant followed by the primary key.

Returns:
the shop item id

getStatus

Status getStatus()
Returns the Status of the ShopItem.

Returns:
the Status of the ShopItem.

setStatus

void setStatus(Status pStatus)
Sets the Status of the ShopItem.

Parameters:
pStatus - the Status to be set.

getPrices

java.util.Set<Price> getPrices()
Returns the Prices of the ShopItem.

Returns:
the Prices of the ShopItem.

getPrices

java.util.Set<Price> getPrices(Status status)
returns all Prices with the given status.

Parameters:
status - the status
Returns:
a set with all matching Prices

getPrices

java.util.Set<Price> getPrices(Status status,
                               int amount)
returns all Prices with the given status available for the given amount.

Parameters:
status - the status
amount - the amount
Returns:
a set with all matching Prices

setPrices

void setPrices(java.util.Set<Price> pPrices)
Sets the Prices of the ShopItem.

Parameters:
pPrices - the Prices to be set.

getAvailablePrices

java.util.List<Price> getAvailablePrices(User user)
returns a list of Prices which are available to the given User, ordered by Price.getAmount(), Price.getMinOrderSize().

Parameters:
user - the user
Returns:
a list of Prices

getBestPrice

Price getBestPrice(User pUser,
                   int pAmount)
Returns the best Price for the given User and the given amount.

Parameters:
pUser - the User to get the best Price for.
pAmount - the amount of items the best Price has to be valid for.
Returns:
the best Price for the given User and the given amount.

getAbsoluteMinOrderSize

java.lang.Integer getAbsoluteMinOrderSize(User user)
returns the absolute minimum order size for the given User.

Parameters:
user - the user
Returns:
the absolute minimum order size for the given User

getAbsoluteMaxOrderSize

java.lang.Integer getAbsoluteMaxOrderSize(User user)
returns the absolute maximum order size for the given User.

Parameters:
user - the user
Returns:
the absolute maximum order size for the given User

getStock

java.lang.Integer getStock()
Returns the stock of the ShopItem.

Returns:
the stock of the ShopItem

setStock

void setStock(java.lang.Integer stock)
Sets the stock of the ShopItem.

Parameters:
stock - the stock to set

isStockMaintainable

boolean isStockMaintainable()
Determines whether the stock is maintainable for the ShopItem.

Returns:
true if the stock is maintainable for the ShopItem. Returns false, otherwise.

isStockMaintained

boolean isStockMaintained()
Determines whether the stock is maintained for the ShopItem.

Returns:
true if the stock is maintained for the ShopItem. Returns false, otherwise.

increaseStockBy

void increaseStockBy(int amount)
Increases the stock by the given amount.

Parameters:
amount - the amount

decreaseStockBy

void decreaseStockBy(int amount)
Decreases the stock by the given amount.

Parameters:
amount - the amount