atg.projects.b2bstore.order
Class ProcUpdateCatalogRefOfProfile

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.projects.b2bstore.order.ProcUpdateCatalogRefOfProfile
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, PipelineProcessor, java.util.EventListener

public class ProcUpdateCatalogRefOfProfile
extends GenericService
implements PipelineProcessor

This processor is called in the final stages of processOrder chain. Whenever user purchases any items, those items and profileId of the user are stored in userCatalogRefs item descriptor.


Field Summary
static java.lang.String CLASS_VERSION
           
static java.util.ResourceBundle sResourceBundle
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.service.pipeline.PipelineProcessor
STOP_CHAIN_EXECUTION, STOP_CHAIN_EXECUTION_AND_COMMIT, STOP_CHAIN_EXECUTION_AND_ROLLBACK
 
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
ProcUpdateCatalogRefOfProfile()
           
 
Method Summary
protected  void checkAndUpdate(Order pOrder, RepositoryItem pProfile)
          This function checks the profile for the catalogRefId, and updates the profile with catalogRefId if it doesn't contain the catalog
protected  boolean checkProfile(CommerceItem pCItem, RepositoryItem pProfile)
          This function checks whether the given profile contains the catalogRefId of the commerce item.
 Repository getRepository()
          Returns Order Repository
 int[] getRetCodes()
          The return codes that this processor can return.
 int runProcess(java.lang.Object pParam, PipelineResult pResult)
          This method is executed by the pipeline manager to execute this process.
 void setRepository(Repository pRepository)
          Sets Order Repository
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, 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, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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

sResourceBundle

public static final java.util.ResourceBundle sResourceBundle
Constructor Detail

ProcUpdateCatalogRefOfProfile

public ProcUpdateCatalogRefOfProfile()
Method Detail

setRepository

public void setRepository(Repository pRepository)
Sets Order Repository


getRepository

public Repository getRepository()
Returns Order Repository


runProcess

public int runProcess(java.lang.Object pParam,
                      PipelineResult pResult)
               throws java.lang.Exception
This method is executed by the pipeline manager to execute this process. This processor takes Order & Profile Parameters from the passed parameters and tries to add the catalogRef of all the commerce Items to the userCatalogRefs item-descriptor.

Specified by:
runProcess in interface PipelineProcessor
Parameters:
pParam - an optional user parameter
pResult - the PipelineResult object which is used to return errors or other data
Returns:
an integer value which is mapped to the next processor to execute. STOP_CHAIN_EXECUTION will notify the PipelineManager to stop execution. An unmapped value will throw a RunProcessException.
Throws:
java.lang.Exception

checkAndUpdate

protected void checkAndUpdate(Order pOrder,
                              RepositoryItem pProfile)
                       throws RepositoryException
This function checks the profile for the catalogRefId, and updates the profile with catalogRefId if it doesn't contain the catalog

Parameters:
pOrder - the order
pProfile - the profile to check and update for.
Throws:
RepositoryException

checkProfile

protected boolean checkProfile(CommerceItem pCItem,
                               RepositoryItem pProfile)
                        throws RepositoryException
This function checks whether the given profile contains the catalogRefId of the commerce item. If it contains then it returns false, else returns true.

Parameters:
pCItem - the CommerceItem which contains the catalogRefId.
pProfile - the profile of the user to check for.
Returns:
true if profile contains catalogRefId, false else.
Throws:
RepositoryException

getRetCodes

public int[] getRetCodes()
The return codes that this processor can return. The list of return codes are:

Specified by:
getRetCodes in interface PipelineProcessor
Returns:
an int[] of the valid return codes