© 2001 BEA Systems, Inc.

com.beasys.commerce.ebusiness.customer.pipeline
Class UpdateUserPC

java.lang.Object
  |
  +--com.beasys.commerce.foundation.pipeline.CommercePipelineComponent
        |
        +--com.beasys.commerce.ebusiness.customer.pipeline.UpdateUserPC
All Implemented Interfaces:
PipelineComponent
Direct Known Subclasses:
AddShippingAddressPC, DeleteShippingAddressPC, UpdateBasicInfoPC, UpdateDemographicInfoPC, UpdatePaymentInfoPC, UpdateShippingInfoPC

public abstract class UpdateUserPC
extends CommercePipelineComponent

This class is the base class for several pipeline components that update the Customer in the database. It finds the Customer entity EJB and calls updateCustomer, an abstract method defined by sub classes.

It also provides methods to interact with the Customer cache (implemented in the DirectPropertyManager) that should be called by subclasses as they update the properties to ensure that the cache stays up to date.


Constructor Summary
UpdateUserPC()
           
 
Method Summary
 PipelineSession process(PipelineSession pSession)
          Gets the Customer object and calls updateCustomer to make any changes to it.
 void setCustomerProperty(java.lang.String key, java.lang.Object value, Customer customer)
          Call to set a non-collection typed property on the customer.
 void setCustomerProperty(java.lang.String scopeName, java.lang.String key, java.lang.Object value, Customer customer)
          Call to set a non-collection typed property on the customer.
protected  void setPropertyIntoCache(java.lang.String propertyName, java.lang.Object value, java.lang.String customerId)
          Set a value into the cache.
abstract  void updateCustomer(PipelineSession pSession, Customer customer, CustomerValue customerValue)
          Subclasses must implement to update the customer object.
 
Methods inherited from class com.beasys.commerce.foundation.pipeline.CommercePipelineComponent
getConnection, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateUserPC

public UpdateUserPC()
Method Detail

process

public PipelineSession process(PipelineSession pSession)
                        throws PipelineFatalException,
                               PipelineNonFatalException,
                               CustomerMissingException,
                               java.rmi.RemoteException
Gets the Customer object and calls updateCustomer to make any changes to it.
Parameters:
pSession - the pipeline session to operate on
Returns:
the new pipeline session
Throws:
CustomerMissingException - if the customer is unexpectedly missing from the database
PipelineFatalException - for fatal pipeline errors thrown by one of its derived classes
PipelineNonFatalException - for non-fatal pipeline errors thrown by one of its baseclasses
java.rmi.RemoteException - when the Customer object is unaccessible or one of it's derived classes throws one

setPropertyIntoCache

protected void setPropertyIntoCache(java.lang.String propertyName,
                                    java.lang.Object value,
                                    java.lang.String customerId)
                             throws java.rmi.RemoteException
Set a value into the cache. Either setCustomerProperty() must be called to update a customer object or the object can be updated directly then this method must be called afterward
Parameters:
propertyName - the name of the property that was set
value - the value the property was assigned.
customerId - identifier to use for the customers profile key.
Throws:
java.rmi.RemoteException - when the Customer object is not accessible

setCustomerProperty

public void setCustomerProperty(java.lang.String key,
                                java.lang.Object value,
                                Customer customer)
                         throws java.rmi.RemoteException
Call to set a non-collection typed property on the customer. It sets both the Customer object itself and in the cache. Do not call on a collection typed property as that isn't supported. For collections, set the Customer object directly then call setPropertyIntoCache() to update the cache.
Parameters:
key - the property to set
value - the value to assign to the key
customer - Customer object to update
RemoteException - when the customer object is not accessible

setCustomerProperty

public void setCustomerProperty(java.lang.String scopeName,
                                java.lang.String key,
                                java.lang.Object value,
                                Customer customer)
                         throws java.rmi.RemoteException
Call to set a non-collection typed property on the customer. It sets both the Customer object itself and in the cache. Do not call on a collection typed property as that isn't supported. For collections, set the Customer object directly then call setPropertyIntoCache() to update the cache. This property takes in also the scope name for the customer property.
Parameters:
key - the property to set
value - the value to assign to the key
customer - Customer object to update
RemoteException - when the customer object is not accessible

updateCustomer

public abstract void updateCustomer(PipelineSession pSession,
                                    Customer customer,
                                    CustomerValue customerValue)
                             throws PipelineFatalException,
                                    java.rmi.RemoteException,
                                    PipelineNonFatalException
Subclasses must implement to update the customer object.
Parameters:
pSession - PipelineSession from where it gets the CusotmerValue object and password as needed.
customer - Customer object.
customerValue - CusotmerValue object.
Throws:
PipelineFatalException -  
PipelineNonFatalException -  
java.rmi.RemoteException -  

© 2001 BEA Systems, Inc.

Copyright © 2001 BEA Systems, Inc. All Rights Reserved