com.ail.core.product
Interface Product

All Known Implementing Classes:
Core

public interface Product

Define the interfaces that the Core class must offer to support Product functionality

Version:
$Revision: 1.4 $

Method Summary
 java.util.Collection<ProductDetails> listProducts()
          Fetch a collection of the products know to the system.
 Type newProductType(java.lang.String productName)
          Instantiate the default type associated with a product.
 Type newProductType(java.lang.String productName, java.lang.String typeName)
          Instantiate a type associated with a product.
 void registerProduct(ProductDetails details)
          Register a new product with the catalog.
 void removeProduct(ProductDetails productDetails)
          Remove a product from the registry.
 void resetAllProducts()
          Reset all the products know to the product manager.
 void resetProduct(java.lang.String productName)
          Reset a specific product.
 void updateProduct(java.lang.String productName, ProductDetails details)
          Update the product registries details wrt the details passed in.
 

Method Detail

registerProduct

void registerProduct(ProductDetails details)
                     throws DuplicateProductException
Register a new product with the catalog.

Parameters:
details - Details of the product to register
Throws:
DuplicateProduct - if a product by the name specified (details.name) is already defined.
DuplicateProductException
Since:
2.0

updateProduct

void updateProduct(java.lang.String productName,
                   ProductDetails details)
                   throws UnknownProductException
Update the product registries details wrt the details passed in.

Parameters:
name - The name of the product to be updated.
details - Details to store
Throws:
UnknownProduct - if the product (name) isn't defined.
UnknownProductException
Since:
2.0

removeProduct

void removeProduct(ProductDetails productDetails)
                   throws UnknownProductException
Remove a product from the registry.

Parameters:
name - Name of the product to remove.
Throws:
UnknownProduct - if the named product is not defined.
UnknownProductException
Since:
2.0

resetAllProducts

void resetAllProducts()
Reset all the products know to the product manager. The product manager's configuration contains a list of products. This method performs a system reset on each of the products in that list. This amounts to performing a configuration reset using the products name as the configuration namespace.

Since:
2.0

resetProduct

void resetProduct(java.lang.String productName)
Reset a specific product. Perform a system reset on the named product returning it to it's factory state.

Parameters:
productName - The name of the product to reset
Since:
2.0

newProductType

Type newProductType(java.lang.String productName,
                    java.lang.String typeName)
Instantiate a type associated with a product. A product must define at least one type (see newProductType(String)), but may define any number of additional types for use during its lifecycle; this method is used to instantantiate specific types by name.

For example, a complex insurance product may define several different types to describe the assets the product covers. A commercial combined product might define a stock asset, a vehicle asset, a safe asset, etc. Each of these is described within the product as a seperate named type. A client would use this method to instantiate these different types as and when they needed to be added to an instance of a commercial combined policy.

Parameters:
productName - The product "owning" the type.
typeName - The name of type to be instantiated.
Returns:
The instantiated type.
Since:
2.0

newProductType

Type newProductType(java.lang.String productName)
Instantiate the default type associated with a product. Each product must define a default type. This is the type (generally) instantiated at the beginning of the lifecycle.

Parameters:
productName - The name of the product to instantiate for.
Returns:
The instantiated type.
Since:
2.0

listProducts

java.util.Collection<ProductDetails> listProducts()
Fetch a collection of the products know to the system.

Returns:
A collection of product names (as instances of java.lang.String).
Since:
2.0