atg.projects.store.userprofiling
Class RecentlyViewedHistoryCollector

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.projects.store.userprofiling.RecentlyViewedHistoryCollector
All Implemented Interfaces:
atg.dms.patchbay.MessageSink, atg.naming.AbsoluteNameable, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameContextParentable, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.Configured, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

public class RecentlyViewedHistoryCollector
extends atg.nucleus.GenericService
implements atg.dms.patchbay.MessageSink

This MessageSink component listens for JMS 'product' ViewItem messages. It will receive all product information from the ProductBrowsed droplet which fires the JMS messages. When the product information is extracted from a JMS message, processing is delegated to the RecentlyViewedTools component which adds the product to the recently viewed list.

Version:
$Id: //hosting-blueprint/B2CBlueprint/version/10.2.1/EStore/src/atg/projects/store/userprofiling/RecentlyViewedHistoryCollector.java#3 $$Change: 804024 $
Author:
David Stewart

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  atg.repository.Repository mCatalogRepository
           
protected  java.lang.String mMessageType
           
protected  StoreProfileTools mProfileTools
           
protected  RecentlyViewedTools mRecentlyViewedTools
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
RecentlyViewedHistoryCollector()
           
 
Method Summary
 atg.repository.Repository getCatalogRepository()
           
 java.lang.String getMessageType()
           
 StoreProfileTools getProfileTools()
           
 RecentlyViewedTools getRecentlyViewedTools()
           
 void processMessage(atg.userprofiling.dms.ViewItemMessage pItemMessage)
          Process received product data item.
 void receiveMessage(java.lang.String pPortName, javax.jms.Message pMessage)
          Receives JMS message and processes it if the message type in the message is equal to mMessageType and the itemType in the message is equal to the 'product' item name.
 void setCatalogRepository(atg.repository.Repository pCatalogRepository)
           
 void setMessageType(java.lang.String pMessageType)
           
 void setProfileTools(StoreProfileTools pProfileTools)
           
 void setRecentlyViewedTools(RecentlyViewedTools pRecentlyViewedTools)
           
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

mRecentlyViewedTools

protected RecentlyViewedTools mRecentlyViewedTools

mMessageType

protected java.lang.String mMessageType

mCatalogRepository

protected atg.repository.Repository mCatalogRepository

mProfileTools

protected StoreProfileTools mProfileTools
Constructor Detail

RecentlyViewedHistoryCollector

public RecentlyViewedHistoryCollector()
Method Detail

getRecentlyViewedTools

public RecentlyViewedTools getRecentlyViewedTools()
Returns:
the ProfileTools

setRecentlyViewedTools

public void setRecentlyViewedTools(RecentlyViewedTools pRecentlyViewedTools)
Parameters:
pProfileTools - the ProfileTools to set

getMessageType

public java.lang.String getMessageType()
Returns:
The JMS message type

setMessageType

public void setMessageType(java.lang.String pMessageType)
Parameters:
pMessageType - The new JMS message type

getCatalogRepository

public atg.repository.Repository getCatalogRepository()
Returns:
The catalogRepository.

setCatalogRepository

public void setCatalogRepository(atg.repository.Repository pCatalogRepository)
Parameters:
The - catalogRepository.

getProfileTools

public StoreProfileTools getProfileTools()
Returns:
the ProfileTools

setProfileTools

public void setProfileTools(StoreProfileTools pProfileTools)
Parameters:
pProfileTools - the ProfileTools to set

receiveMessage

public void receiveMessage(java.lang.String pPortName,
                           javax.jms.Message pMessage)
                    throws javax.jms.JMSException
Receives JMS message and processes it if the message type in the message is equal to mMessageType and the itemType in the message is equal to the 'product' item name.

Specified by:
receiveMessage in interface atg.dms.patchbay.MessageSink
Throws:
javax.jms.JMSException

processMessage

public void processMessage(atg.userprofiling.dms.ViewItemMessage pItemMessage)
Process received product data item. The product repository item, siteId, and profileId are extracted from the message. If no profileId is supplied then the profile associated with the current thread is used. Using these references, the recentlyViewed repository item can be updated.

Parameters:
pItemMessage - The JMS message to be processed.