com.ibm.commerce.security.commands
Class MigrateUserEntriesCmdImpl

java.lang.Object
  |
  +--com.ibm.commerce.command.AbstractECCommand
        |
        +--com.ibm.commerce.command.TaskCommandImpl
              |
              +--com.ibm.commerce.security.commands.MigrateUserEntriesCmdImpl
All Implemented Interfaces:
ECCommand, MigrateUserEntriesCmd, TaskCommand

public class MigrateUserEntriesCmdImpl
extends TaskCommandImpl
implements MigrateUserEntriesCmd

This task command is used to migrate resources owned by one user to another. The manadorty resources that are migrated are Addresses, Current Orders, Interest Items, Order Items, Orders, and OrderTemplates.

Before executing this task command the following sets should be performed:

		setOldUser
		setNewUser
 


Field Summary
static java.lang.String ERRTASK_NAME
           
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.security.commands.MigrateUserEntriesCmd
COPYRIGHT, defaultCommandClassName, NAME
 
Constructor Summary
MigrateUserEntriesCmdImpl()
           
 
Method Summary
protected  UserAccessBean getNewUser()
          Retrieves the new user which would be recipient of migrated resources from the old user.
protected  UserAccessBean getOldUser()
          Retrieves the old user whose resources are to be migrated to the new user.
 void migrateAddresses(UserAccessBean abOldUser, UserAccessBean abNewUser)
          Migrates addresses from one user to another user.
 void migrateCurrentOrders(UserAccessBean abOldUser, UserAccessBean abNewUser)
          Migrates current orders from one user to another user.
 void migrateInterestItems(UserAccessBean abOldUser, UserAccessBean abNewUser)
          Migrates interest items from one user to another user.
 void migrateOrders(UserAccessBean abOldUser, UserAccessBean abNewUser)
          Migrates orders from one user to another user.
 void migrateOrderTemplates(UserAccessBean abOldUser, UserAccessBean abNewUser)
          Migrates order templates from one user to another user.
 void performExecute()
          Contains the actual business logic of the command It should be implemented by all the command writer.
 void setNewUser(UserAccessBean abNewUser)
          Sets the new user which would be recipient of migrated addresses from the old user.
 void setOldUser(UserAccessBean abOldUser)
          Sets the old user whose addresses are to be migrated to the new user.
 void validateParameters()
          Performs server side parameter checking.
 
Methods inherited from class com.ibm.commerce.command.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties
 

Field Detail

ERRTASK_NAME

public static final java.lang.String ERRTASK_NAME
Constructor Detail

MigrateUserEntriesCmdImpl

public MigrateUserEntriesCmdImpl()
Method Detail

getNewUser

protected UserAccessBean getNewUser()
Retrieves the new user which would be recipient of migrated resources from the old user.
Returns:
abNewUser The new user accessbean.

getOldUser

protected UserAccessBean getOldUser()
Retrieves the old user whose resources are to be migrated to the new user.
Returns:
The old user accessbean.

migrateAddresses

public void migrateAddresses(UserAccessBean abOldUser,
                             UserAccessBean abNewUser)
                      throws ECException
Description copied from interface: MigrateUserEntriesCmd
Migrates addresses from one user to another user.
Specified by:
migrateAddresses in interface MigrateUserEntriesCmd
Following copied from interface: com.ibm.commerce.security.commands.MigrateUserEntriesCmd
Parameters:
abOldUser - The Old User, whose addresses are to be migrated.
abNewUser - The New User, who will get the new addresses.

migrateCurrentOrders

public void migrateCurrentOrders(UserAccessBean abOldUser,
                                 UserAccessBean abNewUser)
                          throws ECException
Description copied from interface: MigrateUserEntriesCmd
Migrates current orders from one user to another user.
Specified by:
migrateCurrentOrders in interface MigrateUserEntriesCmd
Following copied from interface: com.ibm.commerce.security.commands.MigrateUserEntriesCmd
Parameters:
abOldUser - The Old User, whose current orders are to be migrated.
abNewUser - The New User, who will get the new current orders.

migrateInterestItems

public void migrateInterestItems(UserAccessBean abOldUser,
                                 UserAccessBean abNewUser)
                          throws ECException
Description copied from interface: MigrateUserEntriesCmd
Migrates interest items from one user to another user.
Specified by:
migrateInterestItems in interface MigrateUserEntriesCmd
Following copied from interface: com.ibm.commerce.security.commands.MigrateUserEntriesCmd
Parameters:
abOldUser - The Old User, whose interest items are to be migrated.
abNewUser - The New User, who will get the new interest items.

migrateOrders

public void migrateOrders(UserAccessBean abOldUser,
                          UserAccessBean abNewUser)
                   throws ECException
Description copied from interface: MigrateUserEntriesCmd
Migrates orders from one user to another user.
Specified by:
migrateOrders in interface MigrateUserEntriesCmd
Following copied from interface: com.ibm.commerce.security.commands.MigrateUserEntriesCmd
Parameters:
abOldUser - The Old User, whose orders are to be migrated.
abNewUser - The New User, who will get the new orders.

migrateOrderTemplates

public void migrateOrderTemplates(UserAccessBean abOldUser,
                                  UserAccessBean abNewUser)
                           throws ECException
Description copied from interface: MigrateUserEntriesCmd
Migrates order templates from one user to another user.
Specified by:
migrateOrderTemplates in interface MigrateUserEntriesCmd
Following copied from interface: com.ibm.commerce.security.commands.MigrateUserEntriesCmd
Parameters:
abOldUser - The Old User, whose order templates are to be migrated.
abNewUser - The New User, who will get the new order templates.

performExecute

public void performExecute()
                    throws ECException
Description copied from interface: ECCommand
Contains the actual business logic of the command It should be implemented by all the command writer.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

setNewUser

public void setNewUser(UserAccessBean abNewUser)
Description copied from interface: MigrateUserEntriesCmd
Sets the new user which would be recipient of migrated addresses from the old user.
Specified by:
setNewUser in interface MigrateUserEntriesCmd
Following copied from interface: com.ibm.commerce.security.commands.MigrateUserEntriesCmd
Parameters:
abNewUser - The new user accessbean.

setOldUser

public void setOldUser(UserAccessBean abOldUser)
Description copied from interface: MigrateUserEntriesCmd
Sets the old user whose addresses are to be migrated to the new user.
Specified by:
setOldUser in interface MigrateUserEntriesCmd
Following copied from interface: com.ibm.commerce.security.commands.MigrateUserEntriesCmd
Parameters:
abNewUser - The old user access bean.

validateParameters

public void validateParameters()
                        throws ECException
Description copied from interface: ECCommand
Performs server side parameter checking. This method replaces the checkParameters() method in a previous version of the code.

Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -