bea Systems, Inc.

theory.smart.ebusiness.shoppingadvisor
Class ShoppingAdvisorImpl

java.lang.Object
  |
  +--theory.smart.foundation.SessionImpl
        |
        +--theory.smart.ebusiness.shoppingadvisor.ShoppingAdvisorImpl

public class ShoppingAdvisorImpl
extends SessionImpl

This class is the interface to the shopping advisor package. It builds a searchable table of Qualities from Items. That table is used to provide search and customer profile matching functionality.

See Also:
ShoppingAdvisor, ShoppingAdvisorHome, Serialized Form

Field Summary
protected static java.lang.String CUSTOMER_PROFILE_HOME
           
 CustomerProfileHome customerProfileHome
           
protected static java.lang.String ITEM_QUALITIES_HOME
           
 int itemDepth
           itemDepth [ShoppingAdvisor] <*>------> [int]
 ItemQualitiesHome itemQualitiesHome
           
protected static java.lang.String ITEMS_BY_QUALITY_HOME
           
 ItemsByQualityHome itemsByQualityHome
           
 Customer lastCustomer
           
 CustomerProfile lastCustomerProfile
           
 boolean matchAll
           matchAll [ShoppingAdvisor] <*>------> [boolean]
 int qualityDepth
           qualityDepth [ShoppingAdvisor] <*>------> [int]
 int suggestionCount
           suggestionCount [ShoppingAdvisor] <*>------> [int]
 
Fields inherited from class theory.smart.foundation.SessionImpl
ctx, isDirty
 
Constructor Summary
ShoppingAdvisorImpl()
           
 
Method Summary
 void addCustomerPreference(Customer customer, Quality quality)
          Adds a quality to the customer's profile.
 void addDefaultItem(Item item, int degree)
          Add an item that will be returned by the getDefaultSuggestions method.
 void addItem(Item item)
          Add a single item to the shopping engine.
 void deleteCustomerPreference(Customer customer, Quality quality)
          Removes a quality from the customer's profile.
 void deleteCustomerProfile(Customer customer)
          Remove a customer profile.
 void deleteDefaultItem(Item item)
          Remove an item from the list that will be returned when getDefaultSuggestions is called.
 void deleteItem(Item delete)
          Delete a single item from the shopping engine.
 void ejbActivate()
           
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbPostCreate()
           
 void ejbRemove()
           
protected  CustomerProfileHome getCPHome()
           
protected  CustomerProfile getCustomerProfile(Customer customer)
           
protected  ItemsByQuality getDefaultItemsByQuality()
           
 Suggestions getDefaultSuggestions()
          Return a default list of suggestions as configured with teh addDefaultItem method.
protected  ItemsByQualityHome getIBQHome()
           
protected  ItemQualitiesHome getIQHome()
           
 int getItemDepth()
          Get the value of itemDepth
protected  ItemQualities getItemQualities(Item item)
           
 boolean getMatchAll()
          Get the value of matchAll
 int getQualityDepth()
          Get the value of qualityDepth
 int getSuggestionCount()
          Get the value of suggestionCount
 Suggestions getSuggestions(Customer customer)
          Get suggestions based soley on a customers profile.
 Suggestions getSuggestions(Customer customer, Item item)
          Get suggestions based on the customer profile and the qualities of the item.
 Suggestions getSuggestions(Customer customer, java.lang.String searchString)
          Get suggestions based on a customer profile and a search string.
protected  Suggestions getSuggestions(com.sun.java.util.collections.LinkedList qualities)
           
protected  Suggestions getSuggestions(com.sun.java.util.collections.LinkedList qualities, Suggestions suggestions)
           
 Suggestions getSuggestions(java.lang.String searchString)
          Tokenize the search string into a list of qualities to be searched for.
 void learnCustomerPreference(Customer customer, Item item)
          Adds an item's qualities to the customer's profile.
protected  void removeItemReferences(Item item, com.sun.java.util.collections.LinkedList listOfQualities)
           
 void setItemDepth(int itemDepth)
          Set the value of itemDepth
 void setMatchAll(boolean matchAll)
          Set the value of matchAll
 void setQualityDepth(int qualityDepth)
          Set the value of qualityDepth
 void setSessionContext(SessionContext ctx)
           
 void setSuggestionCount(int suggestionCount)
          Set the value of suggestionCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

itemQualitiesHome

public transient ItemQualitiesHome itemQualitiesHome

itemsByQualityHome

public transient ItemsByQualityHome itemsByQualityHome

customerProfileHome

public transient CustomerProfileHome customerProfileHome

lastCustomer

public transient Customer lastCustomer

lastCustomerProfile

public transient CustomerProfile lastCustomerProfile

CUSTOMER_PROFILE_HOME

protected static java.lang.String CUSTOMER_PROFILE_HOME

ITEMS_BY_QUALITY_HOME

protected static java.lang.String ITEMS_BY_QUALITY_HOME

ITEM_QUALITIES_HOME

protected static java.lang.String ITEM_QUALITIES_HOME

suggestionCount

public int suggestionCount
                  suggestionCount
 [ShoppingAdvisor] <*>------> [int] 

 

qualityDepth

public int qualityDepth
                  qualityDepth
 [ShoppingAdvisor] <*>------> [int] 

 

itemDepth

public int itemDepth
                  itemDepth
 [ShoppingAdvisor] <*>------> [int] 

 

matchAll

public boolean matchAll
                  matchAll
 [ShoppingAdvisor] <*>------> [boolean] 

 
Constructor Detail

ShoppingAdvisorImpl

public ShoppingAdvisorImpl()
                    throws CreateException
Method Detail

ejbCreate

public void ejbCreate()
               throws CreateException,
                      java.rmi.RemoteException
Overrides:
ejbCreate in class SessionImpl

ejbPostCreate

public void ejbPostCreate()
                   throws CreateException,
                          java.rmi.RemoteException
Overrides:
ejbPostCreate in class SessionImpl

ejbActivate

public void ejbActivate()
                 throws java.rmi.RemoteException
Overrides:
ejbActivate in class SessionImpl

ejbPassivate

public void ejbPassivate()
                  throws java.rmi.RemoteException
Overrides:
ejbPassivate in class SessionImpl

ejbRemove

public void ejbRemove()
               throws java.rmi.RemoteException
Overrides:
ejbRemove in class SessionImpl

setSessionContext

public void setSessionContext(SessionContext ctx)
                       throws java.rmi.RemoteException
Overrides:
setSessionContext in class SessionImpl

getSuggestionCount

public int getSuggestionCount()
                       throws java.rmi.RemoteException
Get the value of suggestionCount
Returns:
suggestionCount.

setSuggestionCount

public void setSuggestionCount(int suggestionCount)
                        throws java.rmi.RemoteException
Set the value of suggestionCount
Parameters:
suggestionCount - suggestionCount to be added

getQualityDepth

public int getQualityDepth()
                    throws java.rmi.RemoteException
Get the value of qualityDepth
Returns:
qualityDepth.

setQualityDepth

public void setQualityDepth(int qualityDepth)
                     throws java.rmi.RemoteException
Set the value of qualityDepth
Parameters:
qualityDepth - qualityDepth to be added

getItemDepth

public int getItemDepth()
                 throws java.rmi.RemoteException
Get the value of itemDepth
Returns:
itemDepth.

setItemDepth

public void setItemDepth(int itemDepth)
                  throws java.rmi.RemoteException
Set the value of itemDepth
Parameters:
itemDepth - itemDepth to be added

getMatchAll

public boolean getMatchAll()
                    throws java.rmi.RemoteException
Get the value of matchAll
Returns:
matchAll.

setMatchAll

public void setMatchAll(boolean matchAll)
                 throws java.rmi.RemoteException
Set the value of matchAll
Parameters:
matchAll - matchAll to be added

deleteItem

public void deleteItem(Item delete)
                throws java.rmi.RemoteException
Delete a single item from the shopping engine. It removes the ItemQualities reference and all references to the Item in ItemsByQuality.

addItem

public void addItem(Item item)
             throws java.rmi.RemoteException
Add a single item to the shopping engine.

addDefaultItem

public void addDefaultItem(Item item,
                           int degree)
                    throws java.rmi.RemoteException
Add an item that will be returned by the getDefaultSuggestions method.

deleteDefaultItem

public void deleteDefaultItem(Item item)
                       throws java.rmi.RemoteException
Remove an item from the list that will be returned when getDefaultSuggestions is called.

getDefaultSuggestions

public Suggestions getDefaultSuggestions()
                                  throws java.rmi.RemoteException
Return a default list of suggestions as configured with teh addDefaultItem method. This is used to create a list of specials or targeted items.

getSuggestions

public Suggestions getSuggestions(Customer customer)
                           throws java.rmi.RemoteException
Get suggestions based soley on a customers profile.

getSuggestions

public Suggestions getSuggestions(Customer customer,
                                  java.lang.String searchString)
                           throws java.rmi.RemoteException
Get suggestions based on a customer profile and a search string. The search string is tokenized into qualities and prepended to the customers prefered qualities. The resulting suggestions are the search matches that most closely match the customer profile. The customer may be null in which the method reverts to being a straight search.

learnCustomerPreference

public void learnCustomerPreference(Customer customer,
                                    Item item)
                             throws java.rmi.RemoteException
Adds an item's qualities to the customer's profile. This is generally done when a customer choose to purchase the item.

addCustomerPreference

public void addCustomerPreference(Customer customer,
                                  Quality quality)
                           throws java.rmi.RemoteException
Adds a quality to the customer's profile.

deleteCustomerPreference

public void deleteCustomerPreference(Customer customer,
                                     Quality quality)
                              throws java.rmi.RemoteException
Removes a quality from the customer's profile.

deleteCustomerProfile

public void deleteCustomerProfile(Customer customer)
                           throws java.rmi.RemoteException
Remove a customer profile. This generally accompanies the removal of a customer from the system.

getSuggestions

public Suggestions getSuggestions(java.lang.String searchString)
                           throws java.rmi.RemoteException
Tokenize the search string into a list of qualities to be searched for.

getSuggestions

public Suggestions getSuggestions(Customer customer,
                                  Item item)
                           throws java.rmi.RemoteException
Get suggestions based on the customer profile and the qualities of the item.

getCPHome

protected CustomerProfileHome getCPHome()
                                 throws java.rmi.RemoteException

getCustomerProfile

protected CustomerProfile getCustomerProfile(Customer customer)
                                      throws java.rmi.RemoteException
Parameters:
customer - Customer
Returns:
theory.smart.ebusiness.shoppingadvisor.CustomerProfile
Throws:
CreateException - The exception description.
java.rmi.RemoteException - The exception description.
FinderException - The exception description.

getDefaultItemsByQuality

protected ItemsByQuality getDefaultItemsByQuality()
                                           throws java.rmi.RemoteException

getIBQHome

protected ItemsByQualityHome getIBQHome()
                                 throws java.rmi.RemoteException

getIQHome

protected ItemQualitiesHome getIQHome()
                               throws java.rmi.RemoteException

getItemQualities

protected ItemQualities getItemQualities(Item item)
                                  throws java.rmi.RemoteException

getSuggestions

protected Suggestions getSuggestions(com.sun.java.util.collections.LinkedList qualities)
                              throws java.rmi.RemoteException
Parameters:
qualities - com.sun.java.util.collections.LinkedList
Returns:
theory.smart.ebusiness.shoppingadvisor.Suggestions
Throws:
java.rmi.RemoteException - The exception description.
FinderException - The exception description.

getSuggestions

protected Suggestions getSuggestions(com.sun.java.util.collections.LinkedList qualities,
                                     Suggestions suggestions)
                              throws java.rmi.RemoteException
Parameters:
qualities - com.sun.java.util.collections.LinkedList
Returns:
theory.smart.ebusiness.shoppingadvisor.Suggestions
Throws:
java.rmi.RemoteException - The exception description.
FinderException - The exception description.

removeItemReferences

protected void removeItemReferences(Item item,
                                    com.sun.java.util.collections.LinkedList listOfQualities)
                             throws java.rmi.RemoteException
Parameters:
listOfQualities - com.sun.java.util.collections.LinkedList
Throws:
java.rmi.RemoteException - The exception description.
FinderException - The exception description.

bea Systems, Inc.

© Copyright 2000 bea Systems, Inc. All rights reserved.