atg.commerce.order.abandoned
Class AbandonedOrderEventListener

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.order.abandoned.AbandonedOrderEventListener
All Implemented Interfaces:
MessageSink, atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, atg.naming.NameContextPreBindingListener, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class AbandonedOrderEventListener
extends GenericService
implements atg.naming.NameContextPreBindingListener, MessageSink

This class determines if there is a transient order associated with an expired session that should be logged as an abandoned order.

This class must be added to the SessionManager's list of nameContextBindingListeners in order for it to know when sessions are destroyed.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
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
AbandonedOrderEventListener()
          Empty constructor.
 
Method Summary
 MessageSender getMessageSender()
           
 double getMinimumAmount()
          Returns the minimum amount an order can be valued for it to be logged.
protected  atg.nucleus.NucleusNameResolver getNameResolver(NameContext pSession)
          Gets a name resolver that is scoped to the session.
protected  RepositoryItem getProfile(DynamoHttpServletRequest pRequest)
          Gets the session-scoped profile from the given request
protected  java.lang.String getProfileId(DynamoHttpServletRequest pRequest)
          Gets the profile id for the current request's session-scoped profile
 java.lang.String getProfileItemName()
          Returns the name of the user item descriptor in the profile repository.
 java.lang.String getProfilePath()
          The full name of the Profile component for every request.
 Repository getProfileRepository()
          Returns the repository in which user profiles are stored.
protected  OrderHolder getShoppingCart(DynamoHttpServletRequest pRequest)
           
 java.lang.String getShoppingCartPath()
          The full name of the ShoppingCart component for every request.
 SiteContextManager getSiteContextManager()
           
 java.lang.String getSubmitOrderJMSType()
          Returns the JMS type of the SubmitOrder event.
 boolean isBroadcastExpiredSessionEvents()
          Returns property BroadcastExpiredSessionEvents
 boolean isEnabled()
           
 void nameContextElementPreBound(NameContextBindingEvent pEvent)
          Dummy implementation to satisfy interface requirement.
 void nameContextElementPreUnbound(NameContextBindingEvent pEvent)
          Called just before a session is destroyed.
 void receiveMessage(java.lang.String pPortName, javax.jms.Message pMessage)
          This is called to notify the component that a Message has arrived through the given input port.
protected  void sendTransientOrderEvent(java.util.HashSet<java.lang.String> pProcessedOrderIds, atg.nucleus.NucleusNameResolver pResolver, java.lang.String pSessionId)
           
 void setBroadcastExpiredSessionEvents(boolean pBroadcastExpiredSessionEvents)
          Sets property BroadcastExpiredSessionEvents
 void setEnabled(boolean pEnabled)
          boolean indicating if this component should do anything.
 void setMessageSender(MessageSender pMessageSender)
          The component that sends abandonment-related JMS messages.
 void setMinimumAmount(double pMinimumAmount)
          Sets the minimum amount an order can be valued for it to be logged.
 void setProfileItemName(java.lang.String pProfileItemName)
          Sets the name of the user item descriptor in the profile repository.
 void setProfilePath(java.lang.String pValue)
          The full name of the Profile component for every request.
 void setProfileRepository(Repository pProfileRepository)
          Sets the repository in which user profiles are stored
 void setShoppingCartPath(java.lang.String pValue)
          The full name of the ShoppingCart component for every request.
 void setSiteContextManager(SiteContextManager pSiteContextManager)
           
 void setSubmitOrderJMSType(java.lang.String pSubmitOrderJMSType)
          Sets the JMS type of the SubmitOrder event
 
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 java.lang.String CLASS_VERSION
Class version string

Constructor Detail

AbandonedOrderEventListener

public AbandonedOrderEventListener()
Empty constructor.

Method Detail

getSiteContextManager

public SiteContextManager getSiteContextManager()

setSiteContextManager

public void setSiteContextManager(SiteContextManager pSiteContextManager)

setBroadcastExpiredSessionEvents

public void setBroadcastExpiredSessionEvents(boolean pBroadcastExpiredSessionEvents)
Sets property BroadcastExpiredSessionEvents


isBroadcastExpiredSessionEvents

public boolean isBroadcastExpiredSessionEvents()
Returns property BroadcastExpiredSessionEvents


setEnabled

public void setEnabled(boolean pEnabled)
boolean indicating if this component should do anything.

Parameters:
pEnabled - boolean indicating if this component should do anything.

isEnabled

public boolean isEnabled()
Returns:
boolean indicating if this component should do anything.

setMessageSender

public void setMessageSender(MessageSender pMessageSender)
The component that sends abandonment-related JMS messages.

Parameters:
pMessageSender - the component that sends abandonment-related JMS messages.

getMessageSender

public MessageSender getMessageSender()
Returns:
Returns the component that sends abandonment-related JMS messages.

setMinimumAmount

public void setMinimumAmount(double pMinimumAmount)
Sets the minimum amount an order can be valued for it to be logged.


getMinimumAmount

public double getMinimumAmount()
Returns the minimum amount an order can be valued for it to be logged.


setProfileItemName

public void setProfileItemName(java.lang.String pProfileItemName)
Sets the name of the user item descriptor in the profile repository.


getProfileItemName

public java.lang.String getProfileItemName()
Returns the name of the user item descriptor in the profile repository.


setProfileRepository

public void setProfileRepository(Repository pProfileRepository)
Sets the repository in which user profiles are stored


getProfileRepository

public Repository getProfileRepository()
Returns the repository in which user profiles are stored.


setProfilePath

public void setProfilePath(java.lang.String pValue)
The full name of the Profile component for every request.


getProfilePath

public java.lang.String getProfilePath()
The full name of the Profile component for every request.


setShoppingCartPath

public void setShoppingCartPath(java.lang.String pValue)
The full name of the ShoppingCart component for every request.


getShoppingCartPath

public java.lang.String getShoppingCartPath()
The full name of the ShoppingCart component for every request.


setSubmitOrderJMSType

public void setSubmitOrderJMSType(java.lang.String pSubmitOrderJMSType)
Sets the JMS type of the SubmitOrder event


getSubmitOrderJMSType

public java.lang.String getSubmitOrderJMSType()
Returns the JMS type of the SubmitOrder event.


nameContextElementPreBound

public void nameContextElementPreBound(NameContextBindingEvent pEvent)
Dummy implementation to satisfy interface requirement.

Specified by:
nameContextElementPreBound in interface atg.naming.NameContextPreBindingListener

nameContextElementPreUnbound

public void nameContextElementPreUnbound(NameContextBindingEvent pEvent)
Called just before a session is destroyed.

Specified by:
nameContextElementPreUnbound in interface atg.naming.NameContextPreBindingListener

sendTransientOrderEvent

protected void sendTransientOrderEvent(java.util.HashSet<java.lang.String> pProcessedOrderIds,
                                       atg.nucleus.NucleusNameResolver pResolver,
                                       java.lang.String pSessionId)

receiveMessage

public void receiveMessage(java.lang.String pPortName,
                           javax.jms.Message pMessage)
                    throws javax.jms.JMSException
Description copied from interface: MessageSink
This is called to notify the component that a Message has arrived through the given input port. The MessageSink should be prepared to handle concurrent calls of this method from multiple Threads.

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

getProfile

protected RepositoryItem getProfile(DynamoHttpServletRequest pRequest)
Gets the session-scoped profile from the given request

Parameters:
pRequest - the request to examine
Returns:
a RepositoryItem of the current profile for this session (as determined by the request)

getShoppingCart

protected OrderHolder getShoppingCart(DynamoHttpServletRequest pRequest)

getProfileId

protected java.lang.String getProfileId(DynamoHttpServletRequest pRequest)
Gets the profile id for the current request's session-scoped profile

Parameters:
pRequest - the request to examine
Returns:
the profile id of the current request's session-scoped profile, or null if there is none

getNameResolver

protected atg.nucleus.NucleusNameResolver getNameResolver(NameContext pSession)
Gets a name resolver that is scoped to the session. Fortunately for us, the sesion object just so happens to also be a NameContext from the session.

Parameters:
pSession - the session NameContext
Returns:
a name resolver