ibspan.ecap.merchant.shopdecisions.negotiationpreparation
Class NegotiationDescriptionInventory

java.lang.Object
  extended by ibspan.ecap.merchant.shopdecisions.negotiationpreparation.NegotiationDescriptionInventory

public class NegotiationDescriptionInventory
extends java.lang.Object

A class responsible for gethering and managing of previous negotiation descriptions of products. Implemented using a simple map, hence it doesn't provide persistence.

Author:
Micha³ Drozdowicz

Constructor Summary
NegotiationDescriptionInventory()
           
 
Method Summary
 NegotiationDescription getLastDescription(java.lang.String productId)
          Returns the previous negotiation desription of the given product or null if none exists.
 java.util.List<java.lang.String> getRegisteredProducts()
          Returns a list of ids of products registered for periodical template updates.
 boolean isRegistered(java.lang.String productId)
          Determines whether the specified product is registered for periodical template updates.
 void registerProduct(java.lang.String productId)
          Registers a product for management of negotiation descriptions.
 void setLastDescription(java.lang.String productId, NegotiationDescription description)
          Updates the previous negotiation description of the product.
 void withdrawProduct(java.lang.String productId)
          Withdraws a product from management of negotiation descriptions.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NegotiationDescriptionInventory

public NegotiationDescriptionInventory()
Method Detail

getLastDescription

public NegotiationDescription getLastDescription(java.lang.String productId)
Returns the previous negotiation desription of the given product or null if none exists.

Parameters:
productId - the id of the product which negotiation description is to be returned
Returns:
the previous negotiation desription of the given product or null if none exists.

registerProduct

public void registerProduct(java.lang.String productId)
Registers a product for management of negotiation descriptions.

Parameters:
productId - the id of the product to register.

withdrawProduct

public void withdrawProduct(java.lang.String productId)
Withdraws a product from management of negotiation descriptions.

Parameters:
productId - the id of the product to withdraw.

setLastDescription

public void setLastDescription(java.lang.String productId,
                               NegotiationDescription description)
Updates the previous negotiation description of the product.

Parameters:
productId -
description -

isRegistered

public boolean isRegistered(java.lang.String productId)
Determines whether the specified product is registered for periodical template updates.

Parameters:
productId - the id of the product to check
Returns:
true if the specified product is registered for periodical template updates false otherwise

getRegisteredProducts

public java.util.List<java.lang.String> getRegisteredProducts()
Returns a list of ids of products registered for periodical template updates.

Returns:
a list of ids of products registered for periodical template updates.