Class MigrateUserEntriesCmdImpl
- java.lang.Object
-
- com.ibm.websphere.command.TargetableCommandImpl
-
- com.ibm.websphere.command.CacheableCommandImpl
-
- com.ibm.commerce.command.MeasuredCacheableCommandImpl
-
- com.ibm.commerce.command.AbstractECTargetableCommand
-
- com.ibm.commerce.command.TaskCommandImpl
-
- com.ibm.commerce.security.commands.MigrateUserEntriesCmdImpl
-
- All Implemented Interfaces:
- com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, MigrateUserEntriesCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable
- Direct Known Subclasses:
- GiftRegistryMigrateUserEntriesCmdImpl
public class MigrateUserEntriesCmdImpl extends TaskCommandImpl implements MigrateUserEntriesCmd
This task command is used to migrate resources owned by one user to another. The mandatory resources that are migrated are Addresses, Current Orders, Interest Items, Order Items, Orders, and Order templates.
By default, this command will not merge the shopping cart for the 2 users, but it can be configured to do so by:
- a) Setting the mergeCart flag in the request property in the command context to true. OR:
- b) Setting MemberSubSystem/MergeCartsAtAuthentication/enabled in the wc-server.xml to true.
Before executing this task command the following sets should be performed:
- setOldUser
- setNewUser
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
ERRTASK_NAME
Error task name.-
Fields inherited from interface com.ibm.commerce.security.commands.MigrateUserEntriesCmd
COMMIT_TRANSACTION_KEY, defaultCommandClassName, NAME
-
-
Constructor Summary
Constructors Constructor and Description MigrateUserEntriesCmdImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
mergeCart(UserAccessBean abNewUser)
This method is used to merge the cart of the user.void
migrateAddresses(UserAccessBean abOldUser, UserAccessBean abNewUser)
This method migrates addresses from one user to another user.void
migrateCoupons(UserAccessBean abOldUser, UserAccessBean abNewUser)
This method migrates coupons from one user to another user.void
migrateCurrentOrders(UserAccessBean abOldUser, UserAccessBean abNewUser)
This method migrates the current orders from one user to another user.void
migrateExperimentResult(UserAccessBean abNewUser)
This method migrates experiment results from a generic or guest user to the given new user.void
migrateExperimentResult(UserAccessBean abOldUser, UserAccessBean abNewUser)
This method migrates experiment results from a generic or guest user to the given new user.void
migrateInterestItems(UserAccessBean abOldUser, UserAccessBean abNewUser)
This method migrates interest items from one user to another user.void
migrateOrders(UserAccessBean abOldUser, UserAccessBean abNewUser)
This method migrates orders from one user to another user.void
migrateOrderTemplates(UserAccessBean abOldUser, UserAccessBean abNewUser)
This method migrates order templates from one user to another user.void
migratePersonalization(UserAccessBean abOldUser, UserAccessBean abNewUser)
This method migrates the customer segment information for a customer.static void
migratePersonalizationId(java.lang.Integer storeId, java.lang.String origPersonalizationId, java.lang.String newPersonalizationId)
Reserved for IBM internal use.void
migratePhoenixCoupon(UserAccessBean abOldUser, UserAccessBean abNewUser)
This method migrates Phoenix Coupons.void
performExecute()
This method migrates all resources for a user.void
setNewUser(UserAccessBean abNewUser)
This method sets the new user who is the recipient of the migrated resources from the old user.void
setOldUser(UserAccessBean abOldUser)
This method sets the old user whose resources are to be migrated to the new user.void
validateParameters()
This method validates the parameters by ensuring that the new user and the old user parameters have been set.-
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
Methods inherited from class com.ibm.websphere.command.CacheableCommandImpl
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
-
Methods inherited from class com.ibm.websphere.command.TargetableCommandImpl
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.websphere.command.CacheableCommand
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
-
Methods inherited from interface com.ibm.websphere.command.TargetableCommand
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
-
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
-
-
-
Field Detail
-
ERRTASK_NAME
public static final java.lang.String ERRTASK_NAME
Error task name.- See Also:
- Constant Field Values
-
-
Method Detail
-
migrateAddresses
public void migrateAddresses(UserAccessBean abOldUser, UserAccessBean abNewUser) throws ECException
This method migrates addresses from one user to another user. In the case of nickname collision, the most recent address overwrites the old one. In the case of collision on the self-address, whichever address is selected is assigned the self-address flag.- Specified by:
migrateAddresses
in interfaceMigrateUserEntriesCmd
- Parameters:
abOldUser
- The Old User, whose addresses are to be migrated.abNewUser
- The New User, who will get the new addresses.- Throws:
ECException
-
migrateCoupons
public void migrateCoupons(UserAccessBean abOldUser, UserAccessBean abNewUser) throws ECException
This method migrates coupons from one user to another user. Only the coupons in state 'Usable' will be transfered.- Parameters:
abOldUser
- The Old User, whose coupons are to be migrated.abNewUser
- The New User, who will get the new coupons.- Throws:
ECException
-
migratePersonalization
public void migratePersonalization(UserAccessBean abOldUser, UserAccessBean abNewUser) throws ECException
This method migrates the customer segment information for a customer. The customer segments to which the customer belonged to by their personalization ID will be copied from a guest user to the new user.- Parameters:
abOldUser
- The old user, who may have entries in the DMMBRGRPPZN database table.abNewUser
- The new user, to whom the DMMBRGRPPZN entries should be copied.- Throws:
ECException
-
migrateExperimentResult
public void migrateExperimentResult(UserAccessBean abNewUser) throws ECException
This method migrates experiment results from a generic or guest user to the given new user.- Parameters:
abNewUser
- The New User, who owns the experiment results.- Throws:
ECException
-
migrateExperimentResult
public void migrateExperimentResult(UserAccessBean abOldUser, UserAccessBean abNewUser) throws ECException
This method migrates experiment results from a generic or guest user to the given new user.- Parameters:
abOldUser
- The Old User, who owns the experiment results.abNewUser
- The New User, who owns the experiment results.- Throws:
ECException
-
migratePhoenixCoupon
public void migratePhoenixCoupon(UserAccessBean abOldUser, UserAccessBean abNewUser) throws ECException
This method migrates Phoenix Coupons.- Parameters:
abOldUser
- - the old user, whose coupons are to be migrated.abNewUser
- - the new user, who will receive the new coupons.- Throws:
ECException
-
migrateCurrentOrders
public void migrateCurrentOrders(UserAccessBean abOldUser, UserAccessBean abNewUser) throws ECException
This method migrates the current orders from one user to another user.- Specified by:
migrateCurrentOrders
in interfaceMigrateUserEntriesCmd
- Parameters:
abOldUser
- The Old User, whose current orders are to be migrated.abNewUser
- The New User, who will get the new current orders.- Throws:
ECException
-
migrateInterestItems
public void migrateInterestItems(UserAccessBean abOldUser, UserAccessBean abNewUser) throws ECException
This method migrates interest items from one user to another user.- Specified by:
migrateInterestItems
in interfaceMigrateUserEntriesCmd
- Parameters:
abOldUser
- The Old User, whose interest items are to be migrated.abNewUser
- The New User, who will get the new interest items.- Throws:
ECException
-
migrateOrders
public void migrateOrders(UserAccessBean abOldUser, UserAccessBean abNewUser) throws ECException
This method migrates orders from one user to another user.- Specified by:
migrateOrders
in interfaceMigrateUserEntriesCmd
- Parameters:
abOldUser
- The Old User, whose orders are to be migrated.abNewUser
- The New User, who will get the new orders.- Throws:
ECException
-
migrateOrderTemplates
public void migrateOrderTemplates(UserAccessBean abOldUser, UserAccessBean abNewUser) throws ECException
This method migrates order templates from one user to another user.- Specified by:
migrateOrderTemplates
in interfaceMigrateUserEntriesCmd
- Parameters:
abOldUser
- The Old User, whose order templates are to be migrated.abNewUser
- The New User, who will get the new order templates.- Throws:
ECException
-
performExecute
public void performExecute() throws ECException
This method migrates all resources for a user. It delegates to the following methods:- migrateAddresses()
- migrateInterestItems()
- migrateCurrentOrders()
- migrateOrderTemplates()
- migrateCoupons()
- migratePhoenixCoupon()
- migrateExperimentResults()
- migratePersonalization()
- Specified by:
performExecute
in interfaceECCommand
- Specified by:
performExecute
in interfacecom.ibm.websphere.command.TargetableCommand
- Overrides:
performExecute
in classAbstractECTargetableCommand
- Throws:
ECException
-
setNewUser
public void setNewUser(UserAccessBean abNewUser)
This method sets the new user who is the recipient of the migrated resources from the old user.- Specified by:
setNewUser
in interfaceMigrateUserEntriesCmd
- Parameters:
abNewUser
- The new user access bean.
-
setOldUser
public void setOldUser(UserAccessBean abOldUser)
This method sets the old user whose resources are to be migrated to the new user.- Specified by:
setOldUser
in interfaceMigrateUserEntriesCmd
- Parameters:
abOldUser
- The old user access bean.
-
validateParameters
public void validateParameters() throws ECException
This method validates the parameters by ensuring that the new user and the old user parameters have been set.- Specified by:
validateParameters
in interfaceECCommand
- Overrides:
validateParameters
in classAbstractECTargetableCommand
- Throws:
ECException
-
migratePersonalizationId
public static void migratePersonalizationId(java.lang.Integer storeId, java.lang.String origPersonalizationId, java.lang.String newPersonalizationId) throws ECSystemException
Reserved for IBM internal use.This method migrates the data associated with an original personalization ID to a new personalization ID. This method is expected to be called when a guest user does operations on the site which are being tracked against an original personalization ID, and then later registers. Once the user registers, a new personalization ID is assigned to the user if the old personalization ID is already associated with an existing registered user in the site. In this case, any information that was tracked against the old personalization ID needs to be migrated to the new personalization ID.
- Parameters:
storeId
- store ID. If store ID is null, the user behavior information will not be updated.origPersonalizationId
- old Personalization IDnewPersonalizationId
- new Personalization ID- Throws:
ECSystemException
-
mergeCart
public void mergeCart(UserAccessBean abNewUser) throws ECException
This method is used to merge the cart of the user.- Parameters:
abNewUser
- The new user, who will receive the new order tempaltes.- Throws:
ECException
-
-